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

ENH: Allow instantiation of more CTK objects in Python #1078

Merged
merged 1 commit into from
Apr 5, 2023

Conversation

lassoan
Copy link
Member

@lassoan lassoan commented Apr 5, 2023

CTK objects that only had default constructor (no Object* parameter) were not possible to instantiate in Python:

a=ctk.ctkErrorLogLevel()
Traceback (most recent call last):
File "", line 1, in
ValueError: No constructors available for ctkErrorLogLevel

The issue is fixed by passing arguments of the superclass constructor.

This pull request (along with #985) supersedes #796. Accepting arguments in the constructor (that are passed on to the superclass constructor) is a better solution than accepting wrapping of constructors that don't take any arguments.

CTK objects that only had default constructor (no Object* parameter) were not possible to instantiate in Python:

>>> a=ctk.ctkErrorLogLevel()
Traceback (most recent call last):
  File "<console>", line 1, in <module>
ValueError: No constructors available for ctkErrorLogLevel

The issue is fixed by passing arguments of the superclass constructor.
Copy link
Member

@pieper pieper left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@jcfr may want to have a look. As I recall he wrote the script that looks for this pattern to know to make the bindings. I believe this is the correct change to make it work for these classes.

@jcfr jcfr merged commit 3817230 into commontk:master Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants