Set Attribute Initial Property

When LW Python encounters a "Set Attribute" statement, LW Python will begin evaluating it by copying the statement to the "Expression." Thus, LW Python is treating "Set Attribute" statements just like any other expression. More formally,

if the following are true:
  • the line at time t = i
  • the tab at time t = j
  • statement at line i, tab j = obj.key = value
  • expression state at time t = "not_expr"

then the expression at time (t + 1) = obj.key = value

For example, if the following are true:
  • the line at time 26 = 3
  • the tab at time 26 = 2
  • statement at line 3, tab 2 = self."first_name" = first_name
  • expression state at time 26 = "not_expr"

then the expression at time (26 + 1) = self."first_name" = first_name

Try stepping through the simulator to see LW Python set the "Expression."

Code Editor
LW Python State
Current Line1Current Tab0Time0
LW Python Simulator

Comments

Please log in to add comments