pschanely / CrossHair

An analysis tool for Python that blurs the line between testing and type systems.
Other
1.03k stars 49 forks source link

`typing.get_type_hints()` raises `ValueError` when used inside Crosshair #275

Closed Zac-HD closed 4 months ago

Zac-HD commented 4 months ago
import typing

class Foo:
    def __init__(self, values: list) -> None:
        self._values = values

def fn(_: bool):
    """ post: True """
    return typing.get_type_hints(Foo)

the useful part of the traceback I got is

  File ".../lib/python3.10/typing.py", line 1970, in get_type_hints
    base_locals = dict(vars(base)) if localns is None else localns
  File ".../crosshair/libimpl/builtinslib.py", line 4280, in _dict
    raise ValueError
ValueError
pschanely commented 4 months ago

Fixed in v0.0.64