[issue12917] Make visiblename and allmethods functions public

Éric Araujo report at bugs.python.org
Mon Sep 12 18:00:30 CEST 2011


Éric Araujo <merwok at netwok.org> added the comment:

Copied from msg143857:

> There are a lot of little internal routines in the standard library
> that aren't sufficiently fit to be exposed (perhaps a little too
> ad-hoc or special purpose, perhaps the API isn't sufficiently
> general, perhaps the routines rely on non-guaranteed aspects of the
> implementation).  For example, visiblename() is more heuristic than
> algorithmic -- right now, we can change that as needed (for instance,
> the recent updates to accommodate named tuples), but as soon as the
> method or function becomes public, its API freezes and it is hard for
> us to make changes.

I agree with your general point.  For this particular case, I’d be okay if you wanted to reject the request.  Users can filter the output of dir depending on their needs (_private names, __magic__ names, etc.).  For more useful code (that can cope with named tuples for example), I think generic functions would be a nice way to do this.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12917>
_______________________________________


More information about the Python-bugs-list mailing list