mirror of
https://github.com/python/cpython.git
synced 2026-05-05 01:51:01 +00:00
There were comments claiming these were implemented as custom classes to give a nicer repr(), but the repr() wasn't all that nice: >>> repr(dataclasses.MISSING) '<dataclasses._MISSING_TYPE object at 0x1005e7e00>' >>> repr(dataclasses.KW_ONLY) '<dataclasses._KW_ONLY_TYPE object at 0x100884050>' Sentinels are conceptually the right tool for these, so let's use them. This does change the repr() of these two objects. |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| dataclass_module_1.py | ||
| dataclass_module_1_str.py | ||
| dataclass_module_2.py | ||
| dataclass_module_2_str.py | ||
| dataclass_textanno.py | ||