Namedtuples: some unexpected inconveniences

Gregory Ewing greg.ewing at canterbury.ac.nz
Thu Apr 13 03:16:37 EDT 2017


Deborah Swanson wrote:
> But I think you got it right in your last sentence below. defaultdict
> copied them because they were immutable,

No, definitely not. A defaultdict will never take it upon
itself to copy an object you give it, either as a key or a
value.

The copying, if any, must have occurred somewhere else, in
code that you didn't show us.

Can you show us the actual code you used to attempt to
update the namedtuples?

-- 
Greg


More information about the Python-list mailing list