The following code crashes, but only if importing annotations. Tested with Python 3.12, 3.13 and 3.14.
from __future__ import annotations
from typing import get_type_hints
def f():
class X:
pass
class Y:
x: X
print(get_type_hints(Y))
f() # NameError: name 'X' is not defined
from typing import get_type_hints
def f():
class X:
pass
class Y:
x: X
print(get_type_hints(Y))
f() # prints {'x': <class '__main__.f.<locals>.X'>}