Our great sponsors
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
but I appreciate the fact that there is an issue about it, it's acknowledged and .. unfixable, it would now break too many things https://github.com/psf/requests/issues/2002
there was an attempt to make mypy disallow boolean tests on non-boolean, but it was removed https://github.com/python/mypy/issues/3195 . https://mypy.readthedocs.io/en/stable/error_code_list2.html#check-that-expression-is-not-implicitly-true-in-boolean-context-truthy-bool . mypy can at best check that a boolean context is used on variables that can be none, or define __bool__ or __len__ https://github.com/python/mypy/pull/13686 . Not great but that's already something. I wish requests could deprecate the __bool__ feature with some mypy annotation - it probably cannot be done.