Interesting coincidence, just two days ago I have heard that a team at one
large company completely abandoned namedtuple because of the creation time
problem.

Concerning _source, why it is not possible to make it a property so that
all the string formatting will happen on request, thus saving some time for
users who doesn't need it?
(Of course this will not be an actual source, but it can be made
practically equivalent to the no-compile version.)

--
Ivan


On 17 July 2017 at 14:53, Antoine Pitrou <[email protected]> wrote:

> On Mon, 17 Jul 2017 14:43:19 +0200
> Antoine Pitrou <[email protected]> wrote:
> > Hello,
> >
> > Cost of creating a namedtuple has been identified as a contributor to
> > Python startup time.
>
> Imprecise wording: that's the cost of creating a namedtuple *class*,
> i.e. anytime someone writes `MyClass = namedtuple('MyClass', ...)`.
>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-Dev mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> levkivskyi%40gmail.com
>
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to