You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2.1.0.dev0
local class name <class '__main__.Parent'>
deserialized class name <class '__main__.Parent'>
local mro ['__main__.Parent', 'builtins.object']
deserialized mro ['__main__.Parent', 'builtins.object']
local class name <class '__main__.Child'>
deserialized class name <class 'types.Child'>
local mro ['__main__.Child', '__main__.Parent', 'builtins.object']
deserialized mro ['types.Child', '__main__.Parent', 'builtins.object']
The text was updated successfully, but these errors were encountered:
This happens because we don't save attributes which have the same value in the parent class (see the code here). In particular, this means we don't save __module__ when the child class is in the same module. When we reconstruct the class with types.new_class(), __module__ gets set to types.
This issue is similar to #440 but I have verified it still happens after the fix (on latest master).
Somehow the deserialized subclass has
__module__
oftypes
instead of__main__
. This also happen when the classes are moved to their separate files.See the following repro script:
My output on Python 3.7 f758eb3
The text was updated successfully, but these errors were encountered: