Last active
August 21, 2018 10:35
-
-
Save bencharb/74f8ddd2c00cfb5ef6e2 to your computer and use it in GitHub Desktop.
get class attr names
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import operator | |
| def get_class_attr_names(c): | |
| if not getattr(mycal, 'mro', None): | |
| return [] | |
| return set(reduce(operator.or_, map(set, map(dir, c.mro()[1:])))) ^ set(dir(c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment