Fedihosting-Foundation / plemmy

A Python package for accessing the LemmyHttp API
Apache License 2.0
45 stars 15 forks source link

TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' #35

Closed scriptzteam closed 4 weeks ago

scriptzteam commented 4 months ago
python3
Python 3.8.10 (default, Nov 22 2023, 10:22:35)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from plemmy import LemmyHttp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.8/dist-packages/plemmy/__init__.py", line 3, in <module>
    from . import objects
  File "/usr/local/lib/python3.8/dist-packages/plemmy/objects.py", line 196, in <module>
    class Instance:
  File "/usr/local/lib/python3.8/dist-packages/plemmy/objects.py", line 205, in Instance
    federation_state: FederationState | None = None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
tjkessler commented 4 weeks ago

@scriptzteam,

The pipe operator is available in Python 3.10+, and is unsupported in Python 3.8: https://stackoverflow.com/questions/64615988/what-does-vertical-bar-pipe-in-function-arguments-type-annotations-mean