Re: [Python-ideas] Add recordlcass to collections module

It would need to be a list of the members are mutable. As to the other questions, yes, do we need another module in the standard library?Angus

On Sat, Sep 1, 2018 at 1:08 PM Angus Hollands <goosey15@gmail.com> wrote:
As to the other questions, yes, do we need another module in the standard library?
Wouldn't need a new module. This would be a perfect fit for the existing collections module where namedtuple already resides. I Googled "pypi namedlist", and the top three results were all other implementations of named lists or something similar: - namedlist <https://pypi.org/project/namedlist/>, which I have personally used and found extremely useful - list-property <https://pypi.org/project/list-property/> - mutabletuple <https://pypi.org/project/mutabletuple/> Clearly the concept is useful enough to have several competing implementations on PyPI, and to me that is a point in favor of picking an implementation and adding it to the stdlib as the one obvious way to do it. So +1 from me.

On Sat, Sep 1, 2018 at 1:38 PM Robert Vanden Eynde <robertve92@gmail.com> wrote:
What's the difference between you proposition and dataclasses ? Introduced in Python 3.7 ?
A named list would allow sequence operations such as iteration. Dataclasses, IIUC, do not support sequence operations.

On Sat, Sep 1, 2018 at 1:08 PM Angus Hollands <goosey15@gmail.com> wrote:
As to the other questions, yes, do we need another module in the standard library?
Wouldn't need a new module. This would be a perfect fit for the existing collections module where namedtuple already resides. I Googled "pypi namedlist", and the top three results were all other implementations of named lists or something similar: - namedlist <https://pypi.org/project/namedlist/>, which I have personally used and found extremely useful - list-property <https://pypi.org/project/list-property/> - mutabletuple <https://pypi.org/project/mutabletuple/> Clearly the concept is useful enough to have several competing implementations on PyPI, and to me that is a point in favor of picking an implementation and adding it to the stdlib as the one obvious way to do it. So +1 from me.

On Sat, Sep 1, 2018 at 1:38 PM Robert Vanden Eynde <robertve92@gmail.com> wrote:
What's the difference between you proposition and dataclasses ? Introduced in Python 3.7 ?
A named list would allow sequence operations such as iteration. Dataclasses, IIUC, do not support sequence operations.
participants (3)
-
Angus Hollands
-
Jonathan Goble
-
Robert Vanden Eynde