Skip to content

Instantly share code, notes, and snippets.

@Lucretiel
Created April 28, 2015 14:20
Show Gist options
  • Save Lucretiel/12d20d9e89ba69d2366d to your computer and use it in GitHub Desktop.
Save Lucretiel/12d20d9e89ba69d2366d to your computer and use it in GitHub Desktop.
A simple helper for populating __all__
def exporter(all):
def export(thing):
all.append(thing.__name__)
return thing
return export
###################################
__all__ = []
export = exporter(__all__)
@export
def foo():
pass
@export
class Foo:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment