本文整理汇总了Python中parse_type.TypeBuilder.with_cardinality方法的典型用法代码示例。如果您正苦于以下问题:Python TypeBuilder.with_cardinality方法的具体用法?Python TypeBuilder.with_cardinality怎么用?Python TypeBuilder.with_cardinality使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类parse_type.TypeBuilder
的用法示例。
在下文中一共展示了TypeBuilder.with_cardinality方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_with_cardinality_many
# 需要导入模块: from parse_type import TypeBuilder [as 别名]
# 或者: from parse_type.TypeBuilder import with_cardinality [as 别名]
def test_with_cardinality_many(self):
parse_many_numbers = TypeBuilder.with_cardinality(
Cardinality.many, parse_number)
self.check_parse_number_with_many(parse_many_numbers)
示例2: test_with_cardinality_many0
# 需要导入模块: from parse_type import TypeBuilder [as 别名]
# 或者: from parse_type.TypeBuilder import with_cardinality [as 别名]
def test_with_cardinality_many0(self):
parse_many0_numbers = TypeBuilder.with_cardinality(
Cardinality.many0, parse_number)
self.check_parse_number_with_zero_or_more(parse_many0_numbers)
示例3: test_with_cardinality_optional
# 需要导入模块: from parse_type import TypeBuilder [as 别名]
# 或者: from parse_type.TypeBuilder import with_cardinality [as 别名]
def test_with_cardinality_optional(self):
parse_opt_number = TypeBuilder.with_cardinality(
Cardinality.optional, parse_number)
self.check_parse_number_with_optional(parse_opt_number)
示例4: test_with_cardinality_one_or_more
# 需要导入模块: from parse_type import TypeBuilder [as 别名]
# 或者: from parse_type.TypeBuilder import with_cardinality [as 别名]
def test_with_cardinality_one_or_more(self):
parse_many_numbers = TypeBuilder.with_cardinality(
Cardinality.one_or_more, parse_number)
self.check_parse_number_with_one_or_more(parse_many_numbers)
示例5: test_with_cardinality_zero_or_one
# 需要导入模块: from parse_type import TypeBuilder [as 别名]
# 或者: from parse_type.TypeBuilder import with_cardinality [as 别名]
def test_with_cardinality_zero_or_one(self):
parse_opt_number = TypeBuilder.with_cardinality(
Cardinality.zero_or_one, parse_number)
self.check_parse_number_with_zero_or_one(parse_opt_number)
示例6: test_with_cardinality_one
# 需要导入模块: from parse_type import TypeBuilder [as 别名]
# 或者: from parse_type.TypeBuilder import with_cardinality [as 别名]
def test_with_cardinality_one(self):
parse_number2 = TypeBuilder.with_cardinality(Cardinality.one, parse_number)
assert parse_number2 is parse_number