gh-149083: Convert some private and simple sentinels to PEP 661#149084
gh-149083: Convert some private and simple sentinels to PEP 661#149084JelleZijlstra wants to merge 1 commit intopython:mainfrom
Conversation
picnixz
left a comment
There was a problem hiding this comment.
There is a sentinel in hashlib.py to detect usage of arguments and raise appropriate warnings/errors so could you also update it? it's a hacky code because I needed to mirror the C behavior in some sense.
picnixz
left a comment
There was a problem hiding this comment.
In dataclasses, there is also _FIELD, _FIELD_CLASSVAR and _FIELD_INITVAR that you could update I think?
|
I was going to leave those dataclasses objects alone since they're instances of a common class, and I wouldn't be able to preserve that behavior. |
|
|
|
|
||
|
|
||
| UNNAMED_SECTION = _UnnamedSection() | ||
| UNNAMED_SECTION = sentinel("<UNNAMED_SECTION>") |
There was a problem hiding this comment.
This makes it no longer picklable, I'll revert this.
There was a problem hiding this comment.
Maybe we coule have a mechanism for making it pickable by default? or a keyword argument that adds "module."?
Uh oh!
There was an error while loading. Please reload this page.