From b79e0e1c87a2f3fbe5dd3004246be5d02661d795 Mon Sep 17 00:00:00 2001 From: Josiah Wolf Oberholtzer Date: Mon, 5 Dec 2022 14:42:44 -0500 Subject: [PATCH] Extend mypy plugin (#290) --- supriya/ext/mypy.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/supriya/ext/mypy.py b/supriya/ext/mypy.py index 9d227e304..769b96520 100644 --- a/supriya/ext/mypy.py +++ b/supriya/ext/mypy.py @@ -87,12 +87,18 @@ def transform(self) -> bool: for name in ["ar", "kr", "ir", "dr", "new"]: if not decorator_arguments[name] or name in info.names: continue + return_type = api.named_type("supriya.ugens.bases.UGenMethodMixin") + if ( + decorator_arguments["is_multichannel"] + or decorator_arguments["fixed_channel_count"] + ): + return_type = api.named_type("supriya.ugens.bases.UGenArray") add_method_to_class( api=api, cls=cls, name=name, args=args, - return_type=api.named_type("supriya.ugens.bases.UGenMethodMixin"), + return_type=return_type, is_classmethod=True, ) if "__init__" not in info.names: