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

On Sunday, September 2, 2018, Zaur Shibzukhov <szport@gmail.com> wrote:
https://docs.python.org/3/glossary.html#term-hashable https://docs.python.org/3/reference/datamodel.html#object.__hash__ http://www.attrs.org/en/stable/hashing.html

--- *Zaur Shibzukhov* 2018-09-03 1:02 GMT+03:00 Wes Turner <wes.turner@gmail.com>:
There is correction: recordclass and it's base memoryslots didn't implement __hash__, but memoryslots implement richcompare (almost as python's list).

Chiming in here: dataclasses was just added to the stdlib. I understand that record class is not the same thing, but the use cases do overlap a great deal. So I think the cord goal for anyone that wants to see this in the stdlib is to demonstrate tbat recordclass Adds significant enough value to justify something so similar. Personally, I don’t see it. -CHB On Tue, Sep 4, 2018 at 2:04 PM Zaur Shibzukhov <szport@gmail.com> wrote:
-- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

On 9/4/2018 3:03 PM, Chris Barker via Python-ideas wrote:
I've seen three things mentioned that might be different from dataclasses: - instance size - speed (not sure of what: instance creation? field access?) - iterating over fields But I've not seen concrete examples of the first two where dataclasses doesn't perform well enough. For the third one, there's already a thread on this mailing list: "Consider adding an iterable option to dataclass". I'm contemplating adding it.
Personally, I don’t see it.
I'm skeptical, too. Eric

--- *Zaur Shibzukhov* 2018-09-03 1:02 GMT+03:00 Wes Turner <wes.turner@gmail.com>:
There is correction: recordclass and it's base memoryslots didn't implement __hash__, but memoryslots implement richcompare (almost as python's list).

Chiming in here: dataclasses was just added to the stdlib. I understand that record class is not the same thing, but the use cases do overlap a great deal. So I think the cord goal for anyone that wants to see this in the stdlib is to demonstrate tbat recordclass Adds significant enough value to justify something so similar. Personally, I don’t see it. -CHB On Tue, Sep 4, 2018 at 2:04 PM Zaur Shibzukhov <szport@gmail.com> wrote:
-- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov

On 9/4/2018 3:03 PM, Chris Barker via Python-ideas wrote:
I've seen three things mentioned that might be different from dataclasses: - instance size - speed (not sure of what: instance creation? field access?) - iterating over fields But I've not seen concrete examples of the first two where dataclasses doesn't perform well enough. For the third one, there's already a thread on this mailing list: "Consider adding an iterable option to dataclass". I'm contemplating adding it.
Personally, I don’t see it.
I'm skeptical, too. Eric
participants (4)
-
Chris Barker
-
Eric V. Smith
-
Wes Turner
-
Zaur Shibzukhov