Closed patrick91 closed 2 years ago
Would vendoring dataclasses break any editor integration?
Would vendoring dataclasses break any editor integration?
don’t think so :) for mypy we vendorize the dataclasses plugin already (with our changes) for pyright we are implementing the proposed dataclass transform decorator (which only tells pyright we follow dataclass’ semantics)
for pycharm i’m not sure 🤔
Going to close this for now, we can always make a new issue if we still think we need to do this :)
I think we discussed a few times to remove dataclasses and implement our own solution, this is mostly because:
So it might be the case to start thinking about our solution. @jkimbo and I were thinking of vendorizing dataclasses from Python 3.10 (which also supports kwargs only constructors) and then update the implementation from there.
For solving 1 we could use the kwargs only constructor, though this might be a big breaking change. We could also do something smarter that reorders the fields based on if they have default values or not
Worth nothing that we should still be able to support
dataclasses.asdict
on our types, as people rely on that (we could make our own function and deprecate it, but I wouldn't remove it for the time being).Upvote & Fund