This might be a dumb question, but I did some googling and digging on SO and came up short of a proper answer. So I'll just ask:
Is it possible to assign a __call__
method to a Python module or package?
What I mean is, instead of calling a method from the module/package's namespace, could I call an assigned method directly?
How it is now:
import foo
foo.bar(123)
What I want to do:
import foo
foo(123)
If this isn't possible, what would it take to monkeypatch in a feature like this? (That might be asking a lot)