Browse Source

Add private get_slots utility to get slots through MRO

pull/6978/head
Rapptz 4 years ago
parent
commit
aeb2cfb573
  1. 8
      discord/utils.py

8
discord/utils.py

@ -502,6 +502,14 @@ async def sane_wait_for(futures, *, timeout):
return done
def get_slots(cls: Type[Any]) -> Iterator[str]:
for mro in reversed(cls.__mro__):
try:
yield from mro.__slots__
except AttributeError:
continue
def compute_timedelta(dt: datetime.datetime):
if dt.tzinfo is None:
dt = dt.astimezone()

Loading…
Cancel
Save