Look for the named local variable, returning a (PyObjectPtr, scope) pair where scope is a string 'local', 'global', 'builtin' If not found, return (None, None)
(self, name)
| 1177 | return pyop_builtins.iteritems() |
| 1178 | |
| 1179 | def get_var_by_name(self, name): |
| 1180 | ''' |
| 1181 | Look for the named local variable, returning a (PyObjectPtr, scope) pair |
| 1182 | where scope is a string 'local', 'global', 'builtin' |
| 1183 | |
| 1184 | If not found, return (None, None) |
| 1185 | ''' |
| 1186 | for pyop_name, pyop_value in self.iter_locals(): |
| 1187 | if name == pyop_name.proxyval(set()): |
| 1188 | return pyop_value, 'local' |
| 1189 | for pyop_name, pyop_value in self.iter_globals(): |
| 1190 | if name == pyop_name.proxyval(set()): |
| 1191 | return pyop_value, 'global' |
| 1192 | for pyop_name, pyop_value in self.iter_builtins(): |
| 1193 | if name == pyop_name.proxyval(set()): |
| 1194 | return pyop_value, 'builtin' |
| 1195 | return None, None |
| 1196 | |
| 1197 | def filename(self): |
| 1198 | '''Get the path of the current Python source file, as a string''' |
no test coverage detected