mirror of
https://github.com/correl/typesafe-monads.git
synced 2024-11-21 19:18:42 +00:00
Fix Reader.__repr__ failing when its callable lacks a __name__
This commit is contained in:
parent
319ac3cb4d
commit
cbe71da3f8
2 changed files with 2 additions and 2 deletions
|
@ -16,7 +16,7 @@ Result = TypeVar("Result")
|
|||
class Curried(Reader[A, Result]):
|
||||
def __repr__(self): # pragma: no cover
|
||||
module = self.function.__module__
|
||||
name = self.function.__name__
|
||||
name = getattr(self.function, "__name__", repr(self.function))
|
||||
signature = inspect.signature(self)
|
||||
return f"<Curried {module}.{name}{signature}>"
|
||||
|
||||
|
|
|
@ -66,7 +66,7 @@ class Reader(Monad[T], Generic[Env, T]):
|
|||
|
||||
def __repr__(self): # pragma: no cover
|
||||
module = self.function.__module__
|
||||
name = self.function.__name__
|
||||
name = getattr(self.function, "__name__", repr(self.function))
|
||||
signature = inspect.signature(self)
|
||||
return f"<Reader {module}.{name}{signature}>"
|
||||
|
||||
|
|
Loading…
Reference in a new issue