def updatelocals(self, **vardict):
'''Update variables in the local scope.
This is a shortcut function to inject variables in the local scope
without extensive checks (as in define()). Vardict must not contain any
entries which have been made global via addglobal() before. In order to
ensure this, updatelocals() should be called immediately after
openscope(), or with variable names, which are warrantedly not globals
(e.g variables starting with forbidden prefix)
Args:
**vardict: variable defintions.
'''
self._scope.update(vardict)
if self._locals is not None:
self._locals.update(vardict)
评论列表
文章目录