Skip to content

Commit 60936d6

Browse files
doc: MessageEnum's example cannot be tested since inspect does not work in interpreter
1 parent 855da1e commit 60936d6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mpqp/tools/generics.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -247,21 +247,23 @@ class MessageEnum(Enum):
247247
enum through the ``message`` property.
248248
249249
Example:
250-
>>> class A(MessageEnum):
250+
>>> class A(MessageEnum): # doctest: +SKIP
251251
... '''an enum'''
252252
... VALUE1 = auto()
253253
... '''member VALUE1'''
254254
... VALUE2 = auto()
255255
... '''member VALUE2'''
256-
>>> A.VALUE1.message
256+
>>> A.VALUE1.message # doctest: +SKIP
257257
'member VALUE2'
258258
259259
Warning:
260260
This implementation is not very robust, in particular, in case some
261-
members are not documented, it will mess things up.
261+
members are not documented, it will mess things up. In addition, this
262+
can only work for code in file, and will not work in the interpreter.
262263
"""
263264

264265
message: str
266+
"""Each of the members of the eum will have the ``message`` attribute."""
265267

266268
def __init__(self, *args: Any, **kwds: dict[str, Any]) -> None:
267269
super().__init__(*args, **kwds)

0 commit comments

Comments
 (0)