Created
July 31, 2014 03:12
-
-
Save wadoon/e3034f6fa9e7d215f313 to your computer and use it in GitHub Desktop.
Decorator for markin classes and functions for export (__all__)
This file contains 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
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