8000 Use Sequence · opencv/opencv@c2f05b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit c2f05b3

Browse files
committed
Use Sequence
1 parent 50f1098 commit c2f05b3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

modules/python/src2/gen2.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ def is_tuple(typename):
440440
return typename.startswith("tuple")
441441

442442

443-
def is_collection_type(typename):
443+
def is_sequence_type(typename):
444444
return typename.startswith("vector")
445445

446446

@@ -467,17 +467,17 @@ def convert_ctype_name_to_pytype_name(typename):
467467
pytype = CTYPE_TO_PYTYPE_MAP.get(typename)
468468
if pytype is not None:
469469
return pytype
470-
if is_collection_type(typename):
470+
if is_sequence_type(typename):
471471
if is_template_class_instantiation(typename):
472-
collection_pytype = convert_ctype_name_to_pytype_name(
472+
sequence_pytype = convert_ctype_name_to_pytype_name(
473473
get_template_instantiation_type(typename)
474474
)
475475
else:
476-
# maxsplit=1 - recursively find pytype of collection always examinating
476+
# maxsplit=1 - recursively find pytype of sequence always examinating
477477
# the outermost of inner type:
478-
# Example: vector_vector_Mat -> Collection[Collection[Mat]]
479-
collection_pytype = convert_ctype_name_to_pytype_name(typename.split("_", 1)[-1])
480-
return "Collection[{}]".format(collection_pytype)
478+
# Example: vector_vector_Mat -> Sequence[Sequence[Mat]]
479+
sequence_pytype = convert_ctype_name_to_pytype_name(typename.split("_", 1)[-1])
480+
return "Sequence[{}]".format(sequence_pytype)
481481
if is_pointer_type(typename):
482482
if typename.endswith("*"):
483483
return convert_ctype_name_to_pytype_name(typename[:-1])

0 commit comments

Comments
 (0)
0