On 18Jul2017 02:57, Steve D'Aprano <steve+pyt...@pearwood.info> wrote:
collections.namedtuple generates a new class using exec, and records the source
code for the class as a _source attribute.
Although it has a leading underscore, it is actually a public attribute. The
leading underscore distinguishes it from a named field potentially
called "source", e.g. namedtuple("klass", ['source', 'destination']).
There is some discussion on Python-Dev about:
- changing the way the namedtuple class is generated which may
change the _source attribute
- or even dropping it altogether
in order to speed up namedtuple and reduce Python's startup time.
Is there anyone here who uses the namedtuple _source attribute?
Speaking for myself: no I do not.
Cheers,
Cameron Simpson <c...@zip.com.au>
--
https://mail.python.org/mailman/listinfo/python-list