[issue12878] io.StringIO doesn't provide a __dict__ field

Antoine Pitrou report at bugs.python.org
Thu Sep 1 21:54:04 CEST 2011


Antoine Pitrou <pitrou at free.fr> added the comment:

I'm not sure why that is. Note that you can still set and get arbitrary attributes, so there must be a dict somewhere, but it isn't exposed. Also, there wasn't any significant change in StringIO in the 3.1 line.
Benjamin, do you have any idea?

>>> s = io.StringIO()
>>> s.x = 5
>>> s.x
5
>>> s.__dict__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: '_io.StringIO' object has no attribute '__dict__'

----------
nosy: +amaury.forgeotdarc, benjamin.peterson, pitrou
versions: +Python 3.2, Python 3.3 -Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12878>
_______________________________________


More information about the Python-bugs-list mailing list