示例#1
0
 def from_row(cls, row, **markers):
     fixed = tuple(_tables.fix_row(row, **markers))
     if cls is Declaration:
         _, _, _, kind, _ = fixed
         sub = KIND_CLASSES.get(KIND(kind))
         if not sub or not issubclass(sub, Declaration):
             raise TypeError(f'unsupported kind, got {row!r}')
     else:
         sub = cls
     return sub._from_row(fixed)
示例#2
0
 def from_row(cls, row, **markers):
     row = _tables.fix_row(row, **markers)
     return cls(*row)