update
This commit is contained in:
11
.CondaPkg/env/Lib/dataclasses.py
vendored
11
.CondaPkg/env/Lib/dataclasses.py
vendored
@@ -1168,8 +1168,17 @@ def _dataclass_setstate(self, state):
|
||||
|
||||
def _get_slots(cls):
|
||||
match cls.__dict__.get('__slots__'):
|
||||
# `__dictoffset__` and `__weakrefoffset__` can tell us whether
|
||||
# the base type has dict/weakref slots, in a way that works correctly
|
||||
# for both Python classes and C extension types. Extension types
|
||||
# don't use `__slots__` for slot creation
|
||||
case None:
|
||||
return
|
||||
slots = []
|
||||
if getattr(cls, '__weakrefoffset__', -1) != 0:
|
||||
slots.append('__weakref__')
|
||||
if getattr(cls, '__dictoffset__', -1) != 0:
|
||||
slots.append('__dict__')
|
||||
yield from slots
|
||||
case str(slot):
|
||||
yield slot
|
||||
# Slots may be any iterable, but we cannot handle an iterator
|
||||
|
||||
Reference in New Issue
Block a user