Menu

#331 False warning with "complex" (if/else) format string parameters

0.8.19
open
nobody
None
5
2014-02-23
2014-02-23
No

This is Debian bug #737987 (http://bugs.debian.org/737987). Here's what the bug report says:

using

foo = 'foo'
baz = 'baz'
print "%s%s" % ('bar' if foo else '', baz)

pychecker fails with

test.py:3: Format string argument count (0) doesn't match arguments (2)

It seems to fail to count the number of tuple arguments. Moving the 'if
.. else' outside of the tuple works around this.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB