I know about the existence and purpose of collections.namedtuple , but I noticed that, at least in IDLE (3.2.2), this factory function is also in functools :
>>> import functools >>> functools.namedtuple <function namedtuple at 0x024B41E0>
It also exists in collections , as expected, and is the same function:
>>> import collections >>> collections.namedtuple is functools.namedtuple True
There are no documents I can find that ever mentioned namedtuple anywhere except collections. So: is this a standard, or just a weirdness? If it's just IDLE, is it a mistake, or why should namedtuple be in two places - and indeed, in whose perverted mind does this make sense in functools all places?
source share