Browse Source

Prevent flatten_user from copying cached slot properties

pull/10109/head
dolfies 1 year ago
parent
commit
58537c571a
  1. 2
      discord/member.py

2
discord/member.py

@ -189,7 +189,7 @@ def flatten_user(cls: T) -> T:
# If it's a slotted attribute or a property, redirect it # If it's a slotted attribute or a property, redirect it
# Slotted members are implemented as member_descriptors in Type.__dict__ # Slotted members are implemented as member_descriptors in Type.__dict__
if not hasattr(value, '__annotations__'): if not hasattr(value, '__annotations__') or isinstance(value, utils.CachedSlotProperty):
getter = attrgetter('_user.' + attr) getter = attrgetter('_user.' + attr)
setattr(cls, attr, property(getter, doc=f'Equivalent to :attr:`User.{attr}`')) setattr(cls, attr, property(getter, doc=f'Equivalent to :attr:`User.{attr}`'))
else: else:

Loading…
Cancel
Save