I don't know whether it is feature or bug but if I would write something like this:
Code: Select all
label test:
renpy.dynamic('a')
return
Personally I would prefer to be able to "declare" all variables, that might be used within callable label, at once and do not care lately whether I assign them or not.
To achieve this It's possible to add simple "in" check into for loop within pop_dynamic() method:
Code: Select all
for k, v in dynamic.iteritems():
if isinstance(v, Delete):
if k in store: # check if dynamic variable was assigned
del store[k]
else:
store[k] = v
PS. Sorry for my English... It's rather difficult for me to express my thoughts. Hope you will be able to understand.