Is it bad practise to write __all__ like that
Erik Max Francis
max at alcyone.com
Fri Jul 29 01:22:55 EDT 2011
More information about the Python-list mailing list
Fri Jul 29 01:22:55 EDT 2011
- Previous message (by thread): Is it bad practise to write __all__ like that
- Next message (by thread): Is it bad practise to write __all__ like that
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thomas Rachel wrote: > 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 Bravo! -- Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM/Y!M/Jabber erikmaxfrancis Smaller than the eye can see / Bigger than the mind can conceive -- India Arie
- Previous message (by thread): Is it bad practise to write __all__ like that
- Next message (by thread): Is it bad practise to write __all__ like that
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list