diff --git a/packages/@jsii/python-runtime/package.json b/packages/@jsii/python-runtime/package.json index edcaf0e3c4..34e29979ef 100644 --- a/packages/@jsii/python-runtime/package.json +++ b/packages/@jsii/python-runtime/package.json @@ -28,9 +28,11 @@ "build": "cp ../../../README.md . && rm -f jsii-*.whl && npm run generate && npm run deps && npm run lint", "lint": "ts-node build-tools/venv.ts black .", "package": "package-python && package-private", - "test": "npm run test:gen && npm run test:run && npm run test:types", + "test": "npm run test:gen && npm run test:run:typeguard-2 && npm run test:run:typeguard-3 && npm run test:run:typeguard-4 && npm run test:types", "test:gen": "npm run deps && ts-node build-tools/gen-calc.ts", - "test:run": "ts-node build-tools/venv.ts py.test -v --mypy", + "test:run:typeguard-2": "ts-node build-tools/venv.ts python -m pip install typeguard==2.13.3 && ts-node build-tools/venv.ts py.test -v --mypy", + "test:run:typeguard-3": "ts-node build-tools/venv.ts python -m pip install typeguard==3.0.2 && ts-node build-tools/venv.ts py.test -v --mypy", + "test:run:typeguard-4": "ts-node build-tools/venv.ts python -m pip install typeguard==4.3.0 && ts-node build-tools/venv.ts py.test -v --mypy", "test:types": "pyright -p .", "test:update": "UPDATE_DIFF=1 npm run test" }, diff --git a/packages/@jsii/python-runtime/setup.py b/packages/@jsii/python-runtime/setup.py index 7d94da77b9..39e823076a 100644 --- a/packages/@jsii/python-runtime/setup.py +++ b/packages/@jsii/python-runtime/setup.py @@ -34,7 +34,7 @@ "cattrs>=1.8,<23.3", "importlib_resources>=5.2.0", "publication>=0.0.3", # This is used by all generated code. - "typeguard~=2.13.3", # This is used by all generated code. + "typeguard>=2.13.3,<5.0.0", # This is used by all generated code. "python-dateutil", "typing_extensions>=3.8,<5.0", ], diff --git a/packages/@jsii/python-runtime/src/jsii/_runtime.py b/packages/@jsii/python-runtime/src/jsii/_runtime.py index 1731e19b66..35c3385300 100644 --- a/packages/@jsii/python-runtime/src/jsii/_runtime.py +++ b/packages/@jsii/python-runtime/src/jsii/_runtime.py @@ -168,6 +168,10 @@ def implements(*interfaces: Type[Any]) -> Callable[[T], T]: def deco(cls): cls.__jsii_type__ = getattr(cls, "__jsii_type__", None) cls.__jsii_ifaces__ = getattr(cls, "__jsii_ifaces__", []) + list(interfaces) + cls.__jsii_proxy_class__ = lambda: getattr(cls, "__jsii_proxy_class__", None) + + # https://github.com/agronholm/typeguard/issues/479 + cls.__protocol_attrs__ = getattr(cls, "__protocol_attrs__", []) return cls return deco diff --git a/packages/@jsii/python-runtime/tests/test_python.py b/packages/@jsii/python-runtime/tests/test_python.py index 774b3192f9..1aaa087ae6 100644 --- a/packages/@jsii/python-runtime/tests/test_python.py +++ b/packages/@jsii/python-runtime/tests/test_python.py @@ -27,17 +27,6 @@ def test_inheritance_maintained(self): assert base_names == ["DerivedStruct", "MyFirstStruct"] - def test_descriptive_error_when_passing_function(self): - obj = jsii_calc.Calculator() - - with pytest.raises( - TypeError, - match=re.escape( - "type of argument value must be one of (int, float); got method instead" - ), - ): - obj.add(cast(Any, self.test_descriptive_error_when_passing_function)) - def test_implements_interface(self) -> None: """Checks that jsii-generated classes correctly implement the relevant jsii-generated interfaces.""" diff --git a/packages/@jsii/python-runtime/tests/test_runtime_type_checking.py b/packages/@jsii/python-runtime/tests/test_runtime_type_checking.py index abe92f828d..300615743c 100644 --- a/packages/@jsii/python-runtime/tests/test_runtime_type_checking.py +++ b/packages/@jsii/python-runtime/tests/test_runtime_type_checking.py @@ -1,14 +1,31 @@ import pytest import re -from typing import Optional +from typing import Optional, cast, Any from scope.jsii_calc_lib.custom_submodule_name import NestingClass from scope.jsii_calc_lib import Number import jsii_calc import jsii +import typeguard +from importlib.metadata import version + +TYPEGUARD_MAJOR_VERSION = int(version("typeguard").split(".")[0]) + + +@jsii.implements(jsii_calc.IBellRinger) +class PythonInvalidBellRinger: + def your_invalid_turn(self, bell): + bell.ring() + + +@pytest.mark.skipif(TYPEGUARD_MAJOR_VERSION != 2, reason="requires typeguard 2.x") +class TestRuntimeTypeCheckingTypeGuardV2: + + @property + def check_type_error(self): + return TypeError -class TestRuntimeTypeChecking: """ These tests verify that runtime type checking performs the necessary validations and produces error messages that are indicative of the error. There are #type:ignore annotations scattered everywhere as these tests are obviously @@ -17,7 +34,7 @@ class TestRuntimeTypeChecking: def test_constructor(self): with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument initial_value must be one of (int, float, NoneType); got str instead" ), @@ -31,7 +48,7 @@ def test_constructor_decorated(self): """ with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument maximum_value must be one of (int, float, NoneType); got str instead" ), @@ -57,7 +74,7 @@ def decorated( def test_struct(self): with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument foo must be jsii_calc.StringEnum; got int instead" ), @@ -67,7 +84,7 @@ def test_struct(self): def test_method_arg(self): subject = jsii_calc.Calculator() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument value must be one of (int, float); got str instead" ), @@ -77,7 +94,7 @@ def test_method_arg(self): def test_method_kwarg(self): subject = jsii_calc.DocumentedClass() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument name must be one of (str, NoneType); got int instead" ), @@ -87,7 +104,7 @@ def test_method_kwarg(self): def test_method_vararg(self): subject = jsii_calc.StructPassing() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument inputs[0] must be jsii_calc.TopLevelStruct; got int instead" ), @@ -97,7 +114,7 @@ def test_method_vararg(self): def test_setter_to_enum(self): subject = jsii_calc.AllTypes() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument value must be jsii_calc.AllTypesEnum; got int instead" ), @@ -107,7 +124,7 @@ def test_setter_to_enum(self): def test_setter_to_primitive(self): subject = jsii_calc.AllTypes() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape("type of argument value must be str; got int instead"), ): subject.string_property = 1337 # type:ignore @@ -115,7 +132,7 @@ def test_setter_to_primitive(self): def test_setter_to_map(self): subject = jsii_calc.AllTypes() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument value must be collections.abc.Mapping; got jsii_calc.StructWithEnum instead" ), @@ -127,7 +144,7 @@ def test_setter_to_map(self): def test_setter_to_list(self): subject = jsii_calc.AllTypes() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape("type of argument value must be a list; got int instead"), ): subject.array_property = 1337 # type:ignore @@ -135,7 +152,7 @@ def test_setter_to_list(self): def test_setter_to_list_with_invalid_value(self): subject = jsii_calc.AllTypes() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape("type of argument value[0] must be str; got int instead"), ): subject.array_property = [1337] # type:ignore @@ -143,7 +160,7 @@ def test_setter_to_list_with_invalid_value(self): def test_setter_to_union(self): subject = jsii_calc.AllTypes() with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument value must be one of (str, int, float, scope.jsii_calc_lib.Number, jsii_calc.Multiply); got jsii_calc.StringEnum instead" ), @@ -163,7 +180,7 @@ def test_anonymous_object(self): def test_nested_union(self): with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument union_property[0] must be one of (Mapping[str, Union[jsii_calc.StructA, Dict[str, Any], jsii_calc.StructB]], Sequence[Union[jsii_calc.StructA, Dict[str, Any], jsii_calc.StructB]]); got float instead" ), @@ -172,7 +189,7 @@ def test_nested_union(self): def test_variadic(self): with pytest.raises( - TypeError, + self.check_type_error, match=re.escape( "type of argument union[1] must be one of (jsii_calc.StructA, jsii_calc.StructB); got float instead" ), @@ -221,3 +238,477 @@ def test_shadowed_builtins_are_not_a_problem(self): "required_string": "Present!", }, ) + + def test_descriptive_error_when_passing_function(self): + obj = jsii_calc.Calculator() + + with pytest.raises( + self.check_type_error, + match=re.escape( + "type of argument value must be one of (int, float); got method instead" + ), + ): + obj.add(cast(Any, self.test_descriptive_error_when_passing_function)) + + +@pytest.mark.skipif(TYPEGUARD_MAJOR_VERSION != 3, reason="requires typeguard 3.x") +class TestRuntimeTypeCheckingTypeGuardV3: + + @property + def check_type_error(self): + return typeguard.TypeCheckError # type:ignore + + """ + These tests verify that runtime type checking performs the necessary validations and produces error messages that + are indicative of the error. There are #type:ignore annotations scattered everywhere as these tests are obviously + attempting to demonstrate what happens when invalid calls are being made. + """ + + def test_constructor(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "str did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int\n NoneType: is not an instance of NoneType" + ), + ): + jsii_calc.Calculator(initial_value="nope") # type:ignore + + def test_constructor_decorated(self): + """ + This test verifies that runtime type checking is not broken when a function is wrapped with a decorator, as was + the case with the original implementation (due to a dynamic access to type_hints for the method via the type). + """ + + with pytest.raises( + self.check_type_error, + match=re.escape( + "str did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int\n NoneType: is not an instance of NoneType" + ), + ): + orig_init = jsii_calc.Calculator.__init__ + + # For toy, swap initial_value and maximum_values here + def decorated( + self, + *, + initial_value: Optional[jsii.Number] = None, + maximum_value: Optional[jsii.Number] = None, + ): + orig_init( + self, initial_value=maximum_value, maximum_value=initial_value + ) + + jsii_calc.Calculator.__init__ = decorated + try: + jsii_calc.Calculator(initial_value="nope") # type:ignore + finally: + jsii_calc.Calculator.__init__ = orig_init + + def test_struct(self): + with pytest.raises( + self.check_type_error, + match=re.escape("int is not an instance of jsii_calc.StringEnum"), + ): + jsii_calc.StructWithEnum(foo=1337) # type:ignore + + def test_method_arg(self): + subject = jsii_calc.Calculator() + with pytest.raises( + self.check_type_error, + match=re.escape( + "str did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int" + ), + ): + subject.mul("Not a Number") # type:ignore + + def test_method_kwarg(self): + subject = jsii_calc.DocumentedClass() + with pytest.raises( + self.check_type_error, + match=re.escape( + "int did not match any element in the union:\n str: is not an instance of str\n NoneType: is not an instance of NoneType" + ), + ): + subject.greet(name=1337) # type:ignore + + def test_method_vararg(self): + subject = jsii_calc.StructPassing() + with pytest.raises( + self.check_type_error, + match=re.escape( + "item 0 of tuple is not an instance of jsii_calc.TopLevelStruct" + ), + ): + subject.how_many_var_args_did_i_pass(1337, 42) # type:ignore + + def test_setter_to_enum(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("int is not an instance of jsii_calc.AllTypesEnum"), + ): + subject.enum_property = 1337 # type:ignore + + def test_setter_to_primitive(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("int is not an instance of str"), + ): + subject.string_property = 1337 # type:ignore + + def test_setter_to_map(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("jsii_calc.StructWithEnum is not a mapping"), + ): + subject.map_property = jsii_calc.StructWithEnum( # type:ignore + foo=jsii_calc.StringEnum.A + ) + + def test_setter_to_list(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("int is not a list"), + ): + subject.array_property = 1337 # type:ignore + + def test_setter_to_list_with_invalid_value(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("item 0 of list is not an instance of str"), + ): + subject.array_property = [1337] # type:ignore + + def test_setter_to_union(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape( + "jsii_calc.StringEnum did not match any element in the union:\n str: is not an instance of str\n int: is not an instance of int\n float: is neither float or int\n scope.jsii_calc_lib.Number: is not an instance of scope.jsii_calc_lib.Number\n jsii_calc.Multiply: is not an instance of jsii_calc.Multiply" + ), + ): + subject.union_property = jsii_calc.StringEnum.B # type:ignore + + def test_nested_struct(self): + # None of these should throw... + NestingClass.NestedStruct(name="Queen B") + + def test_anonymous_object(self): + struct = jsii_calc.StructUnionConsumer.provide_struct("A") + assert jsii_calc.StructUnionConsumer.is_struct_a(struct) + + iface = jsii_calc.anonymous.UseOptions.provide("A") + assert jsii_calc.anonymous.UseOptions.consume(iface) == "A" + + def test_nested_union(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "item 0 of list did not match any element in the union:\n Mapping[str, Union[jsii_calc.StructA, Dict[str, Any], jsii_calc.StructB]]: is not a mapping\n Sequence[Union[jsii_calc.StructA, Dict[str, Any], jsii_calc.StructB]]: is not a sequence" + ), + ): + jsii_calc.ClassWithNestedUnion([1337.42]) # type:ignore + + def test_variadic(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "item 1 of tuple did not match any element in the union:\n jsii_calc.StructA: is not an instance of jsii_calc.StructA\n jsii_calc.StructB: is not an instance of jsii_calc.StructB" + ), + ): + jsii_calc.VariadicTypeUnion( + jsii_calc.StructA(required_string="present"), 1337.42 # type:ignore + ) + + jsii_calc.VariadicTypeUnion() + + def test_homonymous_forward_references(self): + """Verifies homonymous forward references don't trip the type checker + + This has been an issue when stub functions were introduced to create a reliable source for type checking + information, which was reported in https://github.com/aws/jsii/issues/3818. + """ + # This uses a ForwardRef["Homonymous"] that should resolve to jsii_calc.homonymous_forward_references.foo.Homonymous + jsii_calc.homonymous_forward_references.foo.Consumer.consume( + homonymous={"string_property": "Check!"} + ) + # This uses a ForwardRef["Homonymous"] that should resolve to jsii_calc.homonymous_forward_references.bar.Homonymous + jsii_calc.homonymous_forward_references.bar.Consumer.consume( + homonymous={"numeric_property": 1337} + ) + + def test_shadowed_namespaces_are_not_a_problem(self): + """Verifies that a parameter shadowing a namespace does not cause errors + + This has caused https://github.com/aws/aws-cdk/issues/22975. + """ + + subject = jsii_calc.ParamShadowsScope() + num = Number(1337) + # The parameter is named "scope" which shadows the "scope" module... + assert num == subject.use_scope(num) + + def test_shadowed_builtins_are_not_a_problem(self): + """Verifies that a parameter shadowing a built-in name does not cause errors""" + + jsii_calc.ParamShadowsBuiltins( + "${not a Python type (builtins)}", + "${not a Python type (str)}", + string_property="Most definitely a string", + boolean_property=True, + struct_property={ + "required_string": "Present!", + }, + ) + + def test_descriptive_error_when_passing_function(self): + obj = jsii_calc.Calculator() + + with pytest.raises( + self.check_type_error, + match=re.escape( + "method did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int" + ), + ): + obj.add(cast(Any, self.test_descriptive_error_when_passing_function)) + + +@pytest.mark.skipif(TYPEGUARD_MAJOR_VERSION != 4, reason="requires typeguard 4.x") +class TestRuntimeTypeCheckingTypeGuardV4: + + @property + def check_type_error(self): + return typeguard.TypeCheckError # type:ignore + + """ + These tests verify that runtime type checking performs the necessary validations and produces error messages that + are indicative of the error. There are #type:ignore annotations scattered everywhere as these tests are obviously + attempting to demonstrate what happens when invalid calls are being made. + """ + + def test_constructor(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "str did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int\n NoneType: is not an instance of NoneType" + ), + ): + jsii_calc.Calculator(initial_value="nope") # type:ignore + + def test_constructor_decorated(self): + """ + This test verifies that runtime type checking is not broken when a function is wrapped with a decorator, as was + the case with the original implementation (due to a dynamic access to type_hints for the method via the type). + """ + + with pytest.raises( + self.check_type_error, + match=re.escape( + "str did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int\n NoneType: is not an instance of NoneType" + ), + ): + orig_init = jsii_calc.Calculator.__init__ + + # For toy, swap initial_value and maximum_values here + def decorated( + self, + *, + initial_value: Optional[jsii.Number] = None, + maximum_value: Optional[jsii.Number] = None, + ): + orig_init( + self, initial_value=maximum_value, maximum_value=initial_value + ) + + jsii_calc.Calculator.__init__ = decorated + try: + jsii_calc.Calculator(initial_value="nope") # type:ignore + finally: + jsii_calc.Calculator.__init__ = orig_init + + def test_struct(self): + with pytest.raises( + self.check_type_error, + match=re.escape("int is not an instance of jsii_calc.StringEnum"), + ): + jsii_calc.StructWithEnum(foo=1337) # type:ignore + + def test_method_arg(self): + subject = jsii_calc.Calculator() + with pytest.raises( + self.check_type_error, + match=re.escape( + "str did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int" + ), + ): + subject.mul("Not a Number") # type:ignore + + def test_method_kwarg(self): + subject = jsii_calc.DocumentedClass() + with pytest.raises( + self.check_type_error, + match=re.escape( + "int did not match any element in the union:\n str: is not an instance of str\n NoneType: is not an instance of NoneType" + ), + ): + subject.greet(name=1337) # type:ignore + + def test_method_vararg(self): + subject = jsii_calc.StructPassing() + with pytest.raises( + self.check_type_error, + match=re.escape( + "item 0 of tuple is not an instance of jsii_calc.TopLevelStruct" + ), + ): + subject.how_many_var_args_did_i_pass(1337, 42) # type:ignore + + def test_setter_to_enum(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("int is not an instance of jsii_calc.AllTypesEnum"), + ): + subject.enum_property = 1337 # type:ignore + + def test_setter_to_primitive(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("int is not an instance of str"), + ): + subject.string_property = 1337 # type:ignore + + def test_setter_to_map(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("jsii_calc.StructWithEnum is not a mapping"), + ): + subject.map_property = jsii_calc.StructWithEnum( # type:ignore + foo=jsii_calc.StringEnum.A + ) + + def test_setter_to_list(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("int is not a list"), + ): + subject.array_property = 1337 # type:ignore + + def test_setter_to_list_with_invalid_value(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape("item 0 of list is not an instance of str"), + ): + subject.array_property = [1337] # type:ignore + + def test_setter_to_union(self): + subject = jsii_calc.AllTypes() + with pytest.raises( + self.check_type_error, + match=re.escape( + "jsii_calc.StringEnum did not match any element in the union:\n str: is not an instance of str\n int: is not an instance of int\n float: is neither float or int\n scope.jsii_calc_lib.Number: is not an instance of scope.jsii_calc_lib.Number\n jsii_calc.Multiply: is not an instance of jsii_calc.Multiply" + ), + ): + subject.union_property = jsii_calc.StringEnum.B # type:ignore + + def test_nested_struct(self): + # None of these should throw... + NestingClass.NestedStruct(name="Queen B") + + def test_anonymous_object(self): + struct = jsii_calc.StructUnionConsumer.provide_struct("A") + assert jsii_calc.StructUnionConsumer.is_struct_a(struct) + + iface = jsii_calc.anonymous.UseOptions.provide("A") + assert jsii_calc.anonymous.UseOptions.consume(iface) == "A" + + def test_nested_union(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "item 0 of list did not match any element in the union:\n Mapping[str, Union[jsii_calc.StructA, Dict[str, Any], jsii_calc.StructB]]: is not a mapping\n Sequence[Union[jsii_calc.StructA, Dict[str, Any], jsii_calc.StructB]]: is not a sequence" + ), + ): + jsii_calc.ClassWithNestedUnion([1337.42]) # type:ignore + + def test_variadic(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "item 1 of tuple did not match any element in the union:\n jsii_calc.StructA: is not an instance of jsii_calc.StructA\n jsii_calc.StructB: is not an instance of jsii_calc.StructB" + ), + ): + jsii_calc.VariadicTypeUnion( + jsii_calc.StructA(required_string="present"), 1337.42 # type:ignore + ) + + jsii_calc.VariadicTypeUnion() + + def test_homonymous_forward_references(self): + """Verifies homonymous forward references don't trip the type checker + + This has been an issue when stub functions were introduced to create a reliable source for type checking + information, which was reported in https://github.com/aws/jsii/issues/3818. + """ + # This uses a ForwardRef["Homonymous"] that should resolve to jsii_calc.homonymous_forward_references.foo.Homonymous + jsii_calc.homonymous_forward_references.foo.Consumer.consume( + homonymous={"string_property": "Check!"} + ) + # This uses a ForwardRef["Homonymous"] that should resolve to jsii_calc.homonymous_forward_references.bar.Homonymous + jsii_calc.homonymous_forward_references.bar.Consumer.consume( + homonymous={"numeric_property": 1337} + ) + + def test_shadowed_namespaces_are_not_a_problem(self): + """Verifies that a parameter shadowing a namespace does not cause errors + + This has caused https://github.com/aws/aws-cdk/issues/22975. + """ + + subject = jsii_calc.ParamShadowsScope() + num = Number(1337) + # The parameter is named "scope" which shadows the "scope" module... + assert num == subject.use_scope(num) + + def test_shadowed_builtins_are_not_a_problem(self): + """Verifies that a parameter shadowing a built-in name does not cause errors""" + + jsii_calc.ParamShadowsBuiltins( + "${not a Python type (builtins)}", + "${not a Python type (str)}", + string_property="Most definitely a string", + boolean_property=True, + struct_property={ + "required_string": "Present!", + }, + ) + + def test_descriptive_error_when_passing_function(self): + obj = jsii_calc.Calculator() + + with pytest.raises( + self.check_type_error, + match=re.escape( + "method did not match any element in the union:\n int: is not an instance of int\n float: is neither float or int" + ), + ): + obj.add(cast(Any, self.test_descriptive_error_when_passing_function)) + + def test_protocol(self): + with pytest.raises( + self.check_type_error, + match=re.escape( + "tests.test_runtime_type_checking.PythonInvalidBellRinger is not compatible with the IBellRinger protocol because it has no method named 'your_turn'" + ), + ): + jsii_calc.ConsumerCanRingBell().implemented_by_object_literal( + PythonInvalidBellRinger() # type:ignore + ) diff --git a/packages/jsii-pacmak/lib/targets/python.ts b/packages/jsii-pacmak/lib/targets/python.ts index 4b6ae6ee51..938f0aea2b 100644 --- a/packages/jsii-pacmak/lib/targets/python.ts +++ b/packages/jsii-pacmak/lib/targets/python.ts @@ -1728,7 +1728,44 @@ class PythonModule implements PythonType { code.line('import publication'); code.line('import typing_extensions'); code.line(); - code.line('from typeguard import check_type'); + + code.line('import typeguard'); + code.line('from importlib.metadata import version as _metadata_package_version'); + code.line( + "TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0])", + ); + code.line(); + + code.openBlock( + 'def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any', + ); + code.openBlock('if TYPEGUARD_MAJOR_VERSION <= 2'); + code.line( + 'return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore', + ); + code.closeBlock(); + code.openBlock('else'); + code.line( + 'if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue]', + ); + code.line(' pass'); + code.openBlock('else'); + code.openBlock('if TYPEGUARD_MAJOR_VERSION == 3'); + code.line( + 'typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore', + ); + code.line( + 'typeguard.check_type(value=value, expected_type=expected_type) # type:ignore', + ); + code.closeBlock(); + code.openBlock('else'); + code.line( + 'typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore', + ); + code.closeBlock(); + code.closeBlock(); + code.closeBlock(); + code.closeBlock(); // Determine if we need to write out the kernel load line. if (this.loadAssembly) { @@ -2129,7 +2166,7 @@ class Package { install_requires: [ `jsii${toPythonVersionRange(`^${VERSION}`)}`, 'publication>=0.0.3', - 'typeguard~=2.13.3', + 'typeguard>=2.13.3,<5.0.0', ] .concat(dependencies) .sort(), diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap index 1c11853501..e336eb85d5 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/examples.test.js.snap @@ -1270,7 +1270,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -1311,7 +1311,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ._jsii import * @@ -1528,7 +1543,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore __jsii_assembly__ = jsii.JSIIAssembly.load( "testpkg", "0.0.1", __name__[0:-6], "testpkg@0.0.1.jsii.tgz" @@ -2697,7 +2727,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -2738,7 +2768,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ._jsii import * @@ -2865,7 +2910,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore __jsii_assembly__ = jsii.JSIIAssembly.load( "testpkg", "0.0.1", __name__[0:-6], "testpkg@0.0.1.jsii.tgz" diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap index ec525eb43e..28b1cecf14 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/prerelease-identifiers.test.js.snap @@ -459,7 +459,7 @@ kwargs = json.loads( "bar>=2.0.0.rc42, <3.0.0", "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -499,7 +499,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore import bar._jsii @@ -976,7 +991,7 @@ kwargs = json.loads( "bar>=4.5.6.dev1337, <5.0.0", "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -1016,7 +1031,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore import bar._jsii @@ -1472,7 +1502,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -1512,7 +1542,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore __jsii_assembly__ = jsii.JSIIAssembly.load( "foo", "2.0.0-rc.42", __name__[0:-6], "foo@2.0.0-rc.42.jsii.tgz" @@ -1966,7 +2011,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -2006,7 +2051,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore __jsii_assembly__ = jsii.JSIIAssembly.load( "foo", "4.5.6-pre.1337", __name__[0:-6], "foo@4.5.6-pre.1337.jsii.tgz" diff --git a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap index 986afb3ebb..f678c870ee 100644 --- a/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap +++ b/packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap @@ -294,7 +294,7 @@ kwargs = json.loads( "jsii<0.0.1", "publication>=0.0.3", "scope.jsii-calc-base-of-base>=2.1.1, <3.0.0", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -335,7 +335,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ._jsii import * @@ -474,7 +489,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore import scope.jsii_calc_base_of_base._jsii @@ -509,7 +539,7 @@ exports[`Generated code for "@scope/jsii-calc-base": / exports[`Generated code for "@scope/jsii-calc-base": /python/src/scope/jsii_calc_base/__init__.py.diff 1`] = ` --- python/src/scope/jsii_calc_base/__init__.py --no-runtime-type-checking +++ python/src/scope/jsii_calc_base/__init__.py --runtime-type-checking -@@ -53,10 +53,14 @@ +@@ -68,10 +68,14 @@ ) -> None: ''' :param foo: - @@ -524,7 +554,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /p "bar": bar, } -@@ -120,10 +124,13 @@ +@@ -135,10 +139,13 @@ @builtins.classmethod def consume(cls, *args: typing.Any) -> None: ''' @@ -538,7 +568,7 @@ exports[`Generated code for "@scope/jsii-calc-base": /p __all__ = [ "Base", -@@ -131,5 +138,19 @@ +@@ -146,5 +153,19 @@ "IBaseInterface", "StaticConsumer", ] @@ -853,7 +883,7 @@ kwargs = json.loads( "install_requires": [ "jsii<0.0.1", "publication>=0.0.3", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -894,7 +924,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ._jsii import * @@ -1004,7 +1049,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore __jsii_assembly__ = jsii.JSIIAssembly.load( "@scope/jsii-calc-base-of-base", @@ -1040,7 +1100,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": /python/src/scope/jsii_calc_base_of_base/__init__.py.diff 1`] = ` --- python/src/scope/jsii_calc_base_of_base/__init__.py --no-runtime-type-checking +++ python/src/scope/jsii_calc_base_of_base/__init__.py --runtime-type-checking -@@ -42,10 +42,13 @@ +@@ -57,10 +57,13 @@ @builtins.classmethod def consume(cls, *_args: typing.Any) -> None: ''' @@ -1054,7 +1114,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": None: ''' @@ -1068,7 +1128,7 @@ exports[`Generated code for "@scope/jsii-calc-base-of-base": =0.0.3", "scope.jsii-calc-base-of-base>=2.1.1, <3.0.0", "scope.jsii-calc-base<0.0.1", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -1432,7 +1492,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ._jsii import * @@ -2052,7 +2127,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore import scope.jsii_calc_base._jsii import scope.jsii_calc_base_of_base._jsii @@ -2090,7 +2180,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -2301,7 +2406,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -2407,7 +2527,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": / 1 exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/jsii_calc_lib/__init__.py.diff 1`] = ` --- python/src/scope/jsii_calc_lib/__init__.py --no-runtime-type-checking +++ python/src/scope/jsii_calc_lib/__init__.py --runtime-type-checking -@@ -37,19 +37,25 @@ +@@ -52,19 +52,25 @@ ''' :param very: - @@ -2433,7 +2553,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py @jsii.data_type( jsii_type="@scope/jsii-calc-lib.DiamondLeft", -@@ -67,10 +73,14 @@ +@@ -82,10 +88,14 @@ :param hoisted_top: :param left: @@ -2448,7 +2568,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py self._values["hoisted_top"] = hoisted_top if left is not None: self._values["left"] = left -@@ -119,10 +129,14 @@ +@@ -134,10 +144,14 @@ :param hoisted_top: :param right: @@ -2463,7 +2583,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py self._values["hoisted_top"] = hoisted_top if right is not None: self._values["right"] = right -@@ -194,10 +208,13 @@ +@@ -209,10 +223,13 @@ ''' :param _: - @@ -2477,7 +2597,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py @jsii.interface(jsii_type="@scope/jsii-calc-lib.IDoublable") class IDoublable(typing_extensions.Protocol): -@@ -345,10 +362,15 @@ +@@ -360,10 +377,15 @@ :param astring: (deprecated) A string value. :param first_optional: @@ -2493,7 +2613,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py "astring": astring, } if first_optional is not None: -@@ -505,10 +527,15 @@ +@@ -520,10 +542,15 @@ :param optional2: :param optional3: @@ -2509,7 +2629,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py self._values["optional1"] = optional1 if optional2 is not None: self._values["optional2"] = optional2 -@@ -568,10 +595,13 @@ +@@ -583,10 +610,13 @@ :param value: The number. @@ -2523,7 +2643,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py @builtins.property @jsii.member(jsii_name="doubleValue") def double_value(self) -> jsii.Number: -@@ -612,5 +642,63 @@ +@@ -627,5 +657,63 @@ publication.publish() # Loading modules to ensure their types are registered with the jsii runtime library @@ -2592,7 +2712,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py exports[`Generated code for "@scope/jsii-calc-lib": /python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py.diff 1`] = ` --- python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --no-runtime-type-checking +++ python/src/scope/jsii_calc_lib/custom_submodule_name/__init__.py --runtime-type-checking -@@ -100,10 +100,13 @@ +@@ -115,10 +115,13 @@ :param name: @@ -2606,7 +2726,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py } @builtins.property -@@ -138,10 +141,14 @@ +@@ -153,10 +156,14 @@ :param key: :param value: @@ -2621,7 +2741,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py "value": value, } -@@ -197,10 +204,13 @@ +@@ -212,10 +219,13 @@ ''' :param reflectable: - @@ -2635,7 +2755,7 @@ exports[`Generated code for "@scope/jsii-calc-lib": /py __all__ = [ "IReflectable", -@@ -208,5 +218,26 @@ +@@ -223,5 +233,26 @@ "ReflectableEntry", "Reflector", ] @@ -3099,7 +3219,7 @@ kwargs = json.loads( "publication>=0.0.3", "scope.jsii-calc-base<0.0.1", "scope.jsii-calc-lib<0.0.1", - "typeguard~=2.13.3" + "typeguard>=2.13.3,<5.0.0" ], "classifiers": [ "Intended Audience :: Developers", @@ -3170,7 +3290,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ._jsii import * @@ -11765,7 +11900,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore import scope.jsii_calc_base._jsii import scope.jsii_calc_lib._jsii @@ -11817,7 +11967,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -11908,7 +12073,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -11976,7 +12156,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -12034,7 +12229,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12105,7 +12315,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12224,7 +12449,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12284,7 +12524,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12315,7 +12570,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -12433,7 +12703,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -12551,7 +12836,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12628,7 +12928,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12687,7 +13002,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12810,7 +13140,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12865,7 +13210,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12907,7 +13267,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -12966,7 +13341,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -13001,7 +13391,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13059,7 +13464,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13106,7 +13526,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13151,7 +13586,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13228,7 +13678,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -13259,7 +13724,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13318,7 +13798,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13434,7 +13929,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -13516,7 +14026,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -13752,7 +14277,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -13783,7 +14323,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13822,7 +14377,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -13861,7 +14431,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -13905,7 +14490,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -14037,7 +14637,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -14173,7 +14788,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -14234,7 +14864,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -14434,7 +15079,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -14485,7 +15145,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -14546,7 +15221,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ...._jsii import * @@ -14595,7 +15285,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -14654,7 +15359,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from ..._jsii import * @@ -14695,7 +15415,22 @@ import jsii import publication import typing_extensions -from typeguard import check_type +import typeguard +from importlib.metadata import version as _metadata_package_version +TYPEGUARD_MAJOR_VERSION = int(_metadata_package_version('typeguard').split('.')[0]) + +def check_type(argname: str, value: object, expected_type: typing.Any) -> typing.Any: + if TYPEGUARD_MAJOR_VERSION <= 2: + return typeguard.check_type(argname=argname, value=value, expected_type=expected_type) # type:ignore + else: + if isinstance(value, jsii._reference_map.InterfaceDynamicProxy): # pyright: ignore [reportAttributeAccessIssue] + pass + else: + if TYPEGUARD_MAJOR_VERSION == 3: + typeguard.config.collection_check_strategy = typeguard.CollectionCheckStrategy.ALL_ITEMS # type:ignore + typeguard.check_type(value=value, expected_type=expected_type) # type:ignore + else: + typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore from .._jsii import * @@ -14810,7 +15545,7 @@ exports[`Generated code for "jsii-calc": / 1`] = ` exports[`Generated code for "jsii-calc": /python/src/jsii_calc/__init__.py.diff 1`] = ` --- python/src/jsii_calc/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/__init__.py --runtime-type-checking -@@ -114,10 +114,13 @@ +@@ -129,10 +129,13 @@ def work_it_all(self, seed: builtins.str) -> builtins.str: '''Sets \`\`seed\`\` to \`\`this.property\`\`, then calls \`\`someMethod\`\` with \`\`this.property\`\` and returns the result. @@ -14824,7 +15559,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="property") @abc.abstractmethod -@@ -134,19 +137,25 @@ +@@ -149,19 +152,25 @@ @jsii.member(jsii_name="someMethod") def _some_method(self, str: builtins.str) -> builtins.str: ''' @@ -14850,7 +15585,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, AbstractSuite).__jsii_proxy_class__ = lambda : _AbstractSuiteProxy -@@ -164,10 +173,13 @@ +@@ -179,10 +188,13 @@ @jsii.member(jsii_name="anyIn") def any_in(self, inp: typing.Any) -> None: ''' @@ -14864,7 +15599,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="anyOut") def any_out(self) -> typing.Any: return typing.cast(typing.Any, jsii.invoke(self, "anyOut", [])) -@@ -175,10 +187,13 @@ +@@ -190,10 +202,13 @@ @jsii.member(jsii_name="enumMethod") def enum_method(self, value: "StringEnum") -> "StringEnum": ''' @@ -14878,7 +15613,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="enumPropertyValue") def enum_property_value(self) -> jsii.Number: -@@ -189,73 +204,97 @@ +@@ -204,73 +219,97 @@ def any_array_property(self) -> typing.List[typing.Any]: return typing.cast(typing.List[typing.Any], jsii.get(self, "anyArrayProperty")) @@ -14976,7 +15711,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="mapProperty") def map_property( -@@ -266,28 +305,37 @@ +@@ -281,28 +320,37 @@ @map_property.setter def map_property( self, @@ -15014,7 +15749,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unionArrayProperty") def union_array_property( -@@ -298,10 +346,13 @@ +@@ -313,10 +361,13 @@ @union_array_property.setter def union_array_property( self, @@ -15028,7 +15763,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unionMapProperty") def union_map_property( -@@ -312,10 +363,13 @@ +@@ -327,10 +378,13 @@ @union_map_property.setter def union_map_property( self, @@ -15042,7 +15777,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -326,19 +380,25 @@ +@@ -341,19 +395,25 @@ @union_property.setter def union_property( self, @@ -15068,7 +15803,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unknownMapProperty") def unknown_map_property(self) -> typing.Mapping[builtins.str, typing.Any]: -@@ -347,28 +407,37 @@ +@@ -362,28 +422,37 @@ @unknown_map_property.setter def unknown_map_property( self, @@ -15106,7 +15841,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.AllTypesEnum") class AllTypesEnum(enum.Enum): -@@ -388,36 +457,52 @@ +@@ -403,36 +472,52 @@ def get_bar(self, _p1: builtins.str, _p2: jsii.Number) -> None: ''' :param _p1: - @@ -15159,7 +15894,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class AmbiguousParameters( metaclass=jsii.JSIIMeta, -@@ -433,10 +518,13 @@ +@@ -448,10 +533,13 @@ ''' :param scope_: - :param scope: @@ -15173,7 +15908,7 @@ exports[`Generated code for "jsii-calc": /python/src/js jsii.create(self.__class__, self, [scope_, props_]) @builtins.property -@@ -468,10 +556,16 @@ +@@ -483,10 +571,16 @@ :param obj: the receiver object. :param prop_a: the first property to read. :param prop_b: the second property to read. @@ -15190,7 +15925,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class AsyncVirtualMethods( metaclass=jsii.JSIIMeta, -@@ -506,10 +600,13 @@ +@@ -521,10 +615,13 @@ @jsii.member(jsii_name="overrideMe") def override_me(self, mult: jsii.Number) -> jsii.Number: ''' @@ -15204,7 +15939,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="overrideMeToo") def override_me_too(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.ainvoke(self, "overrideMeToo", [])) -@@ -570,10 +667,14 @@ +@@ -585,10 +682,14 @@ '''Creates a BinaryOperation. :param lhs: Left-hand side operand. @@ -15219,7 +15954,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: '''Say hello!''' -@@ -634,10 +735,13 @@ +@@ -649,10 +750,13 @@ :param value: the value that should be returned. @@ -15233,7 +15968,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, BurriedAnonymousObject).__jsii_proxy_class__ = lambda : _BurriedAnonymousObjectProxy -@@ -687,18 +791,24 @@ +@@ -702,18 +806,24 @@ def add(self, value: jsii.Number) -> None: '''Adds a number to the current value. @@ -15258,7 +15993,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="neg") def neg(self) -> None: '''Negates the current value.''' -@@ -708,10 +818,13 @@ +@@ -723,10 +833,13 @@ def pow(self, value: jsii.Number) -> None: '''Raises the current value by a power. @@ -15272,7 +16007,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="readUnionValue") def read_union_value(self) -> jsii.Number: '''Returns teh value of the union property (if defined).''' -@@ -743,20 +856,26 @@ +@@ -758,20 +871,26 @@ '''The current value.''' return typing.cast(_scope_jsii_calc_lib_c61f082f.NumericValue, jsii.get(self, "curr")) @@ -15299,7 +16034,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -768,10 +887,13 @@ +@@ -783,10 +902,13 @@ @union_property.setter def union_property( self, @@ -15313,7 +16048,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.CalculatorProps", -@@ -788,10 +910,14 @@ +@@ -803,10 +925,14 @@ '''Properties for Calculator. :param initial_value: The initial value of the calculator. NOTE: Any number works here, it's fine. Default: 0 @@ -15328,7 +16063,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["initial_value"] = initial_value if maximum_value is not None: self._values["maximum_value"] = maximum_value -@@ -837,10 +963,13 @@ +@@ -852,10 +978,13 @@ union_property: typing.Sequence[typing.Mapping[builtins.str, typing.Union[typing.Union["StructA", typing.Dict[builtins.str, typing.Any]], typing.Union["StructB", typing.Dict[builtins.str, typing.Any]]]]], ) -> None: ''' @@ -15342,7 +16077,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -851,10 +980,13 @@ +@@ -866,10 +995,13 @@ @union_property.setter def union_property( self, @@ -15356,7 +16091,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ClassWithCollections( metaclass=jsii.JSIIMeta, -@@ -867,10 +999,14 @@ +@@ -882,10 +1014,14 @@ ) -> None: ''' :param map: - @@ -15371,7 +16106,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="createAList") @builtins.classmethod def create_a_list(cls) -> typing.List[builtins.str]: -@@ -886,37 +1022,49 @@ +@@ -901,37 +1037,49 @@ def static_array(cls) -> typing.List[builtins.str]: # pyright: ignore [reportGeneralTypeIssues,reportRedeclaration] return typing.cast(typing.List[builtins.str], jsii.sget(cls, "staticArray")) @@ -15421,7 +16156,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ClassWithContainerTypes( metaclass=jsii.JSIIMeta, -@@ -938,10 +1086,15 @@ +@@ -953,10 +1101,15 @@ :param obj: - :param array_prop: :param obj_prop: @@ -15437,7 +16172,7 @@ exports[`Generated code for "jsii-calc": /python/src/js ) jsii.create(self.__class__, self, [array, record, obj, props]) -@@ -991,17 +1144,23 @@ +@@ -1006,17 +1159,23 @@ ): def __init__(self, int: builtins.str) -> None: ''' @@ -15461,7 +16196,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="int") def int(self) -> builtins.str: -@@ -1020,10 +1179,13 @@ +@@ -1035,10 +1194,13 @@ def mutable_object(self) -> "IMutableObjectLiteral": return typing.cast("IMutableObjectLiteral", jsii.get(self, "mutableObject")) @@ -15475,7 +16210,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ClassWithNestedUnion( metaclass=jsii.JSIIMeta, -@@ -1034,10 +1196,13 @@ +@@ -1049,10 +1211,13 @@ union_property: typing.Sequence[typing.Union[typing.Mapping[builtins.str, typing.Union[typing.Union["StructA", typing.Dict[builtins.str, typing.Any]], typing.Union["StructB", typing.Dict[builtins.str, typing.Any]]]], typing.Sequence[typing.Union[typing.Union["StructA", typing.Dict[builtins.str, typing.Any]], typing.Union["StructB", typing.Dict[builtins.str, typing.Any]]]]]], ) -> None: ''' @@ -15489,7 +16224,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="unionProperty") def union_property( -@@ -1048,10 +1213,13 @@ +@@ -1063,10 +1228,13 @@ @union_property.setter def union_property( self, @@ -15503,7 +16238,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ConfusingToJackson( metaclass=jsii.JSIIMeta, -@@ -1082,10 +1250,13 @@ +@@ -1097,10 +1265,13 @@ @union_property.setter def union_property( self, @@ -15517,7 +16252,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.ConfusingToJacksonStruct", -@@ -1099,10 +1270,13 @@ +@@ -1114,10 +1285,13 @@ union_property: typing.Optional[typing.Union[_scope_jsii_calc_lib_c61f082f.IFriendly, typing.Sequence[typing.Union[_scope_jsii_calc_lib_c61f082f.IFriendly, "AbstractClass"]]]] = None, ) -> None: ''' @@ -15531,7 +16266,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["union_property"] = union_property @builtins.property -@@ -1130,10 +1304,13 @@ +@@ -1145,10 +1319,13 @@ ): def __init__(self, consumer: "PartiallyInitializedThisConsumer") -> None: ''' @@ -15545,7 +16280,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class Constructors(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Constructors"): def __init__(self) -> None: -@@ -1181,10 +1358,13 @@ +@@ -1196,10 +1373,13 @@ ): def __init__(self, delegate: "IStructReturningDelegate") -> None: ''' @@ -15559,7 +16294,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="workItBaby") def work_it_baby(self) -> "StructB": return typing.cast("StructB", jsii.invoke(self, "workItBaby", [])) -@@ -1213,10 +1393,13 @@ +@@ -1228,10 +1408,13 @@ Returns whether the bell was rung. @@ -15573,7 +16308,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="staticImplementedByPrivateClass") @builtins.classmethod def static_implemented_by_private_class( -@@ -1227,10 +1410,13 @@ +@@ -1242,10 +1425,13 @@ Return whether the bell was rung. @@ -15587,7 +16322,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="staticImplementedByPublicClass") @builtins.classmethod def static_implemented_by_public_class(cls, ringer: "IBellRinger") -> builtins.bool: -@@ -1238,10 +1424,13 @@ +@@ -1253,10 +1439,13 @@ Return whether the bell was rung. @@ -15601,7 +16336,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="staticWhenTypedAsClass") @builtins.classmethod def static_when_typed_as_class(cls, ringer: "IConcreteBellRinger") -> builtins.bool: -@@ -1249,50 +1438,65 @@ +@@ -1264,50 +1453,65 @@ Return whether the bell was rung. @@ -15667,7 +16402,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ConsumersOfThisCrazyTypeSystem( metaclass=jsii.JSIIMeta, -@@ -1307,20 +1511,26 @@ +@@ -1322,20 +1526,26 @@ obj: "IAnotherPublicInterface", ) -> builtins.str: ''' @@ -15694,7 +16429,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.ContainerProps", -@@ -1342,10 +1552,15 @@ +@@ -1357,10 +1567,15 @@ ''' :param array_prop: :param obj_prop: @@ -15710,7 +16445,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "obj_prop": obj_prop, "record_prop": record_prop, } -@@ -1411,17 +1626,23 @@ +@@ -1426,17 +1641,23 @@ data: typing.Mapping[builtins.str, typing.Any], ) -> builtins.str: ''' @@ -15734,7 +16469,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class Default(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Default"): '''A class named "Default". -@@ -1450,10 +1671,15 @@ +@@ -1465,10 +1686,15 @@ ''' :param arg1: - :param arg2: - @@ -15750,7 +16485,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="arg1") def arg1(self) -> jsii.Number: -@@ -1511,10 +1737,14 @@ +@@ -1526,10 +1752,14 @@ :deprecated: this constructor is "just" okay @@ -15765,7 +16500,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -1544,10 +1774,13 @@ +@@ -1559,10 +1789,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -15779,7 +16514,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.DeprecatedEnum") class DeprecatedEnum(enum.Enum): -@@ -1583,10 +1816,13 @@ +@@ -1598,10 +1831,13 @@ :deprecated: it just wraps a string @@ -15793,7 +16528,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -1651,10 +1887,21 @@ +@@ -1666,10 +1902,21 @@ :param non_primitive: An example of a non primitive property. :param another_optional: This is optional. :param optional_any: @@ -15815,7 +16550,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "astring": astring, "another_required": another_required, "bool": bool, -@@ -1775,10 +2022,16 @@ +@@ -1790,10 +2037,16 @@ :param hoisted_top: :param left: :param right: @@ -15832,7 +16567,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["hoisted_top"] = hoisted_top if left is not None: self._values["left"] = left -@@ -1836,10 +2089,13 @@ +@@ -1851,10 +2104,13 @@ class DiamondInheritanceBaseLevelStruct: def __init__(self, *, base_level_property: builtins.str) -> None: ''' @@ -15846,7 +16581,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -1877,10 +2133,14 @@ +@@ -1892,10 +2148,14 @@ ) -> None: ''' :param base_level_property: @@ -15861,7 +16596,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "first_mid_level_property": first_mid_level_property, } -@@ -1925,10 +2185,14 @@ +@@ -1940,10 +2200,14 @@ ) -> None: ''' :param base_level_property: @@ -15876,7 +16611,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "second_mid_level_property": second_mid_level_property, } -@@ -1984,10 +2248,16 @@ +@@ -1999,10 +2263,16 @@ :param base_level_property: :param first_mid_level_property: :param second_mid_level_property: @@ -15893,7 +16628,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "first_mid_level_property": first_mid_level_property, "second_mid_level_property": second_mid_level_property, "top_level_property": top_level_property, -@@ -2067,10 +2337,13 @@ +@@ -2082,10 +2352,13 @@ @jsii.member(jsii_name="changePrivatePropertyValue") def change_private_property_value(self, new_value: builtins.str) -> None: ''' @@ -15907,7 +16642,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="privateMethodValue") def private_method_value(self) -> builtins.str: return typing.cast(builtins.str, jsii.invoke(self, "privateMethodValue", [])) -@@ -2099,10 +2372,15 @@ +@@ -2114,10 +2387,15 @@ ''' :param _required_any: - :param _optional_any: - @@ -15923,7 +16658,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class DocumentedClass(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.DocumentedClass"): '''Here's the first line of the TSDoc comment. -@@ -2174,10 +2452,14 @@ +@@ -2189,10 +2467,14 @@ ) -> builtins.str: ''' :param optional: - @@ -15938,7 +16673,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.DontUseMe", -@@ -2190,10 +2472,13 @@ +@@ -2205,10 +2487,13 @@ Don't use this interface An interface that shouldn't be used, with the annotation in a weird place. @@ -15952,7 +16687,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["dont_set_me"] = dont_set_me @builtins.property -@@ -2227,10 +2512,13 @@ +@@ -2242,10 +2527,13 @@ class DummyObj: def __init__(self, *, example: builtins.str) -> None: ''' @@ -15966,7 +16701,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -2259,28 +2547,37 @@ +@@ -2274,28 +2562,37 @@ def __init__(self, value_store: builtins.str) -> None: ''' @@ -16004,7 +16739,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class DynamicPropertyBearerChild( DynamicPropertyBearer, -@@ -2289,20 +2586,26 @@ +@@ -2304,20 +2601,26 @@ ): def __init__(self, original_value: builtins.str) -> None: ''' @@ -16031,7 +16766,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="originalValue") def original_value(self) -> builtins.str: -@@ -2315,10 +2618,13 @@ +@@ -2330,10 +2633,13 @@ def __init__(self, clock: "IWallClock") -> None: '''Creates a new instance of Entropy. @@ -16045,7 +16780,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="increase") def increase(self) -> builtins.str: '''Increases entropy by consuming time from the clock (yes, this is a long shot, please don't judge). -@@ -2346,10 +2652,13 @@ +@@ -2361,10 +2667,13 @@ :param word: the value to return. @@ -16059,7 +16794,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, Entropy).__jsii_proxy_class__ = lambda : _EntropyProxy -@@ -2386,10 +2695,14 @@ +@@ -2401,10 +2710,14 @@ are being erased when sending values from native code to JS. :param opts: - @@ -16074,7 +16809,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="prop1IsNull") @builtins.classmethod def prop1_is_null(cls) -> typing.Mapping[builtins.str, typing.Any]: -@@ -2417,10 +2730,14 @@ +@@ -2432,10 +2745,14 @@ ) -> None: ''' :param option1: @@ -16089,7 +16824,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["option1"] = option1 if option2 is not None: self._values["option2"] = option2 -@@ -2464,10 +2781,14 @@ +@@ -2479,10 +2796,14 @@ :param readonly_string: - :param mutable_number: - @@ -16104,7 +16839,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -2491,10 +2812,13 @@ +@@ -2506,10 +2827,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -16118,7 +16853,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.ExperimentalEnum") class ExperimentalEnum(enum.Enum): -@@ -2522,10 +2846,13 @@ +@@ -2537,10 +2861,13 @@ ''' :param readonly_property: @@ -16132,7 +16867,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -2555,10 +2882,13 @@ +@@ -2570,10 +2897,13 @@ ): def __init__(self, success: builtins.bool) -> None: ''' @@ -16146,7 +16881,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="success") def success(self) -> builtins.bool: -@@ -2574,10 +2904,14 @@ +@@ -2589,10 +2919,14 @@ def __init__(self, *, boom: builtins.bool, prop: builtins.str) -> None: ''' :param boom: @@ -16161,7 +16896,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "prop": prop, } -@@ -2619,10 +2953,14 @@ +@@ -2634,10 +2968,14 @@ :param readonly_string: - :param mutable_number: - @@ -16176,7 +16911,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -2646,10 +2984,13 @@ +@@ -2661,10 +2999,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -16190,7 +16925,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.ExternalEnum") class ExternalEnum(enum.Enum): -@@ -2677,10 +3018,13 @@ +@@ -2692,10 +3033,13 @@ ''' :param readonly_property: @@ -16204,7 +16939,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -2823,10 +3167,13 @@ +@@ -2838,10 +3182,13 @@ def __init__(self, *, name: typing.Optional[builtins.str] = None) -> None: '''These are some arguments you can pass to a method. @@ -16218,7 +16953,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["name"] = name @builtins.property -@@ -2863,10 +3210,13 @@ +@@ -2878,10 +3225,13 @@ friendly: _scope_jsii_calc_lib_c61f082f.IFriendly, ) -> builtins.str: ''' @@ -16232,7 +16967,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.interface(jsii_type="jsii-calc.IAnonymousImplementationProvider") class IAnonymousImplementationProvider(typing_extensions.Protocol): -@@ -2946,10 +3296,13 @@ +@@ -2961,10 +3311,13 @@ def a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "a")) @@ -16246,7 +16981,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IAnotherPublicInterface).__jsii_proxy_class__ = lambda : _IAnotherPublicInterfaceProxy -@@ -2992,10 +3345,13 @@ +@@ -3007,10 +3360,13 @@ @jsii.member(jsii_name="yourTurn") def your_turn(self, bell: IBell) -> None: ''' @@ -16260,7 +16995,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IBellRinger).__jsii_proxy_class__ = lambda : _IBellRingerProxy -@@ -3020,10 +3376,13 @@ +@@ -3035,10 +3391,13 @@ @jsii.member(jsii_name="yourTurn") def your_turn(self, bell: "Bell") -> None: ''' @@ -16274,7 +17009,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IConcreteBellRinger).__jsii_proxy_class__ = lambda : _IConcreteBellRingerProxy -@@ -3079,10 +3438,13 @@ +@@ -3094,10 +3453,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -16288,7 +17023,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -3137,10 +3499,13 @@ +@@ -3152,10 +3514,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -16302,7 +17037,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -3182,10 +3547,13 @@ +@@ -3197,10 +3562,13 @@ def private(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "private")) @@ -16316,7 +17051,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IExtendsPrivateInterface).__jsii_proxy_class__ = lambda : _IExtendsPrivateInterfaceProxy -@@ -3231,10 +3599,13 @@ +@@ -3246,10 +3614,13 @@ ''' return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -16330,7 +17065,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: ''' -@@ -3416,10 +3787,14 @@ +@@ -3431,10 +3802,14 @@ ) -> None: ''' :param arg1: - @@ -16345,7 +17080,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithOptionalMethodArguments).__jsii_proxy_class__ = lambda : _IInterfaceWithOptionalMethodArgumentsProxy -@@ -3454,10 +3829,13 @@ +@@ -3469,10 +3844,13 @@ def read_write_string(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "readWriteString")) @@ -16359,7 +17094,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithProperties).__jsii_proxy_class__ = lambda : _IInterfaceWithPropertiesProxy -@@ -3487,10 +3865,13 @@ +@@ -3502,10 +3880,13 @@ def foo(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.get(self, "foo")) @@ -16373,7 +17108,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithPropertiesExtension).__jsii_proxy_class__ = lambda : _IInterfaceWithPropertiesExtensionProxy -@@ -4010,10 +4391,13 @@ +@@ -4025,10 +4406,13 @@ def value(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "value")) @@ -16387,7 +17122,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IMutableObjectLiteral).__jsii_proxy_class__ = lambda : _IMutableObjectLiteralProxy -@@ -4049,19 +4433,25 @@ +@@ -4064,19 +4448,25 @@ def b(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "b")) @@ -16413,7 +17148,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, INonInternalInterface).__jsii_proxy_class__ = lambda : _INonInternalInterfaceProxy -@@ -4094,10 +4484,13 @@ +@@ -4109,10 +4499,13 @@ def property(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "property")) @@ -16427,7 +17162,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="wasSet") def was_set(self) -> builtins.bool: return typing.cast(builtins.bool, jsii.invoke(self, "wasSet", [])) -@@ -4290,10 +4683,13 @@ +@@ -4305,10 +4698,13 @@ def mutable_property(self) -> typing.Optional[jsii.Number]: return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -16441,7 +17176,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: return typing.cast(None, jsii.invoke(self, "method", [])) -@@ -4360,10 +4756,13 @@ +@@ -4375,10 +4771,13 @@ def prop(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "prop")) @@ -16455,7 +17190,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class Implementation(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Implementation"): def __init__(self) -> None: -@@ -4409,10 +4808,13 @@ +@@ -4424,10 +4823,13 @@ def private(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "private")) @@ -16469,7 +17204,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.ImplictBaseOfBase", -@@ -4430,10 +4832,15 @@ +@@ -4445,10 +4847,15 @@ ''' :param foo: - :param bar: - @@ -16485,7 +17220,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "bar": bar, "goo": goo, } -@@ -4508,10 +4915,13 @@ +@@ -4523,10 +4930,13 @@ count: jsii.Number, ) -> typing.List[_scope_jsii_calc_lib_c61f082f.IDoublable]: ''' @@ -16499,7 +17234,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class Isomorphism(metaclass=jsii.JSIIAbstractClass, jsii_type="jsii-calc.Isomorphism"): '''Checks the "same instance" isomorphism is preserved within the constructor. -@@ -4616,19 +5026,25 @@ +@@ -4631,19 +5041,25 @@ def prop_a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "propA")) @@ -16525,7 +17260,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class JavaReservedWords( metaclass=jsii.JSIIMeta, -@@ -4850,10 +5266,13 @@ +@@ -4865,10 +5281,13 @@ def while_(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "while")) @@ -16539,7 +17274,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.implements(IJsii487External2, IJsii487External) class Jsii487Derived(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Jsii487Derived"): -@@ -4955,10 +5374,13 @@ +@@ -4970,10 +5389,13 @@ @builtins.classmethod def stringify(cls, value: typing.Any = None) -> typing.Optional[builtins.str]: ''' @@ -16553,7 +17288,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class LevelOne(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.LevelOne"): '''Validates that nested classes get correct code generation for the occasional forward reference.''' -@@ -4988,10 +5410,13 @@ +@@ -5003,10 +5425,13 @@ class PropBooleanValue: def __init__(self, *, value: builtins.bool) -> None: ''' @@ -16567,7 +17302,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -5025,10 +5450,13 @@ +@@ -5040,10 +5465,13 @@ ''' :param prop: ''' @@ -16581,7 +17316,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -5063,10 +5491,13 @@ +@@ -5078,10 +5506,13 @@ ''' :param prop: ''' @@ -16595,7 +17330,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -5114,10 +5545,17 @@ +@@ -5129,10 +5560,17 @@ :param cpu: The number of cpu units used by the task. Valid values, which determines your range of valid values for the memory parameter: 256 (.25 vCPU) - Available memory values: 0.5GB, 1GB, 2GB 512 (.5 vCPU) - Available memory values: 1GB, 2GB, 3GB, 4GB 1024 (1 vCPU) - Available memory values: 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB 2048 (2 vCPU) - Available memory values: Between 4GB and 16GB in 1GB increments 4096 (4 vCPU) - Available memory values: Between 8GB and 30GB in 1GB increments This default is set in the underlying FargateTaskDefinition construct. Default: 256 :param memory_mib: The amount (in MiB) of memory used by the task. This field is required and you must use one of the following values, which determines your range of valid values for the cpu parameter: 0.5GB, 1GB, 2GB - Available cpu values: 256 (.25 vCPU) 1GB, 2GB, 3GB, 4GB - Available cpu values: 512 (.5 vCPU) 2GB, 3GB, 4GB, 5GB, 6GB, 7GB, 8GB - Available cpu values: 1024 (1 vCPU) Between 4GB and 16GB in 1GB increments - Available cpu values: 2048 (2 vCPU) Between 8GB and 30GB in 1GB increments - Available cpu values: 4096 (4 vCPU) This default is set in the underlying FargateTaskDefinition construct. Default: 512 :param public_load_balancer: Determines whether the Application Load Balancer will be internet-facing. Default: true @@ -16613,7 +17348,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["container_port"] = container_port if cpu is not None: self._values["cpu"] = cpu -@@ -5244,10 +5682,14 @@ +@@ -5259,10 +5697,14 @@ '''Creates a BinaryOperation. :param lhs: Left-hand side operand. @@ -16628,7 +17363,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="farewell") def farewell(self) -> builtins.str: '''Say farewell.''' -@@ -5295,10 +5737,13 @@ +@@ -5310,10 +5752,13 @@ class NestedStruct: def __init__(self, *, number_prop: jsii.Number) -> None: ''' @@ -16642,7 +17377,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -5369,17 +5814,24 @@ +@@ -5384,17 +5829,24 @@ def __init__(self, _param1: builtins.str, optional: typing.Any = None) -> None: ''' :param _param1: - @@ -16667,7 +17402,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="giveMeUndefinedInsideAnObject") def give_me_undefined_inside_an_object( self, -@@ -5407,10 +5859,13 @@ +@@ -5422,10 +5874,13 @@ def change_me_to_undefined(self) -> typing.Optional[builtins.str]: return typing.cast(typing.Optional[builtins.str], jsii.get(self, "changeMeToUndefined")) @@ -16681,7 +17416,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.NullShouldBeTreatedAsUndefinedData", -@@ -5429,10 +5884,14 @@ +@@ -5444,10 +5899,14 @@ ) -> None: ''' :param array_with_three_elements_and_undefined_as_second_argument: @@ -16696,7 +17431,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if this_should_be_undefined is not None: self._values["this_should_be_undefined"] = this_should_be_undefined -@@ -5467,17 +5926,23 @@ +@@ -5482,17 +5941,23 @@ def __init__(self, generator: IRandomNumberGenerator) -> None: ''' @@ -16720,7 +17455,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="nextTimes100") def next_times100(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.invoke(self, "nextTimes100", [])) -@@ -5487,10 +5952,13 @@ +@@ -5502,10 +5967,13 @@ def generator(self) -> IRandomNumberGenerator: return typing.cast(IRandomNumberGenerator, jsii.get(self, "generator")) @@ -16734,7 +17469,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ObjectRefsInCollections( metaclass=jsii.JSIIMeta, -@@ -5508,10 +5976,13 @@ +@@ -5523,10 +5991,13 @@ ) -> jsii.Number: '''Returns the sum of all values. @@ -16748,7 +17483,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="sumFromMap") def sum_from_map( self, -@@ -5519,10 +5990,13 @@ +@@ -5534,10 +6005,13 @@ ) -> jsii.Number: '''Returns the sum of all values in a map. @@ -16762,7 +17497,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ObjectWithPropertyProvider( metaclass=jsii.JSIIMeta, -@@ -5563,10 +6037,13 @@ +@@ -5578,10 +6052,13 @@ ): def __init__(self, delegate: IInterfaceWithOptionalMethodArguments) -> None: ''' @@ -16776,7 +17511,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="invokeWithOptional") def invoke_with_optional(self) -> None: return typing.cast(None, jsii.invoke(self, "invokeWithOptional", [])) -@@ -5589,10 +6066,15 @@ +@@ -5604,10 +6081,15 @@ ''' :param arg1: - :param arg2: - @@ -16792,7 +17527,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="arg1") def arg1(self) -> jsii.Number: -@@ -5617,10 +6099,13 @@ +@@ -5632,10 +6114,13 @@ class OptionalStruct: def __init__(self, *, field: typing.Optional[builtins.str] = None) -> None: ''' @@ -16806,7 +17541,7 @@ exports[`Generated code for "jsii-calc": /python/src/js self._values["field"] = field @builtins.property -@@ -5696,10 +6181,13 @@ +@@ -5711,10 +6196,13 @@ def _override_read_write(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "overrideReadWrite")) @@ -16820,7 +17555,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class OverrideReturnsObject( metaclass=jsii.JSIIMeta, -@@ -5711,10 +6199,13 @@ +@@ -5726,10 +6214,13 @@ @jsii.member(jsii_name="test") def test(self, obj: IReturnsNumber) -> jsii.Number: ''' @@ -16834,7 +17569,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ParamShadowsBuiltins( metaclass=jsii.JSIIMeta, -@@ -5736,10 +6227,14 @@ +@@ -5751,10 +6242,14 @@ :param str: should be set to something that is NOT a valid expression in Python (e.g: "\${NOPE}""). :param boolean_property: :param string_property: @@ -16849,7 +17584,7 @@ exports[`Generated code for "jsii-calc": /python/src/js string_property=string_property, struct_property=struct_property, ) -@@ -5769,10 +6264,15 @@ +@@ -5784,10 +6279,15 @@ :param string_property: :param struct_property: ''' @@ -16865,7 +17600,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "string_property": string_property, "struct_property": struct_property, } -@@ -5825,10 +6325,13 @@ +@@ -5840,10 +6340,13 @@ scope: _scope_jsii_calc_lib_c61f082f.Number, ) -> _scope_jsii_calc_lib_c61f082f.Number: ''' @@ -16879,7 +17614,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.ParentStruct982", -@@ -5839,10 +6342,13 @@ +@@ -5854,10 +6357,13 @@ def __init__(self, *, foo: builtins.str) -> None: '''https://github.com/aws/jsii/issues/982. @@ -16893,7 +17628,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -5897,10 +6403,15 @@ +@@ -5912,10 +6418,15 @@ ''' :param obj: - :param dt: - @@ -16909,7 +17644,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, PartiallyInitializedThisConsumer).__jsii_proxy_class__ = lambda : _PartiallyInitializedThisConsumerProxy -@@ -5915,10 +6426,13 @@ +@@ -5930,10 +6441,13 @@ friendly: _scope_jsii_calc_lib_c61f082f.IFriendly, ) -> builtins.str: ''' @@ -16923,7 +17658,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class Power( _CompositeOperation_1c4d123b, -@@ -5935,10 +6449,14 @@ +@@ -5950,10 +6464,14 @@ '''Creates a Power operation. :param base: The base of the power. @@ -16938,7 +17673,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="base") def base(self) -> _scope_jsii_calc_lib_c61f082f.NumericValue: -@@ -6161,10 +6679,13 @@ +@@ -6176,10 +6694,13 @@ value: _scope_jsii_calc_lib_c61f082f.EnumFromScopedModule, ) -> None: ''' @@ -16952,7 +17687,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="foo") def foo( -@@ -6175,10 +6696,13 @@ +@@ -6190,10 +6711,13 @@ @foo.setter def foo( self, @@ -16966,7 +17701,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class ReturnsPrivateImplementationOfInterface( metaclass=jsii.JSIIMeta, -@@ -6220,10 +6744,14 @@ +@@ -6235,10 +6759,14 @@ :param string_prop: May not be empty. :param nested_struct: ''' @@ -16981,7 +17716,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if nested_struct is not None: self._values["nested_struct"] = nested_struct -@@ -6290,17 +6818,25 @@ +@@ -6305,17 +6833,25 @@ ''' :param arg1: - :param arg2: - @@ -17007,7 +17742,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="methodWithOptionalArguments") def method_with_optional_arguments( self, -@@ -6312,10 +6848,15 @@ +@@ -6327,10 +6863,15 @@ :param arg1: - :param arg2: - @@ -17023,7 +17758,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.SecondLevelStruct", -@@ -6334,10 +6875,14 @@ +@@ -6349,10 +6890,14 @@ ) -> None: ''' :param deeper_required_prop: It's long and required. @@ -17038,7 +17773,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if deeper_optional_prop is not None: self._values["deeper_optional_prop"] = deeper_optional_prop -@@ -6399,10 +6944,13 @@ +@@ -6414,10 +6959,13 @@ @jsii.member(jsii_name="isSingletonInt") def is_singleton_int(self, value: jsii.Number) -> builtins.bool: ''' @@ -17052,7 +17787,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.SingletonIntEnum") class SingletonIntEnum(enum.Enum): -@@ -6421,10 +6969,13 @@ +@@ -6436,10 +6984,13 @@ @jsii.member(jsii_name="isSingletonString") def is_singleton_string(self, value: builtins.str) -> builtins.bool: ''' @@ -17066,7 +17801,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.SingletonStringEnum") class SingletonStringEnum(enum.Enum): -@@ -6448,10 +6999,14 @@ +@@ -6463,10 +7014,14 @@ ) -> None: ''' :param property: @@ -17081,7 +17816,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "yet_anoter_one": yet_anoter_one, } -@@ -6502,10 +7057,14 @@ +@@ -6517,10 +7072,14 @@ ) -> None: ''' :param readonly_string: - @@ -17096,7 +17831,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="method") def method(self) -> None: return typing.cast(None, jsii.invoke(self, "method", [])) -@@ -6520,10 +7079,13 @@ +@@ -6535,10 +7094,13 @@ def mutable_property(self) -> typing.Optional[jsii.Number]: return typing.cast(typing.Optional[jsii.Number], jsii.get(self, "mutableProperty")) @@ -17110,7 +17845,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum(jsii_type="jsii-calc.StableEnum") class StableEnum(enum.Enum): -@@ -6539,10 +7101,13 @@ +@@ -6554,10 +7116,13 @@ class StableStruct: def __init__(self, *, readonly_property: builtins.str) -> None: ''' @@ -17124,7 +17859,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -6579,10 +7144,13 @@ +@@ -6594,10 +7159,13 @@ def static_variable(cls) -> builtins.bool: # pyright: ignore [reportGeneralTypeIssues,reportRedeclaration] return typing.cast(builtins.bool, jsii.sget(cls, "staticVariable")) @@ -17138,7 +17873,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class StaticHelloParent( metaclass=jsii.JSIIMeta, -@@ -6612,19 +7180,25 @@ +@@ -6627,19 +7195,25 @@ class Statics(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.Statics"): def __init__(self, value: builtins.str) -> None: ''' @@ -17164,7 +17899,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="justMethod") def just_method(self) -> builtins.str: return typing.cast(builtins.str, jsii.invoke(self, "justMethod", [])) -@@ -6661,19 +7235,25 @@ +@@ -6676,19 +7250,25 @@ ''' return typing.cast("Statics", jsii.sget(cls, "instance")) @@ -17190,7 +17925,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="value") def value(self) -> builtins.str: -@@ -6696,10 +7276,13 @@ +@@ -6711,10 +7291,13 @@ def you_see_me(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "youSeeMe")) @@ -17204,7 +17939,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.StructA", -@@ -6722,10 +7305,15 @@ +@@ -6737,10 +7320,15 @@ :param required_string: :param optional_number: @@ -17220,7 +17955,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if optional_number is not None: self._values["optional_number"] = optional_number -@@ -6783,10 +7371,15 @@ +@@ -6798,10 +7386,15 @@ :param optional_boolean: :param optional_struct_a: ''' @@ -17236,7 +17971,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if optional_boolean is not None: self._values["optional_boolean"] = optional_boolean -@@ -6838,10 +7431,14 @@ +@@ -6853,10 +7446,14 @@ See: https://github.com/aws/aws-cdk/issues/4302 :param scope: @@ -17251,7 +17986,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if props is not None: self._values["props"] = props -@@ -6884,10 +7481,14 @@ +@@ -6899,10 +7496,14 @@ ) -> jsii.Number: ''' :param _positional: - @@ -17266,7 +18001,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="roundTrip") @builtins.classmethod def round_trip( -@@ -6902,10 +7503,13 @@ +@@ -6917,10 +7518,13 @@ :param _positional: - :param required: This is a required field. :param second_level: A union to really stress test our serialization. @@ -17280,7 +18015,7 @@ exports[`Generated code for "jsii-calc": /python/src/js ) return typing.cast("TopLevelStruct", jsii.sinvoke(cls, "roundTrip", [_positional, input])) -@@ -6922,10 +7526,13 @@ +@@ -6937,10 +7541,13 @@ struct: typing.Union[typing.Union[StructA, typing.Dict[builtins.str, typing.Any]], typing.Union[StructB, typing.Dict[builtins.str, typing.Any]]], ) -> builtins.bool: ''' @@ -17294,7 +18029,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="isStructB") @builtins.classmethod def is_struct_b( -@@ -6933,18 +7540,24 @@ +@@ -6948,18 +7555,24 @@ struct: typing.Union[typing.Union[StructA, typing.Dict[builtins.str, typing.Any]], typing.Union[StructB, typing.Dict[builtins.str, typing.Any]]], ) -> builtins.bool: ''' @@ -17319,7 +18054,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.StructWithCollectionOfUnionts", -@@ -6958,10 +7571,13 @@ +@@ -6973,10 +7586,13 @@ union_property: typing.Sequence[typing.Mapping[builtins.str, typing.Union[typing.Union[StructA, typing.Dict[builtins.str, typing.Any]], typing.Union[StructB, typing.Dict[builtins.str, typing.Any]]]]], ) -> None: ''' @@ -17333,7 +18068,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -6998,10 +7614,14 @@ +@@ -7013,10 +7629,14 @@ ) -> None: ''' :param foo: An enum value. @@ -17348,7 +18083,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if bar is not None: self._values["bar"] = bar -@@ -7057,10 +7677,16 @@ +@@ -7072,10 +7692,16 @@ :param default: :param assert_: :param result: @@ -17365,7 +18100,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if assert_ is not None: self._values["assert_"] = assert_ -@@ -7130,10 +7756,13 @@ +@@ -7145,10 +7771,13 @@ @parts.setter def parts( self, @@ -17379,7 +18114,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.SupportsNiceJavaBuilderProps", -@@ -7149,10 +7778,14 @@ +@@ -7164,10 +7793,14 @@ ) -> None: ''' :param bar: Some number, like 42. @@ -17394,7 +18129,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if id is not None: self._values["id"] = id -@@ -7201,10 +7834,13 @@ +@@ -7216,10 +7849,13 @@ ''' :param id_: some identifier of your choice. :param bar: Some number, like 42. @@ -17408,7 +18143,7 @@ exports[`Generated code for "jsii-calc": /python/src/js jsii.create(self.__class__, self, [id_, props]) @builtins.property -@@ -7242,17 +7878,23 @@ +@@ -7257,17 +7893,23 @@ @jsii.member(jsii_name="modifyOtherProperty") def modify_other_property(self, value: builtins.str) -> None: ''' @@ -17432,7 +18167,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="readA") def read_a(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.invoke(self, "readA", [])) -@@ -7272,17 +7914,23 @@ +@@ -7287,17 +7929,23 @@ @jsii.member(jsii_name="virtualMethod") def virtual_method(self, n: jsii.Number) -> jsii.Number: ''' @@ -17456,7 +18191,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="readonlyProperty") def readonly_property(self) -> builtins.str: -@@ -7293,46 +7941,61 @@ +@@ -7308,46 +7956,61 @@ def a(self) -> jsii.Number: return typing.cast(jsii.Number, jsii.get(self, "a")) @@ -17518,7 +18253,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class TestStructWithEnum( metaclass=jsii.JSIIMeta, -@@ -7415,10 +8078,15 @@ +@@ -7430,10 +8093,15 @@ ''' :param required: This is a required field. :param second_level: A union to really stress test our serialization. @@ -17534,7 +18269,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "second_level": second_level, } if optional is not None: -@@ -7509,10 +8177,13 @@ +@@ -7524,10 +8192,13 @@ def __init__(self, operand: _scope_jsii_calc_lib_c61f082f.NumericValue) -> None: ''' @@ -17548,7 +18283,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="operand") def operand(self) -> _scope_jsii_calc_lib_c61f082f.NumericValue: -@@ -7543,10 +8214,14 @@ +@@ -7558,10 +8229,14 @@ ) -> None: ''' :param bar: @@ -17563,7 +18298,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if foo is not None: self._values["foo"] = foo -@@ -7583,10 +8258,13 @@ +@@ -7598,10 +8273,13 @@ def __init__(self, delegate: typing.Mapping[builtins.str, typing.Any]) -> None: ''' @@ -17577,7 +18312,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.python.classproperty @jsii.member(jsii_name="reflector") def REFLECTOR(cls) -> _scope_jsii_calc_lib_custom_submodule_name_c61f082f.Reflector: -@@ -7629,10 +8307,13 @@ +@@ -7644,10 +8322,13 @@ ): def __init__(self, obj: IInterfaceWithProperties) -> None: ''' @@ -17591,7 +18326,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="justRead") def just_read(self) -> builtins.str: return typing.cast(builtins.str, jsii.invoke(self, "justRead", [])) -@@ -7643,17 +8324,23 @@ +@@ -7658,17 +8339,23 @@ ext: IInterfaceWithPropertiesExtension, ) -> builtins.str: ''' @@ -17615,7 +18350,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="obj") def obj(self) -> IInterfaceWithProperties: -@@ -7663,25 +8350,34 @@ +@@ -7678,25 +8365,34 @@ class VariadicInvoker(metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.VariadicInvoker"): def __init__(self, method: "VariadicMethod") -> None: ''' @@ -17650,7 +18385,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="asArray") def as_array( self, -@@ -7690,10 +8386,14 @@ +@@ -7705,10 +8401,14 @@ ) -> typing.List[jsii.Number]: ''' :param first: the first element of the array to be returned (after the \`\`prefix\`\` provided at construction time). @@ -17665,7 +18400,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class VariadicTypeUnion( metaclass=jsii.JSIIMeta, -@@ -7701,19 +8401,25 @@ +@@ -7716,19 +8416,25 @@ ): def __init__(self, *union: typing.Union[StructA, StructB]) -> None: ''' @@ -17691,7 +18426,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class VirtualMethodPlayground( metaclass=jsii.JSIIMeta, -@@ -7725,38 +8431,53 @@ +@@ -7740,38 +8446,53 @@ @jsii.member(jsii_name="overrideMeAsync") def override_me_async(self, index: jsii.Number) -> jsii.Number: ''' @@ -17745,7 +18480,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class VoidCallback( metaclass=jsii.JSIIAbstractClass, -@@ -7818,10 +8539,13 @@ +@@ -7833,10 +8554,13 @@ ''' return typing.cast(typing.Optional[builtins.str], jsii.get(self, "dontReadMe")) @@ -17759,7 +18494,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class WithPrivatePropertyInConstructor( metaclass=jsii.JSIIMeta, -@@ -7831,10 +8555,13 @@ +@@ -7846,10 +8570,13 @@ def __init__(self, private_field: typing.Optional[builtins.str] = None) -> None: ''' @@ -17773,7 +18508,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="success") def success(self) -> builtins.bool: -@@ -7875,10 +8602,13 @@ +@@ -7890,10 +8617,13 @@ @jsii.member(jsii_name="abstractMethod") def abstract_method(self, name: builtins.str) -> builtins.str: ''' @@ -17787,7 +18522,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, AbstractClass).__jsii_proxy_class__ = lambda : _AbstractClassProxy -@@ -7894,10 +8624,14 @@ +@@ -7909,10 +8639,14 @@ '''Creates a BinaryOperation. :param lhs: Left-hand side operand. @@ -17802,7 +18537,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="toString") def to_string(self) -> builtins.str: '''String representation of the value.''' -@@ -7941,10 +8675,13 @@ +@@ -7956,10 +8690,13 @@ def rung(self) -> builtins.bool: return typing.cast(builtins.bool, jsii.get(self, "rung")) @@ -17816,7 +18551,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.ChildStruct982", -@@ -7955,10 +8692,14 @@ +@@ -7970,10 +8707,14 @@ def __init__(self, *, foo: builtins.str, bar: jsii.Number) -> None: ''' :param foo: @@ -17831,7 +18566,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "bar": bar, } -@@ -7999,37 +8740,49 @@ +@@ -8014,37 +8755,49 @@ def a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "a")) @@ -17881,7 +18616,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.implements(INonInternalInterface) class ClassThatImplementsThePrivateInterface( -@@ -8044,37 +8797,49 @@ +@@ -8059,37 +8812,49 @@ def a(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "a")) @@ -17931,7 +18666,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.implements(IInterfaceWithProperties) class ClassWithPrivateConstructorAndAutomaticProperties( -@@ -8092,10 +8857,14 @@ +@@ -8107,10 +8872,14 @@ ) -> "ClassWithPrivateConstructorAndAutomaticProperties": ''' :param read_only_string: - @@ -17946,7 +18681,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="readOnlyString") def read_only_string(self) -> builtins.str: -@@ -8106,10 +8875,13 @@ +@@ -8121,10 +8890,13 @@ def read_write_string(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "readWriteString")) @@ -17960,7 +18695,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.implements(IIndirectlyImplemented) class FullCombo(BaseClass, metaclass=jsii.JSIIMeta, jsii_type="jsii-calc.FullCombo"): -@@ -8224,10 +8996,13 @@ +@@ -8239,10 +9011,13 @@ ): def __init__(self, property: builtins.str) -> None: ''' @@ -17974,7 +18709,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="bar") def bar(self) -> None: return typing.cast(None, jsii.invoke(self, "bar", [])) -@@ -8248,10 +9023,13 @@ +@@ -8263,10 +9038,13 @@ def __init__(self, operand: _scope_jsii_calc_lib_c61f082f.NumericValue) -> None: ''' @@ -17988,7 +18723,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="farewell") def farewell(self) -> builtins.str: '''Say farewell.''' -@@ -8311,10 +9089,16 @@ +@@ -8326,10 +9104,16 @@ :param id: some identifier. :param default_bar: the default value of \`\`bar\`\`. :param props: some props once can provide. @@ -18005,7 +18740,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="id") def id(self) -> jsii.Number: -@@ -8613,5 +9397,1544 @@ +@@ -8628,5 +9412,1544 @@ from . import nodirect from . import onlystatic from . import python_self @@ -19555,7 +20290,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/anonymous/__init__.py.diff 1`] = ` --- python/src/jsii_calc/anonymous/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/anonymous/__init__.py --runtime-type-checking -@@ -57,31 +57,58 @@ +@@ -72,31 +72,58 @@ @builtins.classmethod def consume(cls, option: typing.Union[IOptionA, IOptionB]) -> builtins.str: ''' @@ -19619,7 +20354,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk16625/__init__.py.diff 1`] = ` --- python/src/jsii_calc/cdk16625/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/cdk16625/__init__.py --runtime-type-checking -@@ -45,10 +45,13 @@ +@@ -60,10 +60,13 @@ def _unwrap(self, gen: _IRandomNumberGenerator_9643a8b9) -> jsii.Number: '''Implement this functin to return \`\`gen.next()\`\`. It is extremely important that the \`\`donotimport\`\` submodule is NEVER explicitly loaded in the testing application (otherwise this test is void). @@ -19633,7 +20368,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the abstract class typing.cast(typing.Any, Cdk16625).__jsii_proxy_class__ = lambda : _Cdk16625Proxy -@@ -60,5 +63,11 @@ +@@ -75,5 +78,11 @@ publication.publish() @@ -19650,7 +20385,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk16625/donotimport/__init__.py.diff 1`] = ` --- python/src/jsii_calc/cdk16625/donotimport/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/cdk16625/donotimport/__init__.py --runtime-type-checking -@@ -34,10 +34,13 @@ +@@ -49,10 +49,13 @@ def __init__(self, value: jsii.Number) -> None: ''' @@ -19664,7 +20399,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="next") def next(self) -> jsii.Number: '''Not quite random, but it'll do. -@@ -50,5 +53,11 @@ +@@ -65,5 +68,11 @@ __all__ = [ "UnimportedSubmoduleType", ] @@ -19681,7 +20416,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/cdk22369/__init__.py.diff 1`] = ` --- python/src/jsii_calc/cdk22369/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/cdk22369/__init__.py --runtime-type-checking -@@ -34,10 +34,13 @@ +@@ -49,10 +49,13 @@ class AcceptsPathProps: def __init__(self, *, source_path: builtins.str) -> None: ''' @@ -19695,7 +20430,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -63,5 +66,12 @@ +@@ -78,5 +81,12 @@ "AcceptsPath", "AcceptsPathProps", ] @@ -19713,7 +20448,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/composition/__init__.py.diff 1`] = ` --- python/src/jsii_calc/composition/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/composition/__init__.py --runtime-type-checking -@@ -55,30 +55,39 @@ +@@ -70,30 +70,39 @@ '''A set of postfixes to include in a decorated .toString().''' return typing.cast(typing.List[builtins.str], jsii.get(self, "decorationPostfixes")) @@ -19753,7 +20488,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.enum( jsii_type="jsii-calc.composition.CompositeOperation.CompositionStringStyle" ) -@@ -111,5 +120,23 @@ +@@ -126,5 +135,23 @@ __all__ = [ "CompositeOperation", ] @@ -19782,7 +20517,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/derived_class_has_no_properties/__init__.py.diff 1`] = ` --- python/src/jsii_calc/derived_class_has_no_properties/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/derived_class_has_no_properties/__init__.py --runtime-type-checking -@@ -28,10 +28,13 @@ +@@ -43,10 +43,13 @@ def prop(self) -> builtins.str: return typing.cast(builtins.str, jsii.get(self, "prop")) @@ -19796,7 +20531,7 @@ exports[`Generated code for "jsii-calc": /python/src/js class Derived( Base, -@@ -46,5 +49,11 @@ +@@ -61,5 +64,11 @@ "Base", "Derived", ] @@ -19813,7 +20548,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/homonymous_forward_references/bar/__init__.py.diff 1`] = ` --- python/src/jsii_calc/homonymous_forward_references/bar/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/homonymous_forward_references/bar/__init__.py --runtime-type-checking -@@ -49,10 +49,13 @@ +@@ -64,10 +64,13 @@ ''' :param homonymous: ''' @@ -19827,7 +20562,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -81,10 +84,13 @@ +@@ -96,10 +99,13 @@ class Homonymous: def __init__(self, *, numeric_property: jsii.Number) -> None: ''' @@ -19841,7 +20576,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -110,5 +116,19 @@ +@@ -125,5 +131,19 @@ "ConsumerProps", "Homonymous", ] @@ -19866,7 +20601,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/homonymous_forward_references/foo/__init__.py.diff 1`] = ` --- python/src/jsii_calc/homonymous_forward_references/foo/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/homonymous_forward_references/foo/__init__.py --runtime-type-checking -@@ -49,10 +49,13 @@ +@@ -64,10 +64,13 @@ ''' :param homonymous: ''' @@ -19880,7 +20615,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -81,10 +84,13 @@ +@@ -96,10 +99,13 @@ class Homonymous: def __init__(self, *, string_property: builtins.str) -> None: ''' @@ -19894,7 +20629,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -110,5 +116,19 @@ +@@ -125,5 +131,19 @@ "ConsumerProps", "Homonymous", ] @@ -19919,7 +20654,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py.diff 1`] = ` --- python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/interface_in_namespace_includes_classes/__init__.py --runtime-type-checking -@@ -28,10 +28,13 @@ +@@ -43,10 +43,13 @@ def bar(self) -> typing.Optional[builtins.str]: return typing.cast(typing.Optional[builtins.str], jsii.get(self, "bar")) @@ -19933,7 +20668,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.data_type( jsii_type="jsii-calc.InterfaceInNamespaceIncludesClasses.Hello", -@@ -41,10 +44,13 @@ +@@ -56,10 +59,13 @@ class Hello: def __init__(self, *, foo: jsii.Number) -> None: ''' @@ -19947,7 +20682,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -69,5 +75,18 @@ +@@ -84,5 +90,18 @@ "Foo", "Hello", ] @@ -19971,7 +20706,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py.diff 1`] = ` --- python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/interface_in_namespace_only_interface/__init__.py --runtime-type-checking -@@ -24,10 +24,13 @@ +@@ -39,10 +39,13 @@ class Hello: def __init__(self, *, foo: jsii.Number) -> None: ''' @@ -19985,7 +20720,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -51,5 +54,12 @@ +@@ -66,5 +69,12 @@ __all__ = [ "Hello", ] @@ -20003,7 +20738,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/jsii3656/__init__.py.diff 1`] = ` --- python/src/jsii_calc/jsii3656/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/jsii3656/__init__.py --runtime-type-checking -@@ -30,10 +30,14 @@ +@@ -45,10 +45,14 @@ ) -> None: ''' :param name: @@ -20018,7 +20753,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if count is not None: self._values["count"] = count -@@ -72,10 +76,13 @@ +@@ -87,10 +91,13 @@ @builtins.classmethod def call_abstract(cls, receiver: "OverrideMe") -> builtins.bool: ''' @@ -20032,7 +20767,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="implementMe") @abc.abstractmethod def implement_me( -@@ -115,5 +122,19 @@ +@@ -130,5 +137,19 @@ "ImplementMeOpts", "OverrideMe", ] @@ -20057,7 +20792,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2530/__init__.py.diff 1`] = ` --- python/src/jsii_calc/module2530/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/module2530/__init__.py --runtime-type-checking -@@ -24,28 +24,55 @@ +@@ -39,28 +39,55 @@ def __init__(self, _: jsii.Number) -> None: ''' @@ -20118,7 +20853,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2647/__init__.py.diff 1`] = ` --- python/src/jsii_calc/module2647/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/module2647/__init__.py --runtime-type-checking -@@ -34,10 +34,13 @@ +@@ -49,10 +49,13 @@ ''' :param very: - @@ -20132,7 +20867,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.member(jsii_name="hello") def hello(self) -> builtins.str: '''Say hello!''' -@@ -51,5 +54,11 @@ +@@ -66,5 +69,11 @@ __all__ = [ "ExtendAndImplement", ] @@ -20149,7 +20884,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2689/methods/__init__.py.diff 1`] = ` --- python/src/jsii_calc/module2689/methods/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/module2689/methods/__init__.py --runtime-type-checking -@@ -32,23 +32,41 @@ +@@ -47,23 +47,41 @@ _bar: typing.Mapping[builtins.str, typing.Union[_scope_jsii_calc_base_734f0262.BaseProps, typing.Dict[builtins.str, typing.Any]]], ) -> None: ''' @@ -20196,7 +20931,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2689/structs/__init__.py.diff 1`] = ` --- python/src/jsii_calc/module2689/structs/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/module2689/structs/__init__.py --runtime-type-checking -@@ -33,10 +33,14 @@ +@@ -48,10 +48,14 @@ ) -> None: ''' :param base_map: @@ -20211,7 +20946,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "numbers": numbers, } -@@ -69,5 +73,13 @@ +@@ -84,5 +88,13 @@ __all__ = [ "MyStruct", ] @@ -20230,7 +20965,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2692/submodule1/__init__.py.diff 1`] = ` --- python/src/jsii_calc/module2692/submodule1/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/module2692/submodule1/__init__.py --runtime-type-checking -@@ -24,10 +24,13 @@ +@@ -39,10 +39,13 @@ class Bar: def __init__(self, *, bar1: builtins.str) -> None: ''' @@ -20244,7 +20979,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -51,5 +54,12 @@ +@@ -66,5 +69,12 @@ __all__ = [ "Bar", ] @@ -20262,7 +20997,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/module2692/submodule2/__init__.py.diff 1`] = ` --- python/src/jsii_calc/module2692/submodule2/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/module2692/submodule2/__init__.py --runtime-type-checking -@@ -26,10 +26,13 @@ +@@ -41,10 +41,13 @@ class Bar: def __init__(self, *, bar2: builtins.str) -> None: ''' @@ -20276,7 +21011,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -66,10 +69,15 @@ +@@ -81,10 +84,15 @@ ''' :param bar2: :param bar1: @@ -20292,7 +21027,7 @@ exports[`Generated code for "jsii-calc": /python/src/js "bar1": bar1, "foo2": foo2, } -@@ -108,5 +116,21 @@ +@@ -123,5 +131,21 @@ "Bar", "Foo", ] @@ -20319,7 +21054,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/python_self/__init__.py.diff 1`] = ` --- python/src/jsii_calc/python_self/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/python_self/__init__.py --runtime-type-checking -@@ -22,17 +22,23 @@ +@@ -37,17 +37,23 @@ ): def __init__(self_, self: builtins.str) -> None: ''' @@ -20343,7 +21078,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @builtins.property @jsii.member(jsii_name="self") def self(self) -> builtins.str: -@@ -73,10 +79,13 @@ +@@ -88,10 +94,13 @@ @jsii.member(jsii_name="method") def method(self_, self: jsii.Number) -> builtins.str: ''' @@ -20357,7 +21092,7 @@ exports[`Generated code for "jsii-calc": /python/src/js # Adding a "__jsii_proxy_class__(): typing.Type" function to the interface typing.cast(typing.Any, IInterfaceWithSelf).__jsii_proxy_class__ = lambda : _IInterfaceWithSelfProxy -@@ -89,10 +98,13 @@ +@@ -104,10 +113,13 @@ class StructWithSelf: def __init__(self_, *, self: builtins.str) -> None: ''' @@ -20371,7 +21106,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -119,5 +131,30 @@ +@@ -134,5 +146,30 @@ "IInterfaceWithSelf", "StructWithSelf", ] @@ -20407,7 +21142,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/__init__.py.diff 1`] = ` --- python/src/jsii_calc/submodule/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/submodule/__init__.py --runtime-type-checking -@@ -42,10 +42,13 @@ +@@ -57,10 +57,13 @@ :param foo: @@ -20421,7 +21156,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -110,10 +113,13 @@ +@@ -125,10 +128,13 @@ def all_types(self) -> typing.Optional[_AllTypes_b08307c5]: return typing.cast(typing.Optional[_AllTypes_b08307c5], jsii.get(self, "allTypes")) @@ -20435,7 +21170,7 @@ exports[`Generated code for "jsii-calc": /python/src/js __all__ = [ "Default", -@@ -133,5 +139,18 @@ +@@ -148,5 +154,18 @@ from . import child from . import isolated from . import nested_submodule @@ -20459,7 +21194,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/back_references/__init__.py.diff 1`] = ` --- python/src/jsii_calc/submodule/back_references/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/submodule/back_references/__init__.py --runtime-type-checking -@@ -26,10 +26,13 @@ +@@ -41,10 +41,13 @@ class MyClassReference: def __init__(self, *, reference: _MyClass_a2fdc0b6) -> None: ''' @@ -20473,7 +21208,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -53,5 +56,12 @@ +@@ -68,5 +71,12 @@ __all__ = [ "MyClassReference", ] @@ -20491,7 +21226,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/child/__init__.py.diff 1`] = ` --- python/src/jsii_calc/submodule/child/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/submodule/child/__init__.py --runtime-type-checking -@@ -76,10 +76,13 @@ +@@ -91,10 +91,13 @@ class SomeStruct: def __init__(self, *, prop: SomeEnum) -> None: ''' @@ -20505,7 +21240,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -108,10 +111,13 @@ +@@ -123,10 +126,13 @@ class Structure: def __init__(self, *, bool: builtins.bool) -> None: ''' @@ -20519,7 +21254,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -146,10 +152,14 @@ +@@ -161,10 +167,14 @@ ) -> None: ''' :param prop: @@ -20534,7 +21269,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } if extra is not None: self._values["extra"] = extra -@@ -187,5 +197,27 @@ +@@ -202,5 +212,27 @@ "SomeStruct", "Structure", ] @@ -20567,7 +21302,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/submodule/param/__init__.py.diff 1`] = ` --- python/src/jsii_calc/submodule/param/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/submodule/param/__init__.py --runtime-type-checking -@@ -24,10 +24,13 @@ +@@ -39,10 +39,13 @@ class SpecialParameter: def __init__(self, *, value: builtins.str) -> None: ''' @@ -20581,7 +21316,7 @@ exports[`Generated code for "jsii-calc": /python/src/js } @builtins.property -@@ -51,5 +54,12 @@ +@@ -66,5 +69,12 @@ __all__ = [ "SpecialParameter", ] @@ -20599,7 +21334,7 @@ exports[`Generated code for "jsii-calc": /python/src/js exports[`Generated code for "jsii-calc": /python/src/jsii_calc/union/__init__.py.diff 1`] = ` --- python/src/jsii_calc/union/__init__.py --no-runtime-type-checking +++ python/src/jsii_calc/union/__init__.py --runtime-type-checking -@@ -26,10 +26,13 @@ +@@ -41,10 +41,13 @@ param: typing.Union["IResolvable", "Resolvable", _scope_jsii_calc_lib_c61f082f.IFriendly], ) -> None: ''' @@ -20613,7 +21348,7 @@ exports[`Generated code for "jsii-calc": /python/src/js @jsii.interface(jsii_type="jsii-calc.union.IResolvable") class IResolvable(typing_extensions.Protocol): -@@ -61,5 +64,11 @@ +@@ -76,5 +79,11 @@ "IResolvable", "Resolvable", ]