Steven D'Aprano wrote:
I'm not proposing any changes to namedtuple at all -- its others who want to change it to take just a single argument and have an wrapper function to specify the field names. I'm against that rather strongly.
I don't think this would be creating TMWTDI. Given the proposed feature, and a suitable helper, then
def Foo as NamedTuple('x', 'y', 'z')
would become the *obvious* way to define a named tuple type. The old way
foo = namedtuple(something, 'x', 'y', 'z')
would become something low-level that you only use in special circumstances -- like calling type() directly to create a class.