[Python-Dev] Breaking undocumented API

Antoine Pitrou solipsis at pitrou.net
Thu Nov 11 16:32:31 CET 2010


On Thu, 11 Nov 2010 15:18:40 +0000
Michael Foord <fuzzyman at voidspace.org.uk> wrote:
> On 11/11/2010 15:17, Łukasz Langa wrote:
> > Am 11.11.2010 16:05, schrieb Barry Warsaw:
> >> Agreed, though I wouldn't *remove* __all__'s, I would establish a 
> >> convention
> >> where they can be generated programmatically.  Keeping __all__ in 
> >> sync with
> >> the code is a PITA.  It screams for automation.
> >
> > You mean runtime automation, e.g. creating __all__ on the fly omitting 
> > underscored names?
> >
> Writing code to generate a __all__ that duplicates the default behaviour 
> seems redundant to me.

Agreed with Michael.  __all__ is useful mostly when you don't adhere to
the convention that private APIs should have a leading underscore.

Regards

Antoine.




More information about the Python-Dev mailing list