Brett Cannon added the comment:

It depends on how you want to view things as to whether you can claim there are 
two or three scopes for module-level code. While it's true that the local scope 
operates just like global scope, to Python it's more like local == global 
rather than the local scope simply doesn't exist (hence why `locals()` never 
throws an exception saying the scope doesn't exist but instead is the same as 
`globals()`).

The "three scope" phrasing also predates nested scopes from back when Python 
had its LGB scoping rules: Local-Global-Builtin. Back then we just said Python 
had three scopes and left it at that since it was basically always true and 
didn't confuse anyone.

At this point I'm fine with just removing the number from the sentence and 
saying something like "At any time during execution, there are various nested 
scopes whose namespaces are directly accessible:".

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26205>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to