Message238637
> This will help when someone writes something like `b'abcd'[2] == b'c'`
What if someone writes line[-1] == 0 and line is a Unicode string? Should we emit a warning?
I patched locally PyUnicode_RichCompare() to emit a warning. Hum, there are *many* warnings in argparse, http.client, and many other modules. I don't think that it's a good idea. It looks common to use a string for a sentinel (ex: state = "UNKNOWN") and then store an int (ex: state = 0). So comparison need to check the type (ex: isinstance(state, str) and state == "UNKNOWN") which is verbose and annoying.
So no, we should not emit a warning :-) |
|
Date |
User |
Action |
Args |
2015-03-20 10:16:24 | vstinner | set | recipients:
+ vstinner, brett.cannon, paul.moore, Claudiu.Popa, berker.peksag, martin.panter, serhiy.storchaka |
2015-03-20 10:16:24 | vstinner | set | messageid: <1426846584.17.0.944374682295.issue23681@psf.upfronthosting.co.za> |
2015-03-20 10:16:24 | vstinner | link | issue23681 messages |
2015-03-20 10:16:23 | vstinner | create | |
|