You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mypyc now supports dataclasses via the non-extension class mechanism introduced in #657. However, the current way they are implemented does not focus on making them fast. Dataclasses are currently simply compiled as non extension classes. It would be nice if they could be compiled as extension classes. The initial issue that arises when trying to treat dataclasses as extension classes is that the dataclass module thinks that all of the class attributes defined in a class decorated with dataclass (and compiled to an extension class) need default values because we have descriptor objects for every class attribute in the class dict. One initial attempt to make things faster would be to pull out all the descriptors from the dictionary, call dataclass on the extension class, and then put them back in. There are other possibilities for optimization, but this would be a useful first pass.
The text was updated successfully, but these errors were encountered:
mypyc now supports dataclasses via the non-extension class mechanism introduced in #657. However, the current way they are implemented does not focus on making them fast. Dataclasses are currently simply compiled as non extension classes. It would be nice if they could be compiled as extension classes. The initial issue that arises when trying to treat dataclasses as extension classes is that the dataclass module thinks that all of the class attributes defined in a class decorated with dataclass (and compiled to an extension class) need default values because we have descriptor objects for every class attribute in the class dict. One initial attempt to make things faster would be to pull out all the descriptors from the dictionary, call dataclass on the extension class, and then put them back in. There are other possibilities for optimization, but this would be a useful first pass.
The text was updated successfully, but these errors were encountered: