From 8a8e59c8fd953be15875505d775f6f656c404530 Mon Sep 17 00:00:00 2001 From: Snehasish Basu Date: Mon, 27 Jan 2025 10:52:28 +0530 Subject: [PATCH] Update predefined_types.py Updated predefined_types.py to keep changes only as suggested in https://github.com/opencv/opencv/pull/26826#pullrequestreview-2572608505 https://github.com/opencv/opencv/pull/26826#issuecomment-2613926475 --- .../src2/typing_stubs_generation/predefined_types.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/python/src2/typing_stubs_generation/predefined_types.py b/modules/python/src2/typing_stubs_generation/predefined_types.py index c5f49b5122..df2fd3cc58 100644 --- a/modules/python/src2/typing_stubs_generation/predefined_types.py +++ b/modules/python/src2/typing_stubs_generation/predefined_types.py @@ -54,8 +54,12 @@ _PREDEFINED_TYPES = ( doc="Required length is 2"), AliasTypeNode.sequence_("Size2f", PrimitiveTypeNode.float_(), doc="Required length is 2"), - AliasTypeNode.sequence_("Scalar", PrimitiveTypeNode.float_(), - doc="Required length is at most 4"), + AliasTypeNode.union_( + "Scalar", + items=(SequenceTypeNode("Scalar", PrimitiveTypeNode.float_()), + PrimitiveTypeNode.float_()), + doc="Max sequence length is at most 4" + ), AliasTypeNode.sequence_("Point", PrimitiveTypeNode.int_(), doc="Required length is 2"), AliasTypeNode.ref_("Point2i", "Point"),