Exemple #1
0
 def __init__(self, name, retobj, args=None, optargs=None, expts=None):
     BuiltinType.__init__(self)
     BuiltinConstCallable.__init__(self,
                                   name,
                                   retobj,
                                   args=args,
                                   optargs=optargs,
                                   expts=expts)
     return
Exemple #2
0
 def __init__(self):
   BuiltinBasicType.__init__(self)
   BuiltinConstCallable.__init__(self, 'str', self.get_object(), [], [ANY])
   return
Exemple #3
0
 def __init__(self):
   from pyntch.aggregate_types import ListType
   BuiltinBasicType.__init__(self)
   BuiltinConstCallable.__init__(self, 'basestring', None)
   return
Exemple #4
0
 def call(self, frame, anchor, args, kwargs):
   if self.TYPE_NAME == 'basestring':
     frame.raise_expt(ErrorConfig.NotInstantiatable('basestring'))
     return UndefinedTypeNode.get_object()
   return BuiltinConstCallable.call(self, frame, anchor, args, kwargs)
Exemple #5
0
 def __init__(self):
     NumberType.__init__(self)
     BuiltinConstCallable.__init__(self, 'complex', self.get_object(), [],
                                   [ANY])
     return
Exemple #6
0
 def __init__(self):
   BuiltinType.__init__(self)
   # type() funciton returns itself.
   BuiltinConstCallable.__init__(self, 'type', self, [ANY])
   return
Exemple #7
0
 def __init__(self):
   BuiltinBasicType.__init__(self)
   BuiltinConstCallable.__init__(self, 'xrange', self.get_object(),
                                 [IntType], [IntType, IntType])
   return
Exemple #8
0
 def __init__(self):
     BuiltinBasicType.__init__(self)
     BuiltinConstCallable.__init__(self, 'file', self.get_object(),
                                   [StrType], [StrType, IntType],
                                   [ErrorConfig.MaybeFileCannotOpen()])
     return
Exemple #9
0
 def __init__(self):
     BuiltinBasicType.__init__(self)
     BuiltinConstCallable.__init__(self, 'object', self.get_object())
     return
Exemple #10
0
 def __init__(self):
     BuiltinBasicType.__init__(self)
     BuiltinConstCallable.__init__(self, 'unicode', self.get_object(), [],
                                   [ANY, StrType, StrType])
     return
Exemple #11
0
 def __init__(self):
     BuiltinType.__init__(self)
     # type() funciton returns itself.
     BuiltinConstCallable.__init__(self, 'type', self, [ANY])
     return
Exemple #12
0
 def __init__(self):
     BuiltinBasicType.__init__(self)
     BuiltinConstCallable.__init__(self, 'str', self.get_object(), [],
                                   [ANY])
     return
Exemple #13
0
 def __init__(self):
     from pyntch.aggregate_types import ListType
     BuiltinBasicType.__init__(self)
     BuiltinConstCallable.__init__(self, 'basestring', None)
     return
Exemple #14
0
 def call(self, frame, anchor, args, kwargs):
     if self.TYPE_NAME == 'basestring':
         frame.raise_expt(ErrorConfig.NotInstantiatable('basestring'))
         return UndefinedTypeNode.get_object()
     return BuiltinConstCallable.call(self, frame, anchor, args, kwargs)
Exemple #15
0
 def __init__(self):
   BuiltinBasicType.__init__(self)
   BuiltinConstCallable.__init__(self, 'unicode', self.get_object(), [], [ANY, StrType, StrType])
   return
Exemple #16
0
 def __init__(self):
     BuiltinBasicType.__init__(self)
     BuiltinConstCallable.__init__(self, 'xrange', self.get_object(),
                                   [IntType], [IntType, IntType])
     return
Exemple #17
0
 def __init__(self):
   BuiltinBasicType.__init__(self)
   BuiltinConstCallable.__init__(self, 'file', self.get_object(),
                                 [StrType], [StrType, IntType],
                                 [ErrorConfig.MaybeFileCannotOpen()])
   return
Exemple #18
0
 def accept_arg(self, frame, anchor, i, arg1):
     if i == 0:
         self.NumberConverter(frame, arg1)
     else:
         BuiltinConstCallable.accept_arg(self, frame, anchor, i, arg1)
     return
Exemple #19
0
 def __init__(self):
   BuiltinBasicType.__init__(self)
   BuiltinConstCallable.__init__(self, 'object', self.get_object())
   return
Exemple #20
0
 def __init__(self):
   SimpleNumberType.__init__(self)
   BuiltinConstCallable.__init__(self, 'float', self.get_object(), [], [ANY])
   return
Exemple #21
0
 def accept_arg(self, frame, anchor, i, arg1):
   if i == 0:
     self.NumberConverter(frame, arg1)
   else:
     BuiltinConstCallable.accept_arg(self, frame, anchor, i, arg1)
   return
Exemple #22
0
 def __init__(self):
   NumberType.__init__(self)
   BuiltinConstCallable.__init__(self, 'complex', self.get_object(), [], [ANY])
   return
Exemple #23
0
 def __init__(self, name, retobj, args=None, optargs=None, expts=None):
   BuiltinType.__init__(self)
   BuiltinConstCallable.__init__(self, name, retobj, args=args, optargs=optargs, expts=expts)
   return
Exemple #24
0
 def __init__(self):
     SimpleNumberType.__init__(self)
     BuiltinConstCallable.__init__(self, 'float', self.get_object(), [],
                                   [ANY])
     return