is it possible to create a python object that has the following property:
class Foo:
def __default_method__(x):
return x
f = Foo()
f(10)
> 10
That is to say, an object that when instantiated allows for a method to be called without the need for an explicit method name?
Yes. It's called
__call__()
.