Checking whether type is None

Ian Kelly ian.g.kelly at gmail.com
Fri Jul 27 09:57:18 EDT 2018


On Thu, Jul 26, 2018, 10:00 AM Stephan Houben <stephanh42 at gmail.com.invalid>
wrote:

> Op 2018-07-25, Ian Kelly schreef <ian.g.kelly at gmail.com>:
>
> > Is there a reason for using singledispatch here rather than a simpler and
> > more readable "if color is None" check?
>
> Yes, the other 20 cases I didn't show.
> And extensibility.
>

That seems like a good use of type(None), then. If it we're just for the
None check though, then it would have been disturbing.

>



More information about the Python-list mailing list