]>
git.ipfire.org Git - thirdparty/Python/cpython.git/commit
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.