I'm writing a module that needs to run under both Python 3.8 and Python 3.10. I want to have dataclasses that have slots (@dataclasses.dataclass(slots=True)) in Python 3.10 for the purposes of type checking (both static and runtime). Is there a from __future__ import that will make this compatible with Python 3.8? If not, what is the most pytype-friendly way of emulating one?
Additional note: I'm currently using the dataclasses_json module, which to the best of my knowledge is not compatible with attrs. Otherwise I could switch from dataclasses to attrs and easily solve the problem.