News for hackers. Stuff that matters.
Re:Crimes with Python's pattern matching by davesque on Tuesday August 02, 2022 @12:00AM (#32314949)
Eh, I think they're just overdramatizing things. That's also exactly what I would have expected to happen.
Re:Crimes with Python's pattern matching by atoav on Tuesday August 02, 2022 @01:34AM (#32315453)
The only thing that can sometimes bite you here is that str is iterable, if you expect a list of str and you only get a str and suddenly you iterate over the chars.

I am not sure if it wouldn't have been better to make the conversion explicit here.

Re:Crimes with Python's pattern matching by vitus on Tuesday August 02, 2022 @06:40AM (#32317063)
> The only thing that can sometimes bite you here is that str is iterable, if you expect a list of str and you only get a str and suddenly you iterate over the chars.

Python isn't even unique in this regard! You can iterate over a string whether you're working in JavaScript, C++, or Go. (And that's not even getting into cases like Haskell where String is merely syntactic sugar for [Char].)