Skip to content

Instantly share code, notes, and snippets.

View Ikusaba-san's full-sized avatar

Ikusaba-san

View GitHub Profile
@Ikusaba-san
Ikusaba-san / cog.py
Created October 17, 2017 00:32
A superclass for all my cogs
import inspect
import re
def _get_name_mangled_attrs(cls, attr):
for c in cls.__mro__:
try:
yield getattr(c, f'_{c.__name__}__{attr}')
except AttributeError:
continue