A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2011-March/109248.html below:

[Python-Dev] pydoc for named tuples is missing methods

[Python-Dev] pydoc for named tuples is missing methods [Python-Dev] pydoc for named tuples is missing methodsAntoine Pitrou solipsis at pitrou.net
Mon Mar 14 12:46:52 CET 2011
On Mon, 14 Mar 2011 06:29:09 -0400
Eric Smith <eric at trueblade.com> wrote:
> On 03/14/2011 02:33 AM, Greg Ewing wrote:
> > Tim Lesher wrote:
> >
> >> Because named tuple prefixes a single underscore to its added method
> >> names (_asdict, _replace, and _make), those methods' docstrings are
> >> omitted from pydoc:
> >
> > IMO these should be called __asdict__, __replace__ and
> > __make__. Users are perfectly entitled to make up their
> > own single-underscore names, so using a single underscore
> > is not sufficient to prevent name collisions.
> 
> namedtuple won't let you use names starting with an underscore, so the 
> single underscore names are sufficient.

Not for members perhaps, but nothing prevents you from defining methods
with these names in a subclass AFAIK.

Regards

Antoine.


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4