Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-17 Thread Ben Lewis
> > Why can'y you make `name` on `NamedObjectItem` a property that returns ` > self.obj.name`? Why store a duplicate copy of the name? > Agreed, it's probably a better design not to store a duplicate reference to name. But when I tried that, the property clashed with the inherited field. This caus

Re: [Python-Dev] Dataclasses, frozen and __post_init__

2018-02-17 Thread Ben Lewis
return cls(obj.name, obj, *args, **kwargs) This doesn't look that bad but all fields(up to the last field used that would have been used in __post_init__) needs to be declared in the signature. Thanks Ben Lewis ___ Python-Dev mailing list Pytho

[Python-Dev] Dataclasses, frozen and __post_init__

2018-02-16 Thread Ben Lewis
hods. This flag could be located as a special attribute on the instance or be in a weak reference dict. Thanks Ben Lewis ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.pyt