persiantools
persiantools copied to clipboard
make this one better
https://github.com/mhajiloo/persiantools/blob/a88112b5955cb8214e84467357bee61cc01242ba/persiantools/utils.py#L14-L32
isintance
takes a tuple of classes for the second argument. So you could basicly do something like this:
if not isinstance(value, (int, float)):
raise TypeError('value should int or float object')
return int(value)