[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Pki-devel] Fix for pylint issue



On 5/26/2015 10:14 PM, Fraser Tweedale wrote:
For the sake of completeness (by no means something that needs to be
changed now that the patch was merged), ``isinstance`` supports
disjunctive "tuple of types" argument.  Instead of:

     for t in NOTYPES.itervalues():
         if isinstance(obj, t):
             return ...

You can say:

     if isinstance(obj, tuple(NOTYPES.viewvalues())):
         return ...

Cheers,
Fraser

Good to know. I think we can check it in to 10.2.5 (or 10.2.4 in case we have to rebuild, doesn't matter to me).

--
Endi S. Dewata


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]