On 2016-07-22 16:41, D'Arcy J.M. Cain wrote:
On Fri, 22 Jul 2016 08:21:17 -0700
justin walters <walters.justi...@gmail.com> wrote:
You could also replace that line with:

    if stock is None or type(stock) != dict:

Use isinstance().  That handles classes that subclass dict as well.

If you're checking that it's a dict, there's no need to check whether it's None, because None isn't a dict either!
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to