kitty.core.kassert module

This module provides various assertion functions used by kitty, not that important, but makes the life easier. Useful for making assertions that throw KittyException

kitty.core.kassert.is_in(obj, it)[source]
Parameters:
  • obj – object to assert
  • it – iterable of elements we assert obj is in
Raise:

an exception if obj is in an iterable

kitty.core.kassert.is_int(obj)[source]
Parameters:obj – object to assert
Raise:an exception if obj is not an int type
kitty.core.kassert.is_of_types(obj, the_types)[source]
Parameters:
  • obj – object to assert
  • the_types – iterable of types, or a signle type
Raise:

an exception if obj is not an instance of types

kitty.core.kassert.not_none(obj)[source]
Parameters:obj – object to assert
Raise:an exception if obj is not None