[issue35897] Support list as argument to .startswith()

2022-02-18 Thread Fred
Fred added the comment: > For subtle reasons, that would make us worse off. Tuple of constants get > precomputed but lists of constants have to be rebuilt. So if a list is 20 times slower than a tuple, I can still do billions of computations in a second on a Raspberry Pi, so does it matter?

[issue35897] Support list as argument to .startswith()

2022-02-18 Thread Jakub Wilk
Change by Jakub Wilk : -- nosy: +jwilk ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Rémi Lapeyre
Rémi Lapeyre added the comment: > A programmer want to instruct the computer to do something, without having to > care about how it works. This is not true, as a programmer you need to choose carefully your data structures because they matter, for example there is a difference between doing

[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Fred .Flintstone
Fred .Flintstone added the comment: A programmer want to instruct the computer to do something, without having to care about how it works. Maybe the library could in the background convert the list to a tuple. Like: "foo".startswith(tuple(["food", "for", "fast"])) But the programmer shouldn

[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: Related discussion : issue34312 -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs

[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Raymond Hettinger
Raymond Hettinger added the comment: For subtle reasons, that would make us worse off. Tuple of constants get precomputed but lists of constants have to be rebuilt. Thank for the suggestion, but I think we should stick with the original design. -- nosy: +rhettinger resolution: -> r

[issue35897] Support list as argument to .startswith()

2019-02-05 Thread Fred .Flintstone
New submission from Fred .Flintstone : The "".startswith() method accepts a string or a tuple as a parameter. Consider adding support for list as parameter. Example: "foo".startswith(["food", "for", "fast"]) -- components: Interpreter Core messages: 334856 nosy: Fred .Flintstone prior