Skip to content

Commit 4264669

Browse files
committed
chore: mid work
1 parent c40a6c4 commit 4264669

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

packages/@jsii/python-runtime/src/jsii/_type_checking.py

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def check_type(argname: str, value: object, expected_type: typing.Any) -> typing
2929

3030
def _resolve() -> typing.Callable[..., typing.Any]:
3131
"""Lazily import typeguard and return the appropriate check_type implementation."""
32-
import typeguard
32+
import typeguard # type: ignore
3333
from importlib.metadata import version as _metadata_package_version
3434
from jsii._reference_map import InterfaceDynamicProxy
3535

@@ -40,9 +40,7 @@ def _resolve() -> typing.Callable[..., typing.Any]:
4040
def _check_type(
4141
argname: str, value: object, expected_type: typing.Any
4242
) -> typing.Any:
43-
return typeguard.check_type(
44-
argname=argname, value=value, expected_type=expected_type
45-
) # type:ignore[call-overload]
43+
return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type: ignore
4644

4745
elif major_version == 3:
4846

@@ -52,12 +50,8 @@ def _check_type(
5250
if isinstance(value, InterfaceDynamicProxy):
5351
pass
5452
else:
55-
typeguard.config.collection_check_strategy = (
56-
typeguard.CollectionCheckStrategy.ALL_ITEMS
57-
) # type:ignore[attr-defined]
58-
typeguard.check_type(
59-
value=value, expected_type=expected_type
60-
) # type:ignore[call-overload]
53+
typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type: ignore
54+
typeguard.check_type(value=value, expected_type=expected_type) # type: ignore
6155

6256
else:
6357

@@ -67,10 +61,6 @@ def _check_type(
6761
if isinstance(value, InterfaceDynamicProxy):
6862
pass
6963
else:
70-
typeguard.check_type(
71-
value=value,
72-
expected_type=expected_type,
73-
collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS, # type:ignore[attr-defined]
74-
)
64+
typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type: ignore
7565

7666
return _check_type

0 commit comments

Comments
 (0)