[Python-ideas] A user story concerning things knowing their own names

Raymond Hettinger raymond.hettinger at gmail.com
Wed Mar 16 23:04:52 CET 2011


On Mar 16, 2011, at 1:49 PM, Terry Reedy wrote:

> If make_namedtuple were added to collections, then one could import *that* instead of 'namedtuple' itself.

Post a recipe somewhere.
My bet is that it will have a near zero adoption rate.

-1 on all of these random ideas to solve what is basically a non-problem.
The name of a named tuple, or a class, or a function, or a variable
typically is used many times, not just in the definition.  

If you make up a new factory function that uses inspect
magic to guess  user's intend target name, you will have
introduced unnecessary complexity and will likely
introduce unexpected behaviors and bugs.


Raymond





More information about the Python-ideas mailing list