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
{{ message }}
Repository navigation
Issue with subclasses, slots and mangled attributes #506
Activity
seperman commentedon Dec 15, 2024
Hi @chriswyatt
Thanks for reporting the issue and the steps to reproduce. It does seem like an edge case. Looking into it!
seperman commentedon Dec 15, 2024
I don't have MongoDB. When I pass the following code, it works correctly. Am I missing something here?
chriswyatt commentedon Dec 16, 2024
Hi @seperman . Thanks for taking a look. The slots need to contain a mangled attribute, i.e. an attribute with 2 leading underscores.
You can also see it in the ObjectId source code:
https://github.com/mongodb/mongo-python-driver/blob/master/bson/objectid.py
Fix mangled __slots__ attribute lost for subclass instances
Merge pull request #609 from uttam12331/fix/slots-mangled-subclass-506