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

[typing] Make the runtime_typing.checked always typed #1738

Merged
merged 2 commits into from
Jul 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion onnxscript/_internal/runtime_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
T = typing.TypeVar("T", bound=typing.Callable[..., typing.Any])

try:
from beartype import beartype as checked
from beartype import beartype as _beartype_decorator
from beartype import roar as _roar

checked = typing.cast(typing.Callable[[T], T], _beartype_decorator)

# Beartype warns when we import from typing because the types are deprecated
# in Python 3.9. But there will be a long time until we can move to using
# the native container types for type annotations (when 3.9 is the lowest
Expand Down
Loading