Skip to content

Instantly share code, notes, and snippets.

@bencharb
Last active August 21, 2018 10:35
Show Gist options
  • Select an option

  • Save bencharb/74f8ddd2c00cfb5ef6e2 to your computer and use it in GitHub Desktop.

Select an option

Save bencharb/74f8ddd2c00cfb5ef6e2 to your computer and use it in GitHub Desktop.
get class attr names
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