From 8eb1396b201bea3156302901ff3d874359d3a984 Mon Sep 17 00:00:00 2001 From: julianuspfeuffer Date: Tue, 21 Nov 2023 09:47:30 +0100 Subject: [PATCH] fix some typings --- autowrap/ConversionProvider.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/autowrap/ConversionProvider.py b/autowrap/ConversionProvider.py index 681e083..a9568bf 100644 --- a/autowrap/ConversionProvider.py +++ b/autowrap/ConversionProvider.py @@ -978,7 +978,7 @@ def type_check_expression(self, cpp_type, arg_var): def input_conversion( self, cpp_type: CppType, argument_var: str, arg_num: int - ) -> Tuple[Code, str, Code | str, Tuple[str, str]]: + ) -> Tuple[Code, str, Union[Code, str], Tuple[str, str]]: tt_key, tt_value = cpp_type.template_args temp_var = "v%d" % arg_num @@ -1341,7 +1341,7 @@ def type_check_expression(self, cpp_type, arg_var): def input_conversion( self, cpp_type: CppType, argument_var: str, arg_num: int - ) -> Tuple[Code, str, Code | str, Tuple[str, str]]: + ) -> Tuple[Code, str, Union[Code, str], Tuple[str, str]]: (tt,) = cpp_type.template_args temp_var = "v%d" % arg_num inner = self.converters.cython_type(tt) @@ -1781,7 +1781,7 @@ def input_conversion( topmost_code: Optional[Code] = None, bottommost_code: Optional[Code] = None, recursion_cnt: int = 0, - ) -> Tuple[Code, str, Code | str, Tuple[str, str]]: + ) -> Tuple[Code, str, Union[Code, str], Tuple[str, str]]: """Do the input conversion for a std::vector In this case, the template argument is tt (or "inner"). @@ -2250,7 +2250,7 @@ def matching_python_type_full(self, cpp_type: CppType) -> str: def input_conversion( self, cpp_type: CppType, argument_var: str, arg_num: int - ) -> Tuple[Code, str, Union[Code, str]]: + ) -> Tuple[Code, str, Union[Code, str], Tuple[str, str]]: (tt,) = cpp_type.template_args inner = self.converters.cython_type(tt) # Cython expects us to get a C++ type (we cannot just stick var.inst into the function)