Skip to content

Subclassing not properly defined #382

New issue

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

By clicking “No 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? No Sign in to your account

Closed
tomekkosinski opened this issue Sep 24, 2022 · 2 comments
Closed

Subclassing not properly defined #382

tomekkosinski opened this issue Sep 24, 2022 · 2 comments

Comments

@tomekkosinski
Copy link

tomekkosinski commented Sep 24, 2022

if issubclass( Form, CustomForm ):
print('yeee')
else:
print('nope') # always here

It seems that tp_base of the inherited class is not set.

@pyscripter
Copy link
Owner

pyscripter commented Sep 30, 2022

Indeed, tp_base is never set. Is it important?

Could be fixed in a couple of ways.

  1. RegisterDelphiWrapper should try to find the nearest parent class registered and set tp_base accordingly
  2. Implement __subclasshook__ in TPyDelphiObject

@pyscripter
Copy link
Owner

pyscripter commented Dec 27, 2022

@cosina Could you please confirm it is now working as expected?

pyscripter added a commit that referenced this issue Dec 28, 2022
No Sign up for free to join this conversation on GitHub. Already have an account? No Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants