cpython/Lib/test/test_dataclasses
Jelle Zijlstra 16952218d0
gh-149083: Convert dataclasses.MISSING and dataclasses.KW_ONLY to sentinels (#149086)
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.
2026-04-29 19:39:29 -07:00
..
__init__.py gh-149083: Convert dataclasses.MISSING and dataclasses.KW_ONLY to sentinels (#149086) 2026-04-29 19:39:29 -07:00
dataclass_module_1.py
dataclass_module_1_str.py
dataclass_module_2.py
dataclass_module_2_str.py
dataclass_textanno.py