Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1.     def load_name_op(self, arg):
  2.         """
  3.        Partial realization
  4.  
  5.        Operation description:
  6.            https://docs.python.org/3/library/dis.html#opcode-LOAD_NAME
  7.  
  8.        Operation realization:
  9.            https://github.com/python/cpython/blob/3.7/Python/ceval.c#L2057
  10.        """
  11.         if arg in self.locals:
  12.             val = self.locals[arg]
  13.         elif arg in self.globals:
  14.             val = self.globals[arg]
  15.         elif arg in self.builtins:
  16.             val = self.builtins[arg]
  17.         else:
  18.             raise NameError("name '%s' is not defined" % name)
  19.         self.push(val)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement