
Thanks! El jue, 13 ene 2022 a las 10:22, Erik De Bonte (<Erik.DeBonte@microsoft.com>) escribió:
Thanks Jelle.
For the introspection issue, does this change properly describe what you suggested? Change runtime behavior to support introspection · debonte/peps@ccfa9c8 (github.com) <https://github.com/debonte/peps/commit/ccfa9c847675cd97268bc98e813f41e7c00f7...>. I’m not sure if my description of the attribute value (“a serialized dict…”) is pythonic.
I'm not sure why it needs to be a serialized dict; it can just be a dict.
Seems reasonable to call out the KW_ONLY sentinel value in the “Dataclass semantics” section, especially since it’s newish. Is there a PEP or GitHub issue that defines its behavior? I wasn’t able to find one.
https://bugs.python.org/issue43532
-Erik
*From:* Jelle Zijlstra <jelle.zijlstra@gmail.com> *Sent:* Wednesday, January 12, 2022 10:52 AM *To:* Erik De Bonte <Erik.DeBonte@microsoft.com> *Cc:* typing-sig@python.org *Subject:* Re: [Typing-sig] Dataclass Transform draft PEP
Thanks Erik! I have a few small pieces of feedback:
- The runtime implementation is currently an identity function. I'd prefer if it sets some flag on the decorated object, similar to what I'm proposing in https://github.com/python/cpython/pull/30530 <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F30530&data=04%7C01%7CErik.DeBonte%40microsoft.com%7Cb08d42dc30444ec5e25f08d9d5fc9d0a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776104727887761%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=oku1vXFDjZr%2FyPDEEGdjAF1D1%2BEEA0Y5mhh5i39lSXo%3D&reserved=0> for @final. I'd suggest setting `cls.__dataclass_transform__ = {"eq_default": True, ...}` on the decorated object.
- dataclasses now supports the KW_ONLY marker to make only some fields kw-only ( https://docs.python.org/3/library/dataclasses.html#dataclasses.KW_ONLY <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdocs.python.org%2F3%2Flibrary%2Fdataclasses.html%23dataclasses.KW_ONLY&data=04%7C01%7CErik.DeBonte%40microsoft.com%7Cb08d42dc30444ec5e25f08d9d5fc9d0a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776104727937756%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=7r%2B7SFFshM0oqZE6cmJaRZlfCEJwLdW%2BcI%2BJpMTDdnI%3D&reserved=0>). Should this be added to the spec?
El lun, 13 dic 2021 a las 13:38, Erik De Bonte via Typing-sig (< typing-sig@python.org>) escribió:
I’ve created a draft PEP for the “Dataclass Transforms” concept that Eric Traut presented at the December 1st Typing SIG meetup. Feedback is welcome!
https://github.com/debonte/peps/blob/dataclass_transforms/pep-9999.rst <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdebonte%2Fpeps%2Fblob%2Fdataclass_transforms%2Fpep-9999.rst&data=04%7C01%7CErik.DeBonte%40microsoft.com%7Cb08d42dc30444ec5e25f08d9d5fc9d0a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776104727937756%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=pVPLGMtrbgw8v0ZYfnxituMRvvu00%2FtMgHIi%2BWZvLOo%3D&reserved=0>
Thanks,
Erik
_______________________________________________ Typing-sig mailing list -- typing-sig@python.org To unsubscribe send an email to typing-sig-leave@python.org https://mail.python.org/mailman3/lists/typing-sig.python.org/ <https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.python.org%2Fmailman3%2Flists%2Ftyping-sig.python.org%2F&data=04%7C01%7CErik.DeBonte%40microsoft.com%7Cb08d42dc30444ec5e25f08d9d5fc9d0a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776104727937756%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=Ez3960Gl3AShBSS%2B1X6RkhmpawzT2PZt5hxK4JnxI2w%3D&reserved=0> Member address: jelle.zijlstra@gmail.com