Tom Ritchford
Sep 1, 2018 · 1 min read

Don’t do this — and you particularly shouldn’t be doing this in a teaching article.

PEP-8, the bible of Python style, is very clear that this is a bad idea in almost all circumstances.

Why? Because you’ve just imported an unknown but probably large number of symbols into your namespace. If you accidentally use one of them instead of the variable name you needed, you’re going to get some value, and it won’t be what you expect, and you won’t get an error at that moment.

In the example, it’s particularly lame, because you save exactly one character of typing — from sh import sh is just one character longer.

Remember, the number two motto in the Zen of Python is “Explicit is better than implicit”!

    Tom Ritchford

    Written by

    Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
    Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
    Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade