Please review the attached patch which addresses the following ticket: * PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji builds to fail <https://fedorahosted.org/pki/ticket/1388>
On 5/26/2015 8:12 PM, Matthew Harmsen wrote:
Please review the attached patch which addresses the following ticket:
* PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji builds to fail <https://fedorahosted.org/pki/ticket/1388>
As discussed over IRC, the isinstance() probably should be used as follows: for t in NOTYPES.itervalues: if isinstance(obj, t): return ... if isinstance(hosts, dict): if isinstance(subsystems, dict): -- Endi S. Dewata
On 05/26/15 19:23, Endi Sukma Dewata wrote:
On 5/26/2015 8:12 PM, Matthew Harmsen wrote:
Please review the attached patch which addresses the following ticket:
* PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji builds to fail <https://fedorahosted.org/pki/ticket/1388>
As discussed over IRC, the isinstance() probably should be used as follows:
for t in NOTYPES.itervalues: if isinstance(obj, t): return ...
if isinstance(hosts, dict):
if isinstance(subsystems, dict):
Revised patch attached. Like the first patch, this successfully built in a mock instance on my laptop. -- Matt
On 5/26/2015 8:39 PM, Matthew Harmsen wrote:
On 05/26/15 19:23, Endi Sukma Dewata wrote:
On 5/26/2015 8:12 PM, Matthew Harmsen wrote:
Please review the attached patch which addresses the following ticket:
* PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji builds to fail <https://fedorahosted.org/pki/ticket/1388>
As discussed over IRC, the isinstance() probably should be used as follows:
for t in NOTYPES.itervalues: if isinstance(obj, t): return ...
if isinstance(hosts, dict):
if isinstance(subsystems, dict):
Revised patch attached.
Like the first patch, this successfully built in a mock instance on my laptop.
-- Matt
ACK. -- Endi S. Dewata
On Tue, May 26, 2015 at 08:42:36PM -0500, Endi Sukma Dewata wrote:
On 5/26/2015 8:39 PM, Matthew Harmsen wrote:
On 05/26/15 19:23, Endi Sukma Dewata wrote:
On 5/26/2015 8:12 PM, Matthew Harmsen wrote:
Please review the attached patch which addresses the following ticket:
* PKI TRAC Ticket #1388 - pylint unidiomatic-typecheck warnings cause koji builds to fail <https://fedorahosted.org/pki/ticket/1388>
As discussed over IRC, the isinstance() probably should be used as follows:
for t in NOTYPES.itervalues: if isinstance(obj, t): return ...
if isinstance(hosts, dict):
if isinstance(subsystems, dict):
Revised patch attached.
Like the first patch, this successfully built in a mock instance on my laptop.
-- Matt
ACK.
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
-- Endi S. Dewata
_______________________________________________ Pki-devel mailing list Pki-devel@redhat.com https://www.redhat.com/mailman/listinfo/pki-devel
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
participants (3)
-
Endi Sukma Dewata -
Fraser Tweedale -
Matthew Harmsen