def __init__(self):
super().__init__("bad backref")
-class namedtype(type):
- def __new__(cls, *args, typename=None, **kwargs):
- self = super().__new__(cls, *args, **kwargs)
- self.typename = typename
- return self
-
class decoder(object):
def __init__(self):
self.reftab = []
buf[key] = self.loadtagged(fp, tag)
def makeobjtype(self, nm):
- return namedtype(str(nm), (data.obj, object), {}, typename=nm)
+ return data.namedtype(str(nm), (data.obj, object), {}, typename=nm)
def loadobj(self, fp, ref=False):
if ref:
self.name = name
self.ns = ns
+class namedtype(type):
+ def __new__(cls, *args, typename=None, **kwargs):
+ self = super().__new__(cls, *args, **kwargs)
+ self.typename = typename
+ return self
+
class obj(object):
def __getitem__(self, key):
return self.__dict__[key]