I’ve also posted this on the original thread because I can’t decide which one is current - sorry for double post.
I’m a -1 for this for three reasons:
- It makes Python more hieroglyphic like, something I dislike in other languages. I like the joke that you turn your pseudo code into a running program by changing the file type from txt to py!
- The main use cases are parsing external files like JSON. There already exists better solutions, e.g. GitHub - lovasoa/marshmallow_dataclass: Automatic generation of marshmallow schemas from dataclasses., GitHub - rnag/dataclass-wizard: Simple, elegant, wizarding tools for interacting with Python’s dataclasses., GitHub - lidatong/dataclasses-json: Easily serialize Data Classes to and from JSON, GitHub - konradhalas/dacite: Simple creation of data classes from dictionaries., Welcome to Pydantic - Pydantic, and https://pandas.pydata.org/. Probably a ton more I don’t know about also. One of these could be added to python if necessary to be in the language.
- It would be better to revise PEP 712 – Adding a “converter” parameter to dataclasses.field | peps.python.org. I think other rejected PEPs have already been suggested also.
Sorry -1.