示例#1
0
 class Region(NamedTuple):
     name: str
     num_packages: int
     package_cost: float
     number_of_units: List[int] = ParseList(
         fixed_length=counts.num_services)
     latencies: List[int] = ParseList(
         fixed_length=counts.num_countries)
示例#2
0
 class Provider(NamedTuple):
     name: str
     num_regions: int
     regions: List[Region] = ParseList(
         length_parameter='num_regions')
示例#3
0
 class Doc(NamedTuple):
     num_lines: int
     lines: List[Line] = ParseList(length_parameter='num_lines')
示例#4
0
 class Line(NamedTuple):
     items: List[str] = ParseList(
         length_callable=lambda: next(length_iter))
示例#5
0
 class Line(NamedTuple):
     length: int
     items: List[str] = ParseList(length_parameter='length')
示例#6
0
 class Line(NamedTuple):
     items: List[str] = ParseList(fixed_length=3)
示例#7
0
 class Project(NamedTuple):
     penalty: int
     country: str
     units_needed: List[int] = ParseList(
         fixed_length=counts.num_services)