Message44085
The following results in a segfault on Linux with 2.3b1:
-------------------------
class StringDerived(str):
__slots__ = ['a']
def __init__(self, string):
str.__init__(self, string)
self.a = 1
class DerivedAgain(StringDerived):
pass
o = DerivedAgain('hello world')
o.b = 2
--------------------------
Python 2.2.2 raises a TypeError when attempting to
derive a class from str with a non-empty __slots__,
maybe 2.3 should do the same?
I have no use case for deriving from str and defining
__slots__; I encountered the bug when writing test
cases for a debugger. |
|
Date |
User |
Action |
Args |
2007-08-23 15:27:54 | admin | link | issue757997 messages |
2007-08-23 15:27:54 | admin | create | |
|