Reputation: 71
As a little experiment I'm trying to add a builtin into python, which could be done via auto importing with a pre processor or something. I don't know, whats the best way to go around this?
**EDIT: ** Thank you @wjandrea for telling me I would have to recompile python to acomplish my 'little experiment' lol. Fixed Gramar and Made Question clearer
Upvotes: 0
Views: 79
Reputation: 33127
To add a builtin, you'd need to recompile Python.
As the Zen of Python says, "Explicit is better than implicit". So the recommended route is just to import the module/function wherever you need it. To make that simpler when writing scripts, you could add a snippet in your IDE/code editor.
Upvotes: 1