This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rth
Recipients rth
Date 2018-12-06.20:27:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1544128078.84.0.788709270274.issue35430@psf.upfronthosting.co.za>
In-reply-to
Content
Lib/argparse.py uses `is` for string comparison,

`
221:            if self.heading is not SUPPRESS and self.heading is not None:
247:        if text is not SUPPRESS and text is not None:
251:        if usage is not SUPPRESS:
256:        if action.help is not SUPPRESS:
290:                        if part and part is not SUPPRESS])
679:            if action.default is not SUPPRESS:
1130:        if self.dest is not SUPPRESS:
1766:            if action.dest is not SUPPRESS:
1768:                    if action.default is not SUPPRESS:
1851:            if argument_values is not SUPPRESS:
2026:                             if action.help is not SUPPRESS]
`

where `SUPPRESS = '==SUPPRESS=='`. Unless I'm missing something this can produce false negatives if the variable that we compare against is a slice from another string. Using equality is probably safer in any case.

Detected with LGTM.com analysis.
History
Date User Action Args
2018-12-06 20:27:58rthsetrecipients: + rth
2018-12-06 20:27:58rthsetmessageid: <1544128078.84.0.788709270274.issue35430@psf.upfronthosting.co.za>
2018-12-06 20:27:58rthlinkissue35430 messages
2018-12-06 20:27:58rthcreate