def update(self, value):
key = self.name<EOL>if isinstance(key, str):<EOL><INDENT>self.env.swapkey(self.local_name, key, new_value=value)<EOL><DEDENT>self.value = value<EOL>
search order for local (i.e., @variable) variables:

scope, key_variable
[('locals', 'local_name'),
 ('globals', 'local_name'),
 ('locals', 'key'),
 ('globals', 'key')]