This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Make visiblename and allmethods functions public
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: eric.araujo, rhettinger
Priority: normal Keywords:

Created on 2011-09-06 16:34 by eric.araujo, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (3)
msg143628 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-06 16:34
pydoc contains these two functions that could be used by third-party code to implement a custom dir function, write a documentation tool or other uses: visiblename and allmethods.  We could make them public, in pydoc or inspect.
msg143913 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-12 16:00
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.
msg143914 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-12 16:05
A precision:

> I think generic functions would be a nice way to do this.
I meant: a nice way to experiment this *outside of the stdlib*.  We don’t have official generic function yet, so I’ll wait to see if pprint gets rewritten and/or if we get a generic functions PEP and standard module.

Sorry if these issues I opened are consuming your time; I wanted to make sure we considered the proposals separately and add a good rationale for rejecting them.  Thanks for weighing in.
History
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57126
2011-09-12 16:05:23eric.araujosetmessages: + msg143914
stage: resolved
2011-09-12 16:02:06rhettingersetstatus: open -> closed
resolution: rejected
2011-09-12 16:00:29eric.araujosetmessages: + msg143913
2011-09-11 08:31:22rhettingersetassignee: rhettinger

nosy: + rhettinger
2011-09-06 16:34:28eric.araujocreate