You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Pyjs.org Users
I am trying to get the subclasses of a class. This is pretty easy in CPython but seems to not work correctly in PYJS
Consider the following classes
class A(object): pass
class B(A): pass
class C(A): pass
In CPython print str(A.__subclasses__())
Gives
[<class '__main__.B'>, <class '__main__.C'>]
But in PYJS __subclasses__ does not exist. However there is a __sub_classes__ but
print str(A.__sub_classes__)
Unfortunately this retuns
class pyjssubclassesbug.C
In pyjs we get the class of the last subclass defined. This seems to all be in error. The different between __subclasses__ and __sub_classes__ seems to just be a spelling mistake but the rest of the problems just seem like a bug. Is it? Or is this some lind of limitation of javascript or the pyjs compiler?
Otherwise, I am finding this project to be really useful. Many thanks to the authors.