-
-
Notifications
You must be signed in to change notification settings - Fork 233
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
Changes to behavior of runtime_checkable()
in py 3.12
#560
Comments
The vanilla |
This isn't a static typing issue. It is a runtime issue on python 3.12 where the |
Ah yes sorry ugh this is ugly I'll see what we can do. |
Thanks @hynek! |
This should be fixed by #561 – please lmk if you run into other similar issues! Is this issue something that blocks you? |
Will do!
No, we swapped out the |
I came across this - not sure if you'd consider it a bug but hopefully worth bringing to your attention.
We had some code that tries to handle multiple logging libraries which was essentially doing this:
The
isinstance()
check isTrue
for python versions <3.12, andFalse
on 3.12.This is due to a change in the way that
typing.runtime_checkable()
works:inspect.getattr_static()
doesn't call__getattr__
, which means it doesn't see the proxied attributes of the underying bound logger.I think the difference might be that the
_context
attribute doesn't exist on the proxy.structlog/src/structlog/typing.py
Lines 121 to 130 in d95197c
The text was updated successfully, but these errors were encountered: