agronholm / typeguard

Run-time type checker for Python
Other
1.5k stars 112 forks source link

typeguard fails on Python 3.12.4 while it works on 3.12.3 #466

Closed bersbersbers closed 3 months ago

bersbersbers commented 3 months ago

Things to check first

Typeguard version

4.2.1

Python version

3.12.4

What happened?

  File "c:\Code\project\.venv\Lib\site-packages\typeguard\_utils.py", line 18, in evaluate_forwardref
    return forwardref._evaluate(memo.globals, memo.locals, frozenset())
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: ForwardRef._evaluate() missing 1 required keyword-only argument: 'recursive_guard'

How can we reproduce the bug?

I am not sure.

I guess this is very similar to https://github.com/pydantic/pydantic-core/issues/1292 - likely, the change of the private API ForwardRef._evaluate was merged into 3.12.4 now.

bersbersbers commented 3 months ago

My bad - this has likely been fixed in passing by https://github.com/agronholm/typeguard/pull/460, it seems, and is included in 4.3.0. I just cannot use 4.3.0 due to https://github.com/agronholm/typeguard/issues/465 :)