Issue 12917: Make visiblename and allmethods functions public (original) (raw)

Issue12917

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 : > 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:21 admin set github: 57126
2011-09-12 16:05:23 eric.araujo set messages: + stage: resolved
2011-09-12 16:02:06 rhettinger set status: open -> closedresolution: rejected
2011-09-12 16:00:29 eric.araujo set messages: +
2011-09-11 08:31:22 rhettinger set assignee: rhettingernosy: + rhettinger
2011-09-06 16:34:28 eric.araujo create