コード例 #1
0
ファイル: info.py プロジェクト: MitchellTesla/Python3.1x
 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
ファイル: info.py プロジェクト: MitchellTesla/Python3.1x
 def from_row(cls, row, **markers):
     row = _tables.fix_row(row, **markers)
     return cls(*row)