Message323020
> Teammate of mine tripped up against this because he tried to use a list.
Then, I recommend we close this. Accepting a list would have encouraged inefficient code (a tuple of constants can be peephole optimized but a list of constants is rebuilt on every call). Also, the error message is very clear, so it is unlikely he was "tripped-up" for more than a few seconds.
>>> 'hello'.startswith(['he', 'go'])
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
'hello'.startswith(['he', 'go'])
TypeError: startswith first arg must be str or a tuple of str, not list |
|
Date |
User |
Action |
Args |
2018-08-03 05:12:47 | rhettinger | set | recipients:
+ rhettinger, brett.cannon, taleinat, serhiy.storchaka |
2018-08-03 05:12:47 | rhettinger | set | messageid: <1533273167.78.0.56676864532.issue34312@psf.upfronthosting.co.za> |
2018-08-03 05:12:47 | rhettinger | link | issue34312 messages |
2018-08-03 05:12:47 | rhettinger | create | |
|