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 rhettinger
Recipients ethan.furman, rhettinger, serhiy.storchaka
Date 2020-03-27.07:16:44
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The dir() listing omits the attributes "description" and "phrase":

>>> import http
>>> from pprint import pp
>>> r = http.HTTPStatus(404)
>>> pp(vars(r))
{'_value_': 404,
 'phrase': 'Not Found',
 'description': 'Nothing matches the given URI',
 '_name_': 'NOT_FOUND',
 '__objclass__': <enum 'HTTPStatus'>}
>>> r.value
>>> r.description
'Nothing matches the given URI'
>>> r.phrase
'Not Found'
>>> dir(r)
['__class__', '__doc__', '__module__', 'as_integer_ratio', 'bit_length', 'conjugate', 'denominator', 'from_bytes', 'imag', 'name', 'numerator', 'real', 'to_bytes', 'value']

One fix would be to teach IntEnum.__dir__() to include entries in the instance dict.  Another fix would be to provide a way for a IntEnum subclass to add to the known members list.
Date User Action Args
2020-03-27 07:16:45rhettingersetrecipients: + rhettinger, ethan.furman, serhiy.storchaka
2020-03-27 07:16:45rhettingersetmessageid: <>
2020-03-27 07:16:45rhettingerlinkissue40084 messages
2020-03-27 07:16:44rhettingercreate