A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2018-February/152197.html below:

[Python-Dev] Dataclasses, frozen and __post_init__

[Python-Dev] Dataclasses, frozen and __post_init__Raymond Hettinger raymond.hettinger at gmail.com
Tue Feb 20 18:24:02 EST 2018
> On Feb 20, 2018, at 2:38 PM, Guido van Rossum <guido at python.org> wrote:
> 
> But then the class would also inherit a bunch of misfeatures from tuple (like being indexable and having a length). It would be nicer if it used __slots__ instead.


FWIW, George Sakkis made a tool like this about nine years ago.  https://code.activestate.com/recipes/576555-records  It would need to be modernized to include default arguments, types annotations and whatnot, but otherwise it has great performance and low API complexity.

> (Also, the problem with __slots__ is the same as the problem with inheriting from tuple, and it should just be solved right, somehow.)

Perhaps a new variant of __init_subclass__ would work.



Raymond


More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4