python4delphi icon indicating copy to clipboard operation
python4delphi copied to clipboard

Subclassing not properly defined

Open tomekkosinski opened this issue 3 years ago • 1 comments

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

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

tomekkosinski avatar Sep 24 '22 09:09 tomekkosinski

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 avatar Sep 30 '22 02:09 pyscripter

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

pyscripter avatar Dec 27 '22 23:12 pyscripter