Skip to content
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

Order Classes Automatically #12

Closed
kwabenantim opened this issue Mar 10, 2024 · 1 comment · Fixed by #53 or #54
Closed

Order Classes Automatically #12

kwabenantim opened this issue Mar 10, 2024 · 1 comment · Fixed by #53 or #54
Assignees

Comments

@kwabenantim
Copy link
Member

kwabenantim commented Mar 10, 2024

Summary

The order in which classes are added in package_info.yml is important. This order is propagated forward to the module wrappers. Base classes come before derived classes, a class should come before other classes that refer to it etc. When there are many classes in package_info.yml, figuring out an order that works can be hit or miss by trial and error, especially when adding a new class to an existing configuration that already contains many classes.

It would be a useful feature if cppwg could automatically work out the order to include classes in. Users could add classes to package_info.yml in any order without having to manually work out an order that won't break things. Classes could be added in alphabetical order, for instance, which would make it easier to find things when manually inspecting the configuration.

@kwabenantim
Copy link
Member Author

kwabenantim commented Mar 20, 2024

When class registration is out of order, errors like this show up:

ImportError: arg(): could not convert default argument 
'foo_ptr: Foo*' in method '<class 'Bar'>.__init__' 
into a Python object (type not registered yet?)

This happens when Bar depends on Foo but Bar gets registered before Foo.

kwabenantim added a commit that referenced this issue Sep 21, 2024
kwabenantim added a commit that referenced this issue Sep 21, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 22, 2024
kwabenantim added a commit that referenced this issue Sep 26, 2024
kwabenantim added a commit that referenced this issue Sep 26, 2024
kwabenantim added a commit that referenced this issue Nov 13, 2024
kwabenantim added a commit that referenced this issue Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant