Cameron Simpson <c...@cskk.id.au> writes:

> You have:
>
>     def _check_interval(self, interval):
>         if not type(interval) in [int, float]:
>             raise TypeError('{} is not numeric'.format(interval))
>
> This check is better written:
>
>     if not isinstance(interval, (int,float)):
>
> which handles subclasses of these types (but note that bool subclasses 
> int :-)

Done, thanks.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to