lpy
lpy copied to clipboard
Wrong value on evaluate region, different result when paste into python process buffer
Try this code snippet:
class Robot:
__counter = 0
def __init__(self):
type(self).__counter += 1
@classmethod
def RobotInstances(cls):
return cls, Robot.__counter
print(Robot.RobotInstances())
x = Robot()
print(x.RobotInstances())
y = Robot()
print(x.RobotInstances())
print(Robot.RobotInstances())
If the snippet is evaluated by paste into a python process buffer, the result is correct. If first select it and eval with "e", the result is wrong.