3 ms·
This would be really confusing to anyone who is used with match statements in other languages
by baby 6y ago
This would be really confusing to anyone who is used with match statements in other languages
- coldtea 6y agoFor 2 seconds until they learn what it means. If anything, it's more explicit what exactly it does. There are 100s of things in Python who would be confusing to people used to other languages, this is not one of them.
- reikonomusha 6y agoThe general tripping up of binding vs mutation vs assignment vs initialization is a pervasive Python issue. This just continues to double down on exacerbating the problem.
- hnlmorg 6y agoComparing garbage syntax to worse syntax and saying “it’s not as bad as that” isn’t the way one improves upon a language.
- coldtea 6y agoWhich is neither here, nor there. This syntax is clearly an improvemen to the PEP syntax. And parent said it's "confusing". Well, it's less confusing than the PEP syntax. Nobody compared it to not adding it at all, or was concerned with improving the language aside from the pattern matching case here.
- hnlmorg 6y agoAlmost everyone in this discussion is making exactly those comparisons. Including yourself. When you're discussing usability issues due to changes to the syntax, the perspective of non-exclusive developers vs full time Python devs doesn't change the underlying context of the discussion regarding the change in usability. And I stand by my position that defending a bad decision because of the existence of worse decisions is a really piss poor counterargument. Disclaimer: I'm a language designer myself so I know first hand how hard it is to get these things right.
- coldtea 6y ago>And I stand by my position that defending a bad decision because of the existence of worse decisions is a really piss poor counterargument. This thread was just about the two alternatives (the PEP and explicit capture), not about the PEP in general, or about defending the PEP or even saying that the better alternative is "good". We just say it's better than the PEP. Not sure how you read that into what we wrote. >Disclaimer: I'm a language designer myself so I know first hand how hard it is to get these things right. Then go make that argument in some thread in this post discussing the PEP proposal in general?
- hnlmorg 6y ago> This thread was just about the two alternatives (the PEP and explicit capture), not about the PEP in general, or about defending the PEP or even saying that the better alternative is "good". We just say it's better than the PEP. Not sure how you read that into what we wrote. Bullshit. You said, and I quote, "There are 100s of things in Python who would be confusing". That's what I was responding to. And my point stands: just because there are other pain points in Python doesn't mean we should accept more pain points into it. > Then go make that argument in some thread in this post discussing the PEP proposal in general? I’d prefer to make that argument in the thread where I was already talking you about the PEP proposal in general. ;)
- lolinder 6y agoBut the existing semantics are very confusing to anyone who is used to Python, which seems like a bigger problem.
- baby 6y agoI don't agree, I'm used to Python and this is not confusing to me because I have learned to use match statements, you will do too.