This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients barry, eli.bendersky, ethan.furman, serhiy.storchaka
Date 2015-03-11.13:34:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1426080876.51.0.657090719237.issue23640@psf.upfronthosting.co.za>
In-reply-to
Content
Example:

>>> import socket
>>> x = socket.AddressFamily.from_bytes(b'\1', 'big')
>>> type(x)
<enum 'AddressFamily'>
>>> int(x)
1
>>> str(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/enum.py", line 464, in __str__
    return "%s.%s" % (self.__class__.__name__, self._name_)
AttributeError: 'AddressFamily' object has no attribute '_name_'
>>> repr(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/enum.py", line 461, in __repr__
    self.__class__.__name__, self._name_, self._value_)
AttributeError: 'AddressFamily' object has no attribute '_name_'
History
Date User Action Args
2015-03-11 13:34:36serhiy.storchakasetrecipients: + serhiy.storchaka, barry, eli.bendersky, ethan.furman
2015-03-11 13:34:36serhiy.storchakasetmessageid: <1426080876.51.0.657090719237.issue23640@psf.upfronthosting.co.za>
2015-03-11 13:34:36serhiy.storchakalinkissue23640 messages
2015-03-11 13:34:36serhiy.storchakacreate