Am 28.07.2011 13:32 schrieb Karim:
Hello,
__all__ = 'api db input output tcl'.split()
or
__all__ = """
api
db
input
output
tcl
""".split()
for lazy boy ;o). It is readable as well.
What do you think?
Why not? But you could even do
class AllList(list):
"""list which can be called in order to be used as a __all__-adding
decorator"""
def __call__(self, obj):
"""for decorators"""
self.append(obj.__name__)
return obj
__all__ = AllList()
@__all__
def api(): pass
@__all__
def db(): pass
@__all__
def input(): pass
@__all__
def output(): pass
@__all__
def tcl(): pass
HTH,
Thomas
--
http://mail.python.org/mailman/listinfo/python-list