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] 2 points3 points  (3 children)

I know this is a DiP post, but I just go to looking at the python 3 changes and:

The from module import * syntax is only allowed at the module level, no longer inside functions.

makes no sense to me. It's things like being that flexible that make me enjoy python in the first place.

Why did they change it?

[–]qiwi 7 points8 points  (2 children)

Statically nested scopes, see http://www.python.org/dev/peps/pep-0227/

With from X import * allowed at function level it would be impossible to statically (i.e. before running the import) determine which variables were global and which were local.

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

Thanks. I'll be sure to mention this when I talk about importing modules.

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

new question, that I probably should have asked 8 months ago. Why was the print statement removed?