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
Recent versions of Python have been building out support for data type annotation, where you can indicate the expected types of function inputs and outputs, or of standalone variables.
The annotations don't affect anything at runtime, but they allow static checks for consistency during development and testing, and some other cool things. Types can be simple (int, bool), compound (e.g. lists or dicts of other things), or classes.
It would be great to include type annotation throughout UrbanSim Templates! Not only does it seem like a good coding practice for library building, but it also aligns well with what the templates themselves are trying to accomplish.
The annotation syntax is compatible with Python 3.0+, but most of the useful features were introduced in Python 3.6. In Python 2.7 the annotations will raise a SyntaxError, so we'd have to drop Python 2.7 support if we add this. I think it would probably be worth it.
Recent versions of Python have been building out support for data type annotation, where you can indicate the expected types of function inputs and outputs, or of standalone variables.
The annotations don't affect anything at runtime, but they allow static checks for consistency during development and testing, and some other cool things. Types can be simple (int, bool), compound (e.g. lists or dicts of other things), or classes.
It would be great to include type annotation throughout UrbanSim Templates! Not only does it seem like a good coding practice for library building, but it also aligns well with what the templates themselves are trying to accomplish.
The annotation syntax is compatible with Python 3.0+, but most of the useful features were introduced in Python 3.6. In Python 2.7 the annotations will raise a SyntaxError, so we'd have to drop Python 2.7 support if we add this. I think it would probably be worth it.
Resources:
Additional functionality coming in Python 3.8: https://www.python.org/dev/peps/pep-0557/
The text was updated successfully, but these errors were encountered: