[Python-ideas] Make "is" checks on non-singleton literals errors
Georg Brandl
g.brandl at gmx.net
Wed Oct 10 16:21:52 CEST 2012
More information about the Python-ideas mailing list
Wed Oct 10 16:21:52 CEST 2012
- Previous message: [Python-ideas] Make "is" checks on non-singleton literals errors
- Next message: [Python-ideas] Make "is" checks on non-singleton literals errors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Am 09.10.2012 23:10, schrieb Serhiy Storchaka: > On 09.10.12 23:15, Georg Brandl wrote: >> The point is that in 99.9...% of cases, >> >> if x == True: >> >> is just >> >> if x: > > Of cause. However in Lib/unittest/main.py I found a lot of "if x != > False:" which is not equivalent to just "if x:". It is equivalent to "if > x is None or x:" and so I left it as is. Arguably, that should be "if x is not False", but it probably doesn't matter too much. Georg
- Previous message: [Python-ideas] Make "is" checks on non-singleton literals errors
- Next message: [Python-ideas] Make "is" checks on non-singleton literals errors
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list