We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50b797d commit 5868d6eCopy full SHA for 5868d6e
1 file changed
src/typing_extensions.py
@@ -4229,10 +4229,16 @@ def __or__(self, other):
4229
def __ror__(self, other):
4230
return typing.Union[other, self]
4231
4232
+ @classmethod
4233
+ def _unpickle_fetch_sentinel(cls, name: str, module_name: str):
4234
+ """Unpickle using the sentinels location."""
4235
+ return cls(name, module_name)
4236
+
4237
def __reduce__(self):
4238
"""Record where this sentinel is defined."""
4239
+ # Avoid self.__class__ to ensure pickle data does not get locked to a subclass
4240
return (
- Sentinel, # Ensure pickle data does not get locked to a subclass
4241
+ Sentinel._unpickle_fetch_sentinel,
4242
( # Only the location of the sentinel needs to be stored
4243
self._name,
4244
self._module_name,
0 commit comments