Why does Python not support record type? (i.e. mutable namedtuple)
问题 Why does Python not support a record type natively? It's a matter of having a mutable version of namedtuple. I could use namedtuple._replace . But I need to have these records in a collection and since namedtuple._replace creates another instance, I also need to modify the collection which becomes messy quickly. Background: I have a device whose attributes I need to get by polling it over TCP/IP. i.e. its representation is a mutable object. Edit: I have a set of devices for whom I need to