persiantools icon indicating copy to clipboard operation
persiantools copied to clipboard

make this one better

Open GreatBahram opened this issue 5 years ago • 0 comments

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)

GreatBahram avatar May 17 '19 15:05 GreatBahram