Two other titles I debated between are "Why library code should always use absolute imports" and the click bait "How I broke python using two simple (innocent) lines of code" Here is the code: import logging logger = logging.getLogger(__name__) Not...
Markdown supported · ⌘↵ to post
I dont know about the clever introspection or mocking, but the strict mode, yes.
It was absolutely unintentional. I didnt know the default python string is in string.py lol.
Sean Charles
shizzleishappenin
If you really really really, ...really... dive deep down into the implementation of the Python module loading system you might get the impression this might be --intentional-- as the smart code mechanisms that allow the really clever introspection stuff to run, mock patching etc. wouldn't work methinks.
But... it should at least say something to you about using reserved names for your own stuff maybe something like a 'strict' mode or -Wall sort of thing.
Tread carefully! LMAO