3 ms·
You could use `from some_module import some_func` to get the same effect as some_func will be in the local namespace.
by fnord123 10y ago
You could use `from some_module import some_func` to get the same effect as some_func will be in the local namespace.
- Cyphase 10y agoThat's what the top-level commenter was doing.
- fnord123 10y agoOk. It wasn't clear what "importing it locally" meant. I've worked with some people who would use that phrase to mean "copy paste it into the local file".
- Cyphase 10y agoFair point :P. I think I might have seen someone mean it like that as well in the past.
- masklinn 10y agoAnd a common stdlib trick is to bind these via function arguments e.g. def foo(a, b, thing=util.thing): ...