While converting from python 2.x -> python 3.x, I found this change in the behavior of the built-in max
function. I didn't find it documented in any of the standard locations for migration issues.
https://eev.ee/blog/2016/07/31/python-faq-how-do-i-port-to-python-3/
http://python-future.org/compatible_idioms.html
How do I fix this?
Python 2.x:
In [1]: max([None, None, None])
In [2]:
Python 3.x:
In [3]: max([None, None, None])
---------------------------------------------------------------------------
TypeError
Traceback (most recent call last) <ipython-input-3-f82c85b9875c> in <module>()
----> 1 max([None, None, None])
TypeError: '>' not supported between instances of 'NoneType' and 'NoneType'