mhajiloo / persiantools

Jalali date and datetime with other tools
MIT License
69 stars 5 forks source link

make this one better #13

Open GreatBahram opened 5 years ago

GreatBahram commented 5 years ago

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)