On Thu, Mar 24, 2022 at 4:44 PM Eric V. Smith <eric@trueblade.com> wrote:
I don't think this is justifiable as built-in behavior. Just rename your
function "t", then you can write t(x=12, y=16).

If nothing else, a good way to prototype it and see if folks like it. I agree that there may be little reason to make this part of the builtin tuple.
 
That fact that it's not
typing friendly is definitely as strike against it, in my opinion.

not in my opinion -- Python is not a statically typed language, I will be really sad if the future of Python development was motivated by ease of static typing.

Now that I think about, namedtupled are not typing friendly either -- part of their point is that you can use one everywhere a tuple is expected. As soon as you type something as expecting a particular namedtuple, you've just broken that.

As for the memory growth -- would it need to be a new type? yes, namedtuples are types, but could we have a "tuple_with_attribute_names" that wasn't a distinct type, but rather, dynamically accessed its fields? I suppose that would be a lot heavier weight than a tuple, so maybe the same issue.

-CHB

--
Christopher Barker, PhD (Chris)

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython