This approach is a bit strange to read the first few time but has advantages in that it is easier to get right and faster to execute. The interactions between `and`, `or`, `not`, and `()` can get confusing for new coders. For example, the code line 308 does not match the comment on 307 and I believe that in this case the comment correct and the code is wrong (for values < 200) because it is missing parens. I believe that __200 <= status_code < 300__ produces the correct results in a readable (semi-)intuitive code. ``` >>> for status_code in (-1, 1, 199, 200, 201, 299, 300, 301, 1000): ... print(not status_code >= 300 or status_code < 200, ... not (status_code >= 300 or status_code < 200), ... 200 <= status_code < 300) ... True False False True False False True False False True True True True True True True True True False False False False False False False False False ```pull/183/head
parent
d06bc83495
commit
47fac5943f
Loading…
Reference in new issue