Here&#x27;s a quick interpretation of Python&#x27;s method:<p>Any assignment operator (compound or not) follows the same namespace rules. Scope lookups are consistent within a scope, regardless of order. Any &quot;namespaced&quot; lookup (`x[y]` and `foo.bar`) will act inside that namespace.<p>Non-namespaced identifiers will always assign into the nearest enclosing scope (a scope is always a named function) by default, since clobbering outer scopes - particularly globals - is dangerous. You can opt in to clobbering with `global` and `nonlocal`. If you don&#x27;t ever assign to a name in the current scope, lookups will be lexical (since a local lookup cannot succeed).<p>---<p>Hopefully most of these value judgements should be relatively obvious.