Message375901
I found this bug searching after noticing weird behaviour in an error message saying sorted expects the reverse flag to be an integer, after it rejected None. This is very surprising. Why isn't it just casting the reverse parameter using bool() to discover it's truthyness?
In [1]: bool(None)
Out[1]: False
In [2]: sorted(['a','c','b'], reverse=None)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-45ce9ce13044> in <module>()
----> 1 sorted(['a','c','b'], reverse=None)
TypeError: an integer is required (got type NoneType) |
|
Date |
User |
Action |
Args |
2020-08-26 00:13:07 | lizardlizard | set | recipients:
+ lizardlizard, tim.peters, rhettinger, terry.reedy, mark.dickinson, vstinner, serhiy.storchaka, seberg, ralf.gommers, tcaswell, ammar2, Ryan May |
2020-08-26 00:13:06 | lizardlizard | set | messageid: <1598400786.85.0.4699672537.issue37980@roundup.psfhosted.org> |
2020-08-26 00:13:06 | lizardlizard | link | issue37980 messages |
2020-08-26 00:13:06 | lizardlizard | create | |
|