Closed clstaudt closed 1 year ago
If I run python app/app.py
in python 3.9 on the current dev branch, I get the following error:
Traceback (most recent call last):
File "/home/tobias/Repositories/tuttle/app/app.py", line 14, in <module>
from auth.view import ProfileScreen, SplashScreen
File "/home/tobias/Repositories/tuttle/app/auth/view.py", line 19, in <module>
from core import utils, views
File "/home/tobias/Repositories/tuttle/app/core/views.py", line 84, in <module>
class THeading(Text):
File "/home/tobias/Repositories/tuttle/app/core/views.py", line 94, in THeading
expand: bool | int | None = None,
TypeError: unsupported operand type(s) for |: 'type' and 'type'
@tsterbak can you try now (get latest dev changes). I suspect it has something to do with the bool | int | None = None type hint.
@tsterbak @vlad-ed-git The reason for the error is that this syntax for union types is only available from Python 3.10.
https://www.blog.pythonlibrary.org/2021/09/11/python-3-10-simplifies-unions-in-type-annotations/
Since we still support Python 3.9 it's a bug and should be changed, even though I prefer the new syntax. It's probably a bit early to drop support for Python 3.9.
ps. I am working on adding a test to the CI/CD pipeline that checks whether the app starts across all supported Python versions.
Branch
dev
: Ready for testing with real data: