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/2014-June/134978.html below:

[Python-Dev] namedtuple implementation grumble

[Python-Dev] namedtuple implementation grumble [Python-Dev] namedtuple implementation grumbleAntoine Pitrou antoine at python.org
Mon Jun 9 13:40:41 CEST 2014
Le 09/06/2014 00:05, Raymond Hettinger a écrit :
>
> Another issue is that a straight abc wouldn't be sufficient.  What we
> would really want is to check for is:
> 1) the presence of a _fields tuple (an abc can do this)
> 2) to check that all of the attribute names specified in _fields are
> defined (ABCMeta doesn't do this)
> 3) and that the type is a Sequence (ABCMeta can do this).
>
> An tricked-out ABC extension might be worth it if it provided some
> non-trivial mixin capabilities for implementing homegrown named tuples
> (not created by the factory function), but I don't think we want to go
> there.

Instead of an ABC, why not a simple is_namedtuple() function?

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