[issue40066] Enum: modify __repr__, __str__; update docs

Ethan Furman report at bugs.python.org
Mon Jan 17 10:34:10 EST 2022


Ethan Furman <ethan at stoneleaf.us> added the comment:

vstinner wrote:
--------------
>>    self.assertEqual(repr(type), '<SocketKind.SOCK_STREAM: 1>')

> For this one, I suggest to replace the value with "..." doctest pattern.

That bit of code is from the unittest suite, not the doctest suite.

I went with:  

    self.assertEqual(repr(type), '<SocketKind.SOCK_STREAM: %r>' % type.value)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue40066>
_______________________________________


More information about the Python-bugs-list mailing list