As the title says, doing in-place operation (I did += and -= ) will result in “NameError: name ‘inplacevar’ is not defined”. You could try in system console, using Python language. Doing it as x = x + 1 or x = x - 1 seems to work though, but why the in-place operation results in error?
x = 1
x += 1
log(x)
will result in:
Traceback (most recent call last):
File "apps/frappe/frappe/desk/doctype/system_console/system_console.py", line 17, in run
safe_exec(self.console)
File "apps/frappe/frappe/utils/safe_exec.py", line 72, in safe_exec
exec(compile_restricted(script), exec_globals, _locals) # pylint: disable=exec-used
File "<unknown>", line 2, in <module>
NameError: name '_inplacevar_' is not defined
While this:
x = 1
x = x + 1
log(x)
result in
2
Why?