Advertisement
Guest User

Untitled

a guest
May 22nd, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.63 KB | None | 0 0
  1. #
  2. # String object
  3. #
  4. class String(VM_Object):
  5.     def __init__(self, s=''):
  6.         str.__init__(self)
  7.         #self.prototype.constructor = self
  8.        
  9.     prototype = property(lambda self: string_prototype,
  10.             lambda self, v: None)
  11.     __proto__ = property(lambda self: func_prototype,
  12.             lambda self, v: None)
  13.  
  14.     def __newInstance__(self, *args):
  15.         return string_proto(self.__call__(None, *args))
  16.  
  17.     def __call__(self, this, *args):
  18.         if id(this) == id(self.prototype):
  19.             return self.prototype
  20.         if len(args):
  21.             return str_(args[0])
  22.         return str_("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement