News for hackers. Stuff that matters.
Re:How the Python import system works by jnwatson on Saturday July 24, 2021 @08:35PM (#27945602)
See also https://github.com/drathier/stack-overflow-import for stupid Python import tricks.

"from stackoverflow import quick_sort will go through the search results of [python] quick sort looking for the largest code block that doesn’t syntax error in the highest voted answer from the highest voted question and return it as a module. If that answer doesn’t have any valid python code, it checks the next highest voted answer for code blocks."

I once implemented a custom importer as part of a system where the Python interpreter never touched the filesystem.

Re:How the Python import system works by neoncontrails on Saturday July 24, 2021 @10:50PM (#27946279)
That stackoverflow library is so gloriously bonkers. Is it useful in practice?
Re:How the Python import system works by jnwatson on Sunday July 25, 2021 @02:48AM (#27947291)
No. Perhaps for a hackathon.
Re:How the Python import system works by drathier on Monday July 26, 2021 @04:39AM (#27957117)
Lies!