Do you ever `import` inside a function?

There’s also more more parts to lexical scopes than just function definitions. E.g. you could do an import outside of a module definition and it would affect the whole file, you could have an import within an anonymous function and it would only apply to that function, …

Personally like people before I’d also argue having a single function do an import can be perfectly fine.

2 Likes