Open EwoutH opened 10 months ago
I've never seen someone write that
For some reason Cython is full of it: cython/cython#5828/files (don't ask me why)
There's a lot of it out there: tensorflow, protobuf, opencv, pytorch...
And it's in the CPython 2-to-3 porting guide:
+1 for this feature request. Some more examples: https://github.com/mlrun/mlrun/pull/4796/commits/b8bf28191c64559252f03e6ffd50581fda541346
pyupgrade currently does detect the
if sys.version_info < (3, 5):
syntax, it doesn't recognize the lesser but still sometimes usedif sys.version_info[0] < 3:
syntax in if or if-else blocks. It would be a nice feature if pyupgrade also could recognize and automatically replace such blocks.A few examples I encountered in the wild: