Skip to content

Commit

Permalink
pytypes: Added Bool
Browse files Browse the repository at this point in the history
  • Loading branch information
erezsh committed Dec 31, 2023
1 parent b4c0519 commit a67d0f5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtype/pytypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ def validate_instance(self, obj, sampler=None):
Literal = OneOf
Type = TypeType(PythonDataType(type))

class _Bool(PythonDataType):
pass

class _Number(PythonDataType):
def __call__(self, min=None, max=None):
Expand Down Expand Up @@ -427,6 +429,7 @@ def cast_from(self, obj):


String = _String(str)
Bool = _Bool(bool)
Int = _Int(int)
Float = _Float(float)
NoneType = _NoneType()
Expand All @@ -443,6 +446,7 @@ def cast_from(self, obj):
frozenset: FrozenSet,
dict: Dict,
tuple: Tuple,
bool: Bool,
int: Int,
str: String,
float: Float,
Expand Down

0 comments on commit a67d0f5

Please sign in to comment.