Skip to content

changes with updates printing policy #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Vipul-Cariappa
Copy link
Collaborator

No description provided.

@Vipul-Cariappa Vipul-Cariappa force-pushed the dev/test-update branch 5 times, most recently from 06364b5 to 4e5502c Compare July 15, 2025 12:12
@Vipul-Cariappa Vipul-Cariappa marked this pull request as ready for review July 16, 2025 08:22
@@ -131,7 +131,7 @@ class Abstract2 {

template<class A, class B, class C = A>
C multiply(A a, B b) {
return C{a*b};
return static_cast<C>(a * b);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that something we could upstream?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I will open a PR changing it.

@@ -698,9 +696,9 @@ def test09_templated_function(self):
assert 'multiply' in cppyy.gbl.__dict__

assert mul(1, 2) == 2
assert 'multiply<int,int,int>' in cppyy.gbl.__dict__
assert 'multiply<int, int, int>' in cppyy.gbl.__dict__

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make the system accept both space and no space in the comparisons?

raises(AttributeError, getattr, fragile, "no_such_class")
# FIXME: Should be fixed with root dictionary
# look at https://github.com/wlav/cppyy/discussions/306
# raises(AttributeError, getattr, fragile, "no_such_class")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our system has no notion of root dictionaries. We will have to fix it in some other way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, I guess this should not be part of the test.

size_t Sizeof() { return s.size() + 1; }
};
}
""")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that diverge from upstream?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Merged PR upstream: wlav#305.

""")

assert not '__abstractmethods__' in dir(cppyy.gbl.docs.ptrDocs)
assert '__class__' in dir(cppyy.gbl.docs.ptrDocs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same PR as above.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I was confused because this PR apparently does too many things.

def test_doc_strings(self):
import cppyy
from cppyy.gbl import Concrete
assert 'void Concrete::array_method(int* ad, int size)' in Concrete.array_method.__doc__
assert 'void Concrete::array_method(double* ad, int size)' in Concrete.array_method.__doc__
assert 'void Concrete::array_method(int * ad, int size)'.replace(" ", "") in Concrete.array_method.__doc__.replace(" ", "")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the fix should go in CppInterOp's interfaces that give away strings. That would be a consistent way to make this everywhere.

@wlav, what's your take. How we can make this more resilient to whitespace changes coming from clang's printing?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't care about the spaces per se, although consistency would be nice, this is just a documentation string. But that line should not remove the check for double*. Point being that checking for both is needed to make sure all overloads are represented in the doc string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants