Skip to content

Commit 281c59b

Browse files
committed
Fixes style and mypy
1 parent 32226f1 commit 281c59b

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Diff for: returns/either.pyi

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ from returns.primitives.monad import Monad, NewValueType, ValueType
1010
# There's a wierd bug with mypy when we remove this line and use import:
1111
_MonadType = TypeVar('_MonadType', bound=Union['Monad', 'Either'])
1212

13-
13+
# Regular type var, works correctly:
1414
_ErrorType = TypeVar('_ErrorType')
1515

1616

@@ -88,6 +88,7 @@ class Right(Either[ValueType, Any], Monad[ValueType]):
8888
def failure(self) -> NoReturn:
8989
...
9090

91+
9192
# Useful aliases for end users:
9293

9394
Result = Either

Diff for: returns/maybe.pyi

-2
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,3 @@ class Some(Maybe[ValueType]):
8989

9090
def failure(self) -> NoReturn:
9191
...
92-
93-
reveal_type(Some(1).bind(lambda x: Success('s')).unwrap())

Diff for: returns/primitives/monad.pyi

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
from abc import ABCMeta, abstractmethod
44
from typing import Any, Generic, NoReturn, TypeVar
55

6-
ValueType = TypeVar('ValueType')
7-
NewValueType = TypeVar('NewValueType')
6+
# These type variables are widely used in our source code.
7+
ValueType = TypeVar('ValueType') # noqa: Y001
8+
NewValueType = TypeVar('NewValueType') # noqa: Y001
89

910

1011
class _BaseMonad(Generic[ValueType], metaclass=ABCMeta):

0 commit comments

Comments
 (0)