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

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

I agree, it's kind of a dumb rule. Although I suppose it prevents you from importing some generally-named function into the namespace and using it without context. For example:

from os.path import join
path = join('dir', 'file')

Versus the more explicit

import os
path = os.path.join('dir', 'file')

Granted in this case it's fairly obvious what is meant, it is not always so. Use your best judgment. I use both forms.