Guido van Rossum added the comment:

Well this is what I get:

$ python3
Python 3.4.0a1+ (default:41de6f0e62fd+, Aug 27 2013, 18:44:07)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import namedtuple
from collections import namedtuple
>>> A = namedtuple('A', 'foo bar')
A = namedtuple('A', 'foo bar')
>>> class B(A):
class B(A):
...   __slots__ = ['baz']
  __slots__ = ['baz']
... 

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: nonempty __slots__ not supported for subtype of 'A'
>>> 

When I try to set __slots__ on an existing namedtuple it doesn't complain, but 
it doesn't work either:

>>> A.__slots__ = ['xxx']
>>> a.xxx = 1
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'A' object has no attribute 'xxx'
>>> 

What am I doing wrong?

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19146>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to