Comment

Comment by formerly_proven

> - performance hit every time the function is called

Python modules are always singletons, regardless of where they are imported. "import foo" inside a function will only import the module once (=global effect) but bind the name every time (=local, but cheap, effect).

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton