mirror of
https://github.com/opencv/opencv.git
synced 2026-10-03 04:03:30 +03:00
Merge pull request #30096 from jayzuccarelli:fix-stub-sequence-typing-import-5.x
python: typing stubs: import typing for Sequence return types (5.x) 🤖🤖🤖
This commit is contained in:
1 file changed
+10
@@ -740,6 +740,11 @@ class SequenceTypeNode(ContainerTypeNode):
|
||||
def type_format(self) -> str:
|
||||
return "_typing.Sequence[{}]"
|
||||
|
||||
@property
|
||||
def required_usage_imports(self) -> Generator[str, None, None]:
|
||||
yield "import typing as _typing"
|
||||
yield from super().required_usage_imports
|
||||
|
||||
@property
|
||||
def types_separator(self) -> str:
|
||||
return ", "
|
||||
@@ -896,6 +901,11 @@ class ClassTypeNode(ContainerTypeNode):
|
||||
def type_format(self) -> str:
|
||||
return "_typing.Type[{}]"
|
||||
|
||||
@property
|
||||
def required_usage_imports(self) -> Generator[str, None, None]:
|
||||
yield "import typing as _typing"
|
||||
yield from super().required_usage_imports
|
||||
|
||||
@property
|
||||
def types_separator(self) -> str:
|
||||
return ", "
|
||||
|
||||
Reference in new issue
Block a user