After searching for the reason of a NameError
in my script for way too long, I realized that I mistyped =
as :
on the related assignment, i.e.:
In [1]: a: 1
In [2]: # ...
In [3]: a += 1
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
<ipython-input-3-3a23b85b51e9> in <module>()
----> 1 a += 1
NameError: name 'a' is not defined
What I find curious about this is that the syntax var: expression
neither seems to do anything nor throws an error.
This appears to work in IPython or a local console for python 3
In python 2 the syntax gives an error!
Any hints as to what happens here?