>>> import this
__init__
, it is probably not a class__init__
, you
probably don’t need a new classImagine what the user will type when uses your code. Then implement that.
I’m -1 on this and on any other proposed twiddlings of the main machinery. The only use case seems to be running scripts that happen to be living inside a module’s directory, which I’ve always seen as an antipattern. To make me change my mind you’d have to convince me that it isn’t.
guerrilla patch, which referred to changing code sneakily – and possibly incompatibly with other such patches – at runtime.
Pip, wheel?
Cython, SWIG, pybind11?
#pythonCython is the most general tool. It can be used to do anything from making bindings from C/Cpp to Python, Python to C/Cpp, to writing compiled “Python-like” code in an intermediate layer that can be used for managing your wrappers or just writing performant code.