[python-win32] python-win32 Digest, Vol 116, Issue 13
Tim Roberts
timr at probo.com
Fri Nov 30 22:27:24 CET 2012
Paul_Koning at Dell.com wrote:
>
> Nit: the Pythonic recommended way of doing this is "if isinstance (item, tuple):"
>
> The difference is that this will also work if item is an instance of a subclass of "tuple" while the original code does not handle that case. For this code, that might not be an interesting scenario, but in other places it might be. It's worth getting into the habit of using "isinstance".
Well said. I have several bad Python habits that I should work on
eliminating...
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list