Re:Modern Python Performance Considerations
by anamax on Thursday May 05, 2022 @03:02PM
(#31277219)
default __slots__ breaks a lot of monkey patching.
An "easier" change would be to add a class attribute "no__dict__", which says that the __dict__ attribute can't be used, which lets the implementation do whatever it wants. That can be incrementally added to classes.
Another option is a "no__getattr__" attribute, which disables gettattr and friends.
An "easier" change would be to add a class attribute "no__dict__", which says that the __dict__ attribute can't be used, which lets the implementation do whatever it wants. That can be incrementally added to classes.
Another option is a "no__getattr__" attribute, which disables gettattr and friends.