mirror of
https://github.com/correl/typesafe-monads.git
synced 2024-11-21 19:18:42 +00:00
Ignore coverage on unreachable code branches
These code branches should be unreachable in type-safe code.
This commit is contained in:
parent
711571d807
commit
8c18de5e6f
1 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ class Result(Monad[T], Generic[T, E]):
|
|||
elif isinstance(self, Err):
|
||||
new: Result[S, E] = Err(self.err)
|
||||
return new
|
||||
else:
|
||||
else: # pragma: no cover
|
||||
raise TypeError
|
||||
|
||||
def map(self, function: Callable[[T], S]) -> Result[S, E]:
|
||||
|
@ -31,7 +31,7 @@ class Result(Monad[T], Generic[T, E]):
|
|||
elif isinstance(self, Err):
|
||||
new: Result[S, E] = Err(self.err)
|
||||
return new
|
||||
else:
|
||||
else: # pragma: no cover
|
||||
raise TypeError
|
||||
|
||||
def apply(self, functor: Result[Callable[[T], S], E]) -> Result[S, E]:
|
||||
|
@ -40,7 +40,7 @@ class Result(Monad[T], Generic[T, E]):
|
|||
elif isinstance(functor, Err):
|
||||
new: Result[S, E] = Err(functor.err)
|
||||
return new
|
||||
else:
|
||||
else: # pragma: no cover
|
||||
raise TypeError
|
||||
|
||||
def withDefault(self, default: T) -> T:
|
||||
|
|
Loading…
Reference in a new issue