Skip to content

Instantly share code, notes, and snippets.

@wadoon
Created July 31, 2014 03:12
Show Gist options
  • Save wadoon/e3034f6fa9e7d215f313 to your computer and use it in GitHub Desktop.
Save wadoon/e3034f6fa9e7d215f313 to your computer and use it in GitHub Desktop.
Decorator for markin classes and functions for export (__all__)
class export(list):
def __call__(self, obj):
name = getattr(obj, '__name__', None) or \
getattr(obj, '__name', None) or \
getattr(obj, 'name', None)
self.append(name)
return obj
__all__ = export()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment