
* it can just be a dict Oh thanks, I just misunderstood what you originally requested. Both of your suggestions are addressed in the latest version. -Erik From: Jelle Zijlstra <jelle.zijlstra@gmail.com> Sent: Thursday, January 13, 2022 10:25 AM To: Erik De Bonte <Erik.DeBonte@microsoft.com> Cc: typing-sig@python.org Subject: Re: [Typing-sig] Dataclass Transform draft PEP Thanks! El jue, 13 ene 2022 a las 10:22, Erik De Bonte (<Erik.DeBonte@microsoft.com<mailto: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://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fdebonte%2Fpeps%2Fcommit%2Fccfa9c847675cd97268bc98e813f41e7c00f781a&data=04%7C01%7CErik.DeBonte%40microsoft.com%7C97c66242ac2f4c46b05808d9d6c215eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776951662412658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=CxZBM0SInwqWZAw1alug2k8HaVXEnb5F5vk21sFa%2Fzw%3D&reserved=0>. 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<https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fbugs.python.org%2Fissue43532&data=04%7C01%7CErik.DeBonte%40microsoft.com%7C97c66242ac2f4c46b05808d9d6c215eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776951662412658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=myuD9jeNUS2MWJoij76TXVCvioSL8USIqfbVI2Krt00%3D&reserved=0> -Erik From: Jelle Zijlstra <jelle.zijlstra@gmail.com<mailto:jelle.zijlstra@gmail.com>> Sent: Wednesday, January 12, 2022 10:52 AM To: Erik De Bonte <Erik.DeBonte@microsoft.com<mailto:Erik.DeBonte@microsoft.com>> Cc: typing-sig@python.org<mailto: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%7C97c66242ac2f4c46b05808d9d6c215eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776951662412658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=YPTcMwJwfyC4Bn4zclQkjR0ul6P%2FSKM2ucZAp4D7CM4%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%7C97c66242ac2f4c46b05808d9d6c215eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776951662412658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=KtnxQoyRcQI8yrPEAQfjLC6rO9%2FMi1MNwnSewfi46co%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<mailto: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%7C97c66242ac2f4c46b05808d9d6c215eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776951662412658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=T46WppIdEnbEd0y1%2FDGS%2FiA2s2rQy7b31hMYet2RxiI%3D&reserved=0> Thanks, Erik _______________________________________________ Typing-sig mailing list -- typing-sig@python.org<mailto:typing-sig@python.org> To unsubscribe send an email to typing-sig-leave@python.org<mailto: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%7C97c66242ac2f4c46b05808d9d6c215eb%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637776951662412658%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=sw55JbZl624E%2FFFeV2h%2B07wZkrPrVoH1NeqfQoz4uck%3D&reserved=0> Member address: jelle.zijlstra@gmail.com<mailto:jelle.zijlstra@gmail.com>