def getattr(self, name): if name == u'length': return Integer(len(self.string)) if name == u'utf8': return space.to_uint8array( self.string.encode('utf-8')) return Object.getattr(self, name)
def getattr(self, name): map = jit.promote(self.map) index = map.getindex(name) if index != -1: return self.storage[index] else: return Object.getattr(self, name)
def getattr(self, name): if name == u"doc": return self.doc elif name == u"loc": source, start, stop = self.source_location obj = space.Exnihilo() obj.setattr(u"source", space.String(source)) obj.setattr(u"start", space.Integer(start)) obj.setattr(u"stop", space.Integer(stop)) return obj elif name == u"spec": argc, optional, variadic, varnames, argtypes = self.spec varnames = [ space.String(name.decode('utf-8')) for name in varnames ] spec = space.Exnihilo() spec.setattr(u'argc', space.Integer(rffi.r_long(argc))) spec.setattr(u'optional', space.Integer(rffi.r_long(optional))) spec.setattr(u'is_variadic', space.boolean(variadic)) spec.setattr(u'varnames', space.List(list(varnames))) if argtypes is not None: spec.setattr(u'argtypes', space.List(list(argtypes))) else: spec.setattr(u'argtypes', space.null) return spec else: return Object.getattr(self, name)
def getattr(self, name): if name == u'start': return self.start if name == u'stop': return self.stop if name == u'step': return self.step return Object.getattr(self, name)
def getattr(self, name): if name == u"link": return self.doc if name == u"name": return self.name if name == u"parent": return self.parent return Object.getattr(self, name)
def getattr(self, index): if index == u"arity": return space.Integer(self.arity) if index == u"default": return self.default if index == u"doc": return self.doc if index == u"size": # Used for ensuring that the gc+sleep can a = len(self.multimethod_table) # bite into the weak references. return Integer(a) return Object.getattr(self, index)
def getattr(self, name): try: cell = jit.promote(self.lookup(name)) if isinstance(cell, FrozenCell): return cell.slot elif isinstance(cell, MutableCell): return cell.slot else: assert False except KeyError: return Object.getattr(self, name)
def getattr(self, index): try: return self.cells[index] except KeyError as e: try: method = self.custom_interface.methods[index] except KeyError as e: return Object.getattr(self, index) if isinstance(method, Property): return method.getter.call([self]) else: return BoundMethod(self, index, method)
def getattr(self, name): map = jit.promote(self.map) index = map.getindex(name) if index != -1: return self.storage[index] else: method = self.custom_interface.lookup_method(name) if method is None: return Object.getattr(self, name) elif isinstance(method, Property): return method.getter.call([self]) else: return BoundMethod(self, name, method)
def getattr(self, name): try: cell = jit.promote(self.lookup(name)) while isinstance(cell, ShadowCell): if cell.link is None: return cell.slot cell = cell.link if isinstance(cell, FrozenCell): return cell.slot elif isinstance(cell, MutableCell): return cell.slot else: assert False except KeyError: return Object.getattr(self, name)
def getattr(self, name): if name == u"get": return self.getter if name == u"set": return self.setter return Object.getattr(self, name)
def getattr(self, name): if name == u'length': return numbers.Integer(len(self.string)) return Object.getattr(self, name)
def getattr(self, name): if name == u'length': return Integer(len(self.data)) return Object.getattr(self, name)
def getattr(self, name): try: cell = jit.promote(self.lookup(name)) return cell.getval() except KeyError: return Object.getattr(self, name)
def getattr(self, index): if index == u"default": return self.default return Object.getattr(self, index)
def getattr(self, name): if name == u'length': return Integer(len(self.contents)) return Object.getattr(self, name)
def getattr(self, name): if name == u"doc": return self.doc else: return Object.getattr(self, name)
def getattr(self, name): if name == u"ref": return self.ref return Object.getattr(self, name)
def getattr(self, name): ref = self.ref if not isinstance(ref, CustomObject): return Object.getattr(ref, name.string) #name = space.cast(name, space.String, u"Id.getattr name").string return ref.getattr_direct(name.string)
def getattr(self, name): if name == u'length': return numbers.Integer(self.length) return Object.getattr(self, name)
def getattr(self, name): if name == u"traceback": return self.traceback return Object.getattr(self, name)