Open JPLeBreton opened 11 months ago
Ah, looks like it's specifically the union operator added to type annotation in Python 3.10: https://www.blog.pythonlibrary.org/2021/09/11/python-3-10-simplifies-unions-in-type-annotations
The machine I'm trying to run this on (an old first gen Raspberry Pi) is unlikely to get an upgrade from Python 3.9 to 3.10, but I also don't want to ask you to make your code worse.
It does look like that's the only usage of the | operator in the code; turning the one line with it into its un-annotated type equivalent allowed from cohost.models.user import User
to succeed on this machine. So I have a workaround for now. Do with this issue as you like.
Given the first gen Pi is a fairly understandable piece of hardware for this project, I'd consider this a bug, but, you are right in this probably making the code a little worse...
Asking as you have a pretty good use case - would you consider it OK to have a seperate branch with Python 3.9 compatibility, and then installing that branch via Git? If so, I might do that as a compromise :)
A python 3.9 branch for those that need it seems like a fine solution to me, thank you!
Running
from cohost.models.user import User
, I get this error:I don't recognize this error. Python 3.9 is supported by this module, right?