Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.12.2 python problem with Functor subclass check #35

Open
banderlog opened this issue Apr 20, 2024 · 4 comments
Open

3.12.2 python problem with Functor subclass check #35

banderlog opened this issue Apr 20, 2024 · 4 comments

Comments

@banderlog
Copy link

banderlog commented Apr 20, 2024

Hi, the next error appears on python3.12.2:

 File "/venv/lib/python3.12/site-packages/oslash/_init_.py", line 11, in <module>
    from .state import State
  File "/venv/lib/python3.12/site-packages/oslash/state.py", line 78, in <module>
    assert issubclass(State, Functor)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/typing.py", line 1841, in _subclasscheck_
    cls._non_callable_proto_members_
AttributeError: type object 'Functor' has no attribute '_non_callable_proto_members_'

with 3.11 everything is fine

oslash-0.6.3 (latest)

@banderlog banderlog changed the title 3.12 python problem with Functor subclass check 3.12.2 python problem with Functor subclass check Apr 20, 2024
@banderlog
Copy link
Author

UPD: it is the problem of combination of python and typing-extensions

python-3.12 with typing-extensions>4.9.0 fails
python-3.10 and python-3.11 works fine with typing-extensions>=4.9.0

@banderlog
Copy link
Author

python/typing_extensions#372 (comment)

Thanks. This happens because you're mixing typing.Protocol with typing_extensions.runtime_checkable. If you either import both symbols from typing or both symbols from typing_extensions, the error goes away.

@simonzg
Copy link

simonzg commented May 8, 2024

I know I might be asking for too much, but do you have any timeline in mind to publish a fix soon? I'm experiencing this exact error and would like to get it fixed soon. Thanks in advance. @banderlog

@banderlog
Copy link
Author

banderlog commented May 8, 2024

@simonzg #36

or hardcode specific version typing-extensions==4.9.0 in requirements/toml file

also, typing-extensions now have 4.11 version, in which it might be fixed already

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants