Existence of mutable named tuple in Python?

前端 未结 10 2157
旧巷少年郎
旧巷少年郎 2020-11-29 16:23

Can anyone amend namedtuple or provide an alternative class so that it works for mutable objects?

Primarily for readability, I would like something similar to namedt

10条回答
  •  攒了一身酷
    2020-11-29 16:46

    If you want similar behavior as namedtuples but mutable try namedlist

    Note that in order to be mutable it cannot be a tuple.

提交回复
热议问题