Closed MikeHart85 closed 7 years ago
Minor edge case. Some callables do not have a __name__ attribute.
__name__
For example:
class Foo(object): def __call__(self, x): print(x) >>> foo = Foo() >>> foo('bar') bar >>> foo.__name__ Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'Foo' object has no attribute '__name__'
This applies to partials as well.
This PR will display repr(func) when func.__name__ is not available.
repr(func)
func.__name__
Minor edge case. Some callables do not have a
__name__
attribute.For example:
This applies to partials as well.
This PR will display
repr(func)
whenfunc.__name__
is not available.