Dataclasses, frozen and __post_init__
23 Feb
2018
23 Feb
'18
10:35 a.m.
On Mon, Feb 19, 2018 at 5:06 PM, Chris Barker - NOAA Federal < chris.barker at noaa.gov> wrote:
If I have this right, on the discussion about frozen and hash, a use case was brought up for taking a few steps to create an instance (and thus wanting it not frozen) and then wanting it hashable.
Which pointed to the idea of a β freeze this from now onβ method.
This seems another use case β maybe it would be helpful to be able to freeze an instance after creation for multiple use-cases?
Yes, it would be helpful. But in practice, I've just limited the hash function to only the attributes that are available before I need to stick the object in a dict. In practice, that has always been more than sufficient. -jJ
2247
Age (days ago)
2247
Last active (days ago)
0 comments
1 participants
participants (1)
-
Jim J. Jewett