From 9db2afb57f6fab85dd475df12b19b380792b4a89 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 12 Mar 2024 01:01:35 +0300 Subject: [PATCH 1/5] Use `/` for pos-only params --- returns/_internal/pipeline/pipe.pyi | 43 +++++++++++++++-------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/returns/_internal/pipeline/pipe.pyi b/returns/_internal/pipeline/pipe.pyi index 4cfec6e30..22917da9b 100644 --- a/returns/_internal/pipeline/pipe.pyi +++ b/returns/_internal/pipeline/pipe.pyi @@ -56,7 +56,7 @@ class _Pipe(Generic[ See docs on ``pipe`` feature in ``mypy`` plugin. """ - def __init__(self, __functions: tuple[ + def __init__(self, functions: tuple[ _PipelineStepType1, _PipelineStepType2, _PipelineStepType3, @@ -85,26 +85,27 @@ class _Pipe(Generic[ def pipe( - __function1: _PipelineStepType1, - __function2: _PipelineStepType2 = ..., - __function3: _PipelineStepType3 = ..., - __function4: _PipelineStepType4 = ..., - __function5: _PipelineStepType5 = ..., - __function6: _PipelineStepType6 = ..., - __function7: _PipelineStepType7 = ..., - __function8: _PipelineStepType8 = ..., - __function9: _PipelineStepType9 = ..., - __function10: _PipelineStepType10 = ..., - __function11: _PipelineStepType11 = ..., - __function12: _PipelineStepType12 = ..., - __function13: _PipelineStepType13 = ..., - __function14: _PipelineStepType14 = ..., - __function15: _PipelineStepType15 = ..., - __function16: _PipelineStepType16 = ..., - __function17: _PipelineStepType17 = ..., - __function18: _PipelineStepType18 = ..., - __function19: _PipelineStepType19 = ..., - __function20: _PipelineStepType20 = ..., + function1: _PipelineStepType1, + function2: _PipelineStepType2 = ..., + function3: _PipelineStepType3 = ..., + function4: _PipelineStepType4 = ..., + function5: _PipelineStepType5 = ..., + function6: _PipelineStepType6 = ..., + function7: _PipelineStepType7 = ..., + function8: _PipelineStepType8 = ..., + function9: _PipelineStepType9 = ..., + function10: _PipelineStepType10 = ..., + function11: _PipelineStepType11 = ..., + function12: _PipelineStepType12 = ..., + function13: _PipelineStepType13 = ..., + function14: _PipelineStepType14 = ..., + function15: _PipelineStepType15 = ..., + function16: _PipelineStepType16 = ..., + function17: _PipelineStepType17 = ..., + function18: _PipelineStepType18 = ..., + function19: _PipelineStepType19 = ..., + function20: _PipelineStepType20 = ..., + /, ) -> _Pipe[ _InstanceType, _ReturnType, From 529c37fa34d4661f1b12cd679751552ad1580e18 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 12 Mar 2024 01:03:30 +0300 Subject: [PATCH 2/5] Update pipe.pyi --- returns/_internal/pipeline/pipe.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/returns/_internal/pipeline/pipe.pyi b/returns/_internal/pipeline/pipe.pyi index 22917da9b..1c05595c2 100644 --- a/returns/_internal/pipeline/pipe.pyi +++ b/returns/_internal/pipeline/pipe.pyi @@ -84,7 +84,7 @@ class _Pipe(Generic[ ... -def pipe( +def pipe( # noqa: WPS451 function1: _PipelineStepType1, function2: _PipelineStepType2 = ..., function3: _PipelineStepType3 = ..., From 9ce18f5d452c3215f4efbfcca1db8ba6cec417b7 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 12 Mar 2024 01:05:03 +0300 Subject: [PATCH 3/5] Update pipe.pyi --- returns/_internal/pipeline/pipe.pyi | 47 +++++++++++++++-------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/returns/_internal/pipeline/pipe.pyi b/returns/_internal/pipeline/pipe.pyi index 1c05595c2..07aadc283 100644 --- a/returns/_internal/pipeline/pipe.pyi +++ b/returns/_internal/pipeline/pipe.pyi @@ -56,28 +56,31 @@ class _Pipe(Generic[ See docs on ``pipe`` feature in ``mypy`` plugin. """ - def __init__(self, functions: tuple[ - _PipelineStepType1, - _PipelineStepType2, - _PipelineStepType3, - _PipelineStepType4, - _PipelineStepType5, - _PipelineStepType6, - _PipelineStepType7, - _PipelineStepType8, - _PipelineStepType9, - _PipelineStepType10, - _PipelineStepType11, - _PipelineStepType12, - _PipelineStepType13, - _PipelineStepType14, - _PipelineStepType15, - _PipelineStepType16, - _PipelineStepType17, - _PipelineStepType18, - _PipelineStepType19, - _PipelineStepType20, - ]) -> None: + def __init__( # noqa: WPS451 + self, + functions: tuple[ + _PipelineStepType1, + _PipelineStepType2, + _PipelineStepType3, + _PipelineStepType4, + _PipelineStepType5, + _PipelineStepType6, + _PipelineStepType7, + _PipelineStepType8, + _PipelineStepType9, + _PipelineStepType10, + _PipelineStepType11, + _PipelineStepType12, + _PipelineStepType13, + _PipelineStepType14, + _PipelineStepType15, + _PipelineStepType16, + _PipelineStepType17, + _PipelineStepType18, + _PipelineStepType19, + _PipelineStepType20, + ], + ) -> None: ... def __call__(self, instance: _InstanceType) -> _ReturnType: From 48872e212ad1651c3bd1e0efd5998788e7e9d06c Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 12 Mar 2024 01:05:38 +0300 Subject: [PATCH 4/5] Update pipe.pyi --- returns/_internal/pipeline/pipe.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/returns/_internal/pipeline/pipe.pyi b/returns/_internal/pipeline/pipe.pyi index 07aadc283..0d9ffae72 100644 --- a/returns/_internal/pipeline/pipe.pyi +++ b/returns/_internal/pipeline/pipe.pyi @@ -80,6 +80,7 @@ class _Pipe(Generic[ _PipelineStepType19, _PipelineStepType20, ], + /, ) -> None: ... From e926567d65319a7f2b4c8430f266d54f00ea6417 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Tue, 12 Mar 2024 01:07:21 +0300 Subject: [PATCH 5/5] Update pipe.pyi --- returns/_internal/pipeline/pipe.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/returns/_internal/pipeline/pipe.pyi b/returns/_internal/pipeline/pipe.pyi index 0d9ffae72..43c313c0b 100644 --- a/returns/_internal/pipeline/pipe.pyi +++ b/returns/_internal/pipeline/pipe.pyi @@ -57,7 +57,7 @@ class _Pipe(Generic[ """ def __init__( # noqa: WPS451 - self, + self, functions: tuple[ _PipelineStepType1, _PipelineStepType2,