1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
- checking a value type
- validate a value for a type
- convert a value from one type to the other type
The correspondence between Python types and ``typepy`` classes are as follows:
.. table:: Supported Types
================================================ =======================================================================================================
Python Type typepy: Type Class
================================================ =======================================================================================================
``bool`` `Bool <https://typepy.rtfd.io/en/latest/pages/reference/type.html#bool-type>`__
``datetime`` `DateTime <https://typepy.rtfd.io/en/latest/pages/reference/type.html#datetime-type>`__
``dict`` `Dictionary <https://typepy.rtfd.io/en/latest/pages/reference/type.html#dictionary-type>`__
``float``/``decimal.Decimal`` (not infinity/NaN) `RealNumber <https://typepy.rtfd.io/en/latest/pages/reference/type.html#real-number-type>`__
``float``/``decimal.Decimal`` (infinity) `Infinity <https://typepy.rtfd.io/en/latest/pages/reference/type.html#infinity-type>`__
``float``/``decimal.Decimal`` (NaN) `Nan <https://typepy.rtfd.io/en/latest/pages/reference/type.html#nan-type>`__
``int`` `Integer <https://typepy.rtfd.io/en/latest/pages/reference/type.html#integer-type>`__
``list`` `List <https://typepy.rtfd.io/en/latest/pages/reference/type.html#list-type>`__
``None`` `None <https://typepy.rtfd.io/en/latest/pages/reference/type.html#none-type>`__
``str`` (not null) `String <https://typepy.rtfd.io/en/latest/pages/reference/type.html#string-type>`__
``str`` (null) `NullString <https://typepy.rtfd.io/en/latest/pages/reference/type.html#null-string-type>`__
``str`` (IP address) `IpAddress <https://typepy.rtfd.io/en/latest/pages/reference/type.html#ip-address-type>`__
================================================ =======================================================================================================
|