-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
We should consider dropping Python 3.6 support (i.e. bump this line).
Internally, we've been on 3.7 for a while and recently moved to 3.9. In open source, 3.6 is already end-of-lifed as of the end of 2021: https://peps.python.org/pep-0494/#lifespan
Dropping 3.6 will let us start using 3.7-only features, of which the most useful would be dataclasses: https://docs.python.org/3.7/library/dataclasses.html
There are a number of classes in the codebase that could be converted to dataclasses for a more compact definition and less boilerplate, including:
-
most uses of namedtuple: https://cs.opensource.google/search?q=namedtuple%5C(&sq=&ss=tensorflow%2Ftensorboard
-
DataProvider API helper classes, e.g. [ExperimentMetadata] and friends (https://cs.opensource.google/tensorflow/tensorboard/+/master:tensorboard/data/provider.py;l=362;drc=bd1f897f523cc7b02532ea9cadc90a938c8f952b)
One possible tradeoff is that dataclasses with default values for any properties don't support __slots__ until 3.10: https://stackoverflow.com/questions/50180735/how-can-dataclasses-be-made-to-work-better-with-slots/69661861#69661861 But many of our existing classes don't use defaults anyway, and for those that do, they might not really need to use __slots__.