mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-05 11:27:13 +00:00
Add private get_slots utility to get slots through MRO
This commit is contained in:
parent
263f45d05b
commit
aeb2cfb573
@ -502,6 +502,14 @@ async def sane_wait_for(futures, *, timeout):
|
|||||||
return done
|
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):
|
def compute_timedelta(dt: datetime.datetime):
|
||||||
if dt.tzinfo is None:
|
if dt.tzinfo is None:
|
||||||
dt = dt.astimezone()
|
dt = dt.astimezone()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user