[Python-Dev] Make it an error to use __slots__ with classic classes
Raymond Hettinger
raymond.hettinger at verizon.net
Sat Aug 9 02:54:55 EDT 2003
More information about the Python-Dev mailing list
Sat Aug 9 02:54:55 EDT 2003
- Previous message: [Python-Dev] Re: hook for standalone executable
- Next message: [Python-Dev] Make it an error to use __slots__ with classic classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Using __slots__ with a classic class is an error that does not readily reveal itself. For Py2.3.1, I would like to issue a warning, and for Py2.4, I would like to raise an exception upon class creation: >>> class A: ... __slots__ = 'abc' # Would otherwise pass silently ... pass ... Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: PyClass_New: __slots__ only works with new-style classes Do you guys agree? Raymond Hettinger
- Previous message: [Python-Dev] Re: hook for standalone executable
- Next message: [Python-Dev] Make it an error to use __slots__ with classic classes
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list