Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # String object
- #
- class String(VM_Object):
- def __init__(self, s=''):
- str.__init__(self)
- #self.prototype.constructor = self
- prototype = property(lambda self: string_prototype,
- lambda self, v: None)
- __proto__ = property(lambda self: func_prototype,
- lambda self, v: None)
- def __newInstance__(self, *args):
- return string_proto(self.__call__(None, *args))
- def __call__(self, this, *args):
- if id(this) == id(self.prototype):
- return self.prototype
- if len(args):
- return str_(args[0])
- return str_("")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement