Пример #1
0
 def is_type(self, attr_type: str) -> IsType:
     if attr_type not in ATTRIBUTE_TYPES:
         raise ValueError("{} is not a valid attribute type. Must be one of {}".format(
             attr_type, ATTRIBUTE_TYPES))
     return IsType(self, Value(attr_type))
Пример #2
0
 def is_type(self, attr_type):
     if attr_type not in SHORT_ATTR_TYPES:
         raise ValueError(
             "{0} is not a valid attribute type. Must be one of {1}".format(
                 attr_type, SHORT_ATTR_TYPES))
     return IsType(self, Value(attr_type))
Пример #3
0
 def is_type(self, attr_type: str) -> IsType:
     if attr_type not in ATTRIBUTE_TYPES:
         raise ValueError(
             f"{attr_type} is not a valid attribute type. Must be one of {ATTRIBUTE_TYPES}"
         )
     return IsType(self, Value(attr_type))