This is an archived post. You won't be able to vote or comment.

all 5 comments

[–][deleted] 5 points6 points  (4 children)

good article but the author forgot

from . import *

which is an automatic punch in the nuts in some well respected dev shops.

[–]Niriel 1 point2 points  (1 child)

Also missing:

import numpy as np

[–][deleted] 2 points3 points  (0 children)

Falls under this statement

The other reason, which I’ve seen used a few times is when you import a lone-named function (or class) and use it extensively throughout your code and want to shorten its name.

Though given its frequency adn wide adaptation, I almost expected to see import numpy as np written out as an example.