Closed liwt31 closed 5 years ago
Thanks for the fix, I neglected the missing __dict__
issue. There are a few problems in this commit, see comments below.
I'm sorry but I can't see any comments. GitHub has some issue yesterday, maybe your comment is rolled back?
Cause I didn't submit them yesterday.
I've tried to implement a version based on the idea of making __slots__
a property of attributes, Here's an example:
>>> class A:
... __slots__ = ['__mul__', '__hash__', 'a', 'b']
>>> pdir(A())
special attribute:
__class__, __doc__, __module__, __slots__
abstract class:
__subclasshook__
arithmetic:
__mul__(slotted)
object customization:
__format__, __hash__(slotted), __init__, __new__, __repr__, __sizeof__, __str__
rich comparison:
__eq__, __ge__, __gt__, __le__, __lt__, __ne__
attribute access:
__delattr__, __dir__, __getattribute__, __setattr__
class customization:
__init_subclass__
pickle:
__reduce__, __reduce_ex__
descriptor:
a(slotted): class member_descriptor with getter, setter, deleter
b(slotted): class member_descriptor with getter, setter, deleter
LGTM. Thanks for the great work and quick responses!
And thanks for your comments and advice! It's a pleasure having discussions with you.
fix the bug by another try/except and add a test for it.