News for hackers. Stuff that matters.
Re:What Is the Switch-Case Equivalent in Python? by dmarchand90 on Saturday April 03, 2021 @04:53PM (#26684628)
I'm really worried for the long term health of python.

The philosophy of python is there should be only one pythonic way of doing things.

But more and more features are being added that give too many options with minor benefit

How is case different from the elif pattern? What does the walrus operator do that we really need.

Each one of these things on their own if fine but I'm worried together it's going to make python increasingly idiosyncratic to each developer and, consequently, harder to read.

Python's Zen beat out perl's TMTOWTDI. But python seems to try to be more and more like perl with every release: more appealing to hackers playing code golf than long term readers of the code base

Re:What Is the Switch-Case Equivalent in Python? by sullyj3 on Saturday April 03, 2021 @08:38PM (#26685997)
> How is case different from the elif pattern?

Pattern matching is often conflated with switch-case by people who are unfamiliar, because pattern matching subsumes switch-case, but they're very much not the same thing. Structural pattern matching is much more powerful than checking a series of boolean conditions. It allows you to not only check the structure of a value, but bind parts of that structure to variables. It allows you to express logic that would would otherwise be fairly complex in a straightforward and transparent way.

Re:What Is the Switch-Case Equivalent in Python? by earthboundkid on Saturday April 03, 2021 @08:52PM (#26686059)
> If the implementation is hard to explain, it's a bad idea.

> If the implementation is easy to explain, it may be a good idea.

Pattern matching is extremely complex, and for what?

Re:What Is the Switch-Case Equivalent in Python? by otabdeveloper4 on Sunday April 04, 2021 @02:57AM (#26687466)
Python already has (limited) pattern matching. Example:

    for foo, (bar, baz) in nested_tuple_list:
        ...
This works as expected. The current 3.10 implementation is just half-baked. They should have expanded the existing pattern matching facilities (added support for data structure destructuring).

Presumably then you could just have used the existing walrus operator inside the already existing if-else constructs.

That would have been the obvious path of least surprise. What we got instead seems inadequate.

Re:What Is the Switch-Case Equivalent in Python? by oblvious-earth on Monday April 05, 2021 @12:20AM (#26695322)
So you would turn something like this:

    match command.split():
        case ["north"] | ["go", "north"]:
            current_room = current_room.neighbor("north")
        case ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"]:
            ... # Code for picking up the given object
In to this:

    if (["north"] | ["go", "north"] := command.split()):
        current_room = current_room.neighbor("north")
    elif (["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"] := command.split()):
        ... # Code for picking up the given object
And the walrus operator would assign to 0-many values as required? It kind of breaks it's current meaning and makes the lines very complex, I don't think this version would be more liked...
Re:What Is the Switch-Case Equivalent in Python? by otabdeveloper4 on Monday April 05, 2021 @07:28AM (#26697660)
Yes. The second version is "pythonic" and follows the principle of least surprise.

The first version is certainly cleaner, but introduces, effectively, a new DSL sublanguage.

Re:What Is the Switch-Case Equivalent in Python? by oblvious-earth on Wednesday April 07, 2021 @08:38PM (#26733613)
The second version also effectively introduces a new DSL sub-language, it just puts a walrus operator at the end of it.

I agree the matching is complex, you only have to see what a portion of the grammar file it takes up: https://docs.python.org/3.10/reference/grammar.html

But embedding the match constructs inside existing Python symbols wouldn't reduce the amount of new grammar it would require.

Re:What Is the Switch-Case Equivalent in Python? by otabdeveloper4 on Thursday April 08, 2021 @03:40AM (#26736100)
The walrus operator is not the point; the existing constructs should be expanded, that way things make sense and are composable.

E.g., pattern matching of this sort

    for ["get", obj] | ["pick", "up", obj] | ["pick", obj, "up"] in list_of_get_commads:
        ...
IMO should have "just worked".

But now we have two different and incompatible versions of pattern matching in Python.

Re:What Is the Switch-Case Equivalent in Python? by oblvious-earth on Thursday April 08, 2021 @02:43PM (#26742251)
That's not an existing construct, it's a LHS assignment language like the match statement but it's embedded inside a for-loop.

Which means you have to implement all the grammar of the current match and it restricts to only works on iterables.

How would you implement this for an object that isn't iterable?

Re:What Is the Switch-Case Equivalent in Python? by earthboundkid on Monday April 05, 2021 @10:41AM (#26699639)
The example is misconceived to begin with? Why are you hard coding an interactive fiction game in Python? You should make an interactive fiction engine, of which there are already a million examples, and then write the script in a language made for IF, not Python.
Re:What Is the Switch-Case Equivalent in Python? by oblvious-earth on Wednesday April 07, 2021 @08:37PM (#26733597)
I took the example from the PEP itself, feel free to list out a different one.
Re:What Is the Switch-Case Equivalent in Python? by jsmeaton on Sunday April 04, 2021 @02:04AM (#26687267)
Appealing to nothing but the zen of python is not an acceptable argument.

Pattern matching is not (necessarily) extremely complex as it exists in a multitude of languages these days. Powerful does not automatically imply complex.

Re:What Is the Switch-Case Equivalent in Python? by earthboundkid on Sunday April 04, 2021 @09:53PM (#26694559)
Acceptable to whom?

Anyhow, read the PEP. It is an extremely complex new language feature.

Re:What Is the Switch-Case Equivalent in Python? by jsmeaton on Monday April 05, 2021 @06:38AM (#26697314)
To many in the core team, for one. It’s a cutesy easter egg at best not a mission statement.

I’ve read the pep. The nature of peps are complete by design. The concept is not overly complex especially since it exists in a number of other languages.

Re:What Is the Switch-Case Equivalent in Python? by brundolf on Sunday April 04, 2021 @02:13AM (#26687305)
I would say it's much more powerful than switch-case, but it's only moderately more ergonomic than elif. The reason for the former being that switch-case only ever checks exact equivalency; if you need to do anything slightly more nuanced, you have to bail out to something more flexible.
Re:What Is the Switch-Case Equivalent in Python? by G3rn0ti on Saturday April 03, 2021 @05:44PM (#26685004)
Yeah, Perl’s been there a long time ago. Initially, Perl did not have a native switch/case statement. However, early on Perlers started to obsess about emulated switch constructs and so Perl 5.10 shipped given/when which was supposed to become the language‘s official switch implementation. But it never really quite took of. While part of it was due to a subtle bug I‘d argue nobody actually needed it. 99% of the time if/elsif/else is good enough and otherwise you might want to consider a dispatch table if the number of cases is large. Beyond Perl this is true in most languages: If you find yourself in a situation to need an extensive if/else chain and to wish for C-like switch/case you’re either writing a parser or you should really rethink about your software‘s architecture (maybe in terms of OOP).
Re:What Is the Switch-Case Equivalent in Python? by coldtea on Sunday April 04, 2021 @04:11AM (#26687739)
>The philosophy of python is there should be only one pythonic way of doing things.

The philosophy of anything (python, unix, etc) is usually just cargo cult early bogus idealism.

What happens later is that reality and pragmatism come into play.

People don't want simple languages, people want more features.

Re:What Is the Switch-Case Equivalent in Python? by neolog on Saturday April 03, 2021 @05:00PM (#26684689)
The walrus operator was definitely a mistake. But type annotations, pattern matching, attrs/dataclasses, and f-strings are significant improvements.
Re:What Is the Switch-Case Equivalent in Python? by jsmeaton on Saturday April 03, 2021 @05:25PM (#26684879)
See though, this is the issue. What you see as a useful or mistaken feature is likely a different set to another user, just as we’ve seen above.

I think it’s a mistake to defer to the zen of python without considering the PEPs themselves which do discuss trade offs. (I’ll note that you didn’t make that claim but GP did).

Re:What Is the Switch-Case Equivalent in Python? by neolog on Saturday April 03, 2021 @05:31PM (#26684920)
Tbh I think a consensus of expert Pythonistas would agree with me. Walrus only got through because of the "dictatorship".
Re:What Is the Switch-Case Equivalent in Python? by jsmeaton on Saturday April 03, 2021 @05:47PM (#26685043)
Perhaps :)

That’s not a hill I’m willing to die on but I agree with the positives from your list.

And the small handful of times I’ve used walrus have been nice, but not game changing.

Re:What Is the Switch-Case Equivalent in Python? by musingsole on Saturday April 03, 2021 @05:53PM (#26685073)
Language features of this type should be nice and not game changing. It's how spoken word languages evolve. If every change was game-changing, it'd only be a few mutations until a dialect became a language in its own right. In reality, you get countless dialects frequently with features that eventually die off and new languages rarely and only in the aggregate.
Re:What Is the Switch-Case Equivalent in Python? by GeorgeTirebiter on Saturday April 03, 2021 @06:10PM (#26685185)
Seems to me the 'sweet spot' for a language is a careful balance of continuing to evolve - slowly, carefully - and to not become so large as to 'not fit into one head'. Python3.9 is not yet at the 'too big for one head'; but 3.xx could be. Perhaps old-style features need to be removed, and only available via some sort of "from __past__ import old-feature-set"
Re:What Is the Switch-Case Equivalent in Python? by musingsole on Saturday April 03, 2021 @06:30PM (#26685321)
It's hard for me to separate a language from what it is used to accomplish, and from that perspective, Python has been far too large to fit in one head for a good long time. Perhaps that is why I don't find any compulsion for language purity.
Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @02:17AM (#26687319)
> too large to fit in one head

is it? I don't think the core language is that big. The libraries are big of course.

Re:What Is the Switch-Case Equivalent in Python? by pansa2 on Sunday April 04, 2021 @03:31AM (#26687580)
An example of core language complexity: if asked, could you explain what all of these do?

https://twitter.com/raymondh/status/1280988785841278976

Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @05:44AM (#26688092)
The only one I didn't know was text_signature.
Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @02:35PM (#26691751)
I'm very curious why is this downvoted?
Re:What Is the Switch-Case Equivalent in Python? by neolog on Saturday April 03, 2021 @06:23PM (#26685277)
They could just deprecate without removing.
Re:What Is the Switch-Case Equivalent in Python? by coldtea on Sunday April 04, 2021 @04:16AM (#26687766)
>Walrus only got through because of the "dictatorship".

Well, then again I wouldn't consider anybody a more expert Pythonista than Guido.

Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @05:55AM (#26688133)
I can think of some.
Re:What Is the Switch-Case Equivalent in Python? by coldtea on Sunday April 04, 2021 @07:49AM (#26688700)
Such as?
Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @02:44PM (#26691803)
I don't want to get into that kind of argument, but if you've been in python for a while you can probably think of people.
Re:What Is the Switch-Case Equivalent in Python? by coldtea on Sunday April 04, 2021 @04:16AM (#26687760)
>The walrus operator was definitely a mistake.

Was it tho? It's one of my favorite improvements, and has no actual downside.

Re:What Is the Switch-Case Equivalent in Python? by bobbylarrybobby on Sunday April 04, 2021 @12:59AM (#26687005)
Can you explain why you don’t like the walrus operator? I personally love it.
Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @02:13AM (#26687307)
- Languages should only make special syntax for very common or very important needs. Neither applies here.

- It violates the longstanding Python rule that assignments don't escape the enclosing scope.

Re:What Is the Switch-Case Equivalent in Python? by smetj on Sunday April 04, 2021 @03:03AM (#26687483)
> It violates the longstanding Python rule that assignments don't escape the enclosing scope.

But doesn't that violate the longstanding Python rule that A Foolish Consistency is the Hobgoblin of Little Minds ?

Re:What Is the Switch-Case Equivalent in Python? by beforeolives on Sunday April 04, 2021 @04:02AM (#26687690)
The trick is tell when striving for consistensy is foolish and when it isn't. Otherwise you would always be able to fall back on this quote to justify creating unuseable code/frameworks/projects/languages.
Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @03:24AM (#26687553)
No. Assignment leaking into enclosing scope is a bad idea.
Re:What Is the Switch-Case Equivalent in Python? by bobbylarrybobby on Sunday April 04, 2021 @02:15PM (#26691612)
Don’t assignments already escape scope?

if True: x = 1 print(x)

Re:What Is the Switch-Case Equivalent in Python? by neolog on Sunday April 04, 2021 @02:34PM (#26691748)
`if` blocks don't make a scope. Comprehensions do.
Re:What Is the Switch-Case Equivalent in Python? by mixmastamyk on Sunday April 04, 2021 @03:39AM (#26687608)
The "as NAME" phrasing already existed. No need to invent a third confusing colon syntax to assign variables.
Re:What Is the Switch-Case Equivalent in Python? by at_a_remove on Saturday April 03, 2021 @06:56PM (#26685472)
Right there with you!

I get it, languages have to grow or fix mistakes. I read about Python long before I attempted to program in it and even I (not a language designer or that special) knew that their handling of division as being integer division as a default was a long-term problem that would eventually be changed one way or another. And so it was.

I absolutely agree on the walrus operator. It's too terse and while on its own it only makes two steps into one, it's not used alone, making each line of code with it that much harder to unpack.

I don't know enough about pattern matching but my feeling is that we got along without it so far ...

Re:What Is the Switch-Case Equivalent in Python? by otabdeveloper4 on Sunday April 04, 2021 @02:51AM (#26687439)
> The philosophy of python is there should be only one pythonic way of doing things.

That ship has sailed more than a decade ago.

(And if we're on a crusade to make Python pythonic again, let's start with the bigger fish - like the sync/async function distinction. Somehow Python managed to fall into the red/blue function trap the hardest.)

Re:What Is the Switch-Case Equivalent in Python? by Redoubts on Sunday April 04, 2021 @09:03AM (#26689103)
> the red/blue function trap

What should have been done here?

Re:What Is the Switch-Case Equivalent in Python? by otabdeveloper4 on Monday April 05, 2021 @07:38AM (#26697730)
Python doesn't need a special keyword to distinguish functions that 'yield' from those that don't. Why should async functions be different?
Re:What Is the Switch-Case Equivalent in Python? by staticautomatic on Sunday April 04, 2021 @12:27AM (#26686885)
I think it’s pretty wild that people are worried about the addition of a coding pattern to a language. What a thing to stress about. Nobody’s taking your Python away from you. I promise everything’s gonna be ok.
Re:What Is the Switch-Case Equivalent in Python? by _ZeD_ on Sunday April 04, 2021 @02:11AM (#26687298)
the "problem" (not for me, I personally am pretty "meh" on the feature) is that now you'll have a new pattern to read (and decode) in the others code.
Re:What Is the Switch-Case Equivalent in Python? by cbryan on Saturday April 03, 2021 @10:07PM (#26686370)
> The philosophy of python is there should be only one pythonic way of doing things.

Thiiis really hasn't been my experience with the Python community. Every place I've worked on a Python codebase has done it a different way, and none of them have agreed on what is "pythonic".

Each team has claimed that _their_ approach is the most python-y way to do it, but they've all celebrated Python as not being "restrictive" like "other" languages. It's really weird.

Re:What Is the Switch-Case Equivalent in Python? by zx14 on Sunday April 04, 2021 @06:10AM (#26688178)
> Thiiis really hasn't been my experience with the Python community. Every place I've worked on a Python codebase has done it a different way, and none of them have agreed on what is "pythonic".

Exactly my experience from day one. It's a laughable statement that the Python community keeps repeated with almost no basis in reality.

Re:What Is the Switch-Case Equivalent in Python? by dmarchand90 on Monday April 05, 2021 @01:56AM (#26695756)
Compared to C++ and Perl I find python code to be really consistent across projects. I agree the language isn't perfect at it but why do anything to make it worse?
Re:What Is the Switch-Case Equivalent in Python? by antpls on Sunday April 04, 2021 @03:00AM (#26687475)
True, because that was already a hard problem by itself. And it got even worst with the recent additions.
Re:What Is the Switch-Case Equivalent in Python? by aduitsis on Saturday April 03, 2021 @07:12PM (#26685575)
Now people are getting worried Python may become like Perl :).

With all due respect to your (otherwise perfectly valid) argument, "there's more than one way to do it" was never a real problem with people using Perl. I dare say it's fully possible to write difficult-to-read code in any language.

Perl was expressly never interested in erecting glass walls and force people this or that way. Not saying that this is good or bad. But it's the way the people who are making Perl want it.

Re:What Is the Switch-Case Equivalent in Python? by mekster on Sunday April 04, 2021 @10:10AM (#26689514)
Too bad ruby didn't take the place of python for popularity but I still see strong fan base around ruby.

Maybe people got into python when Google took it for a serious use just like people got into git because of Linus but figured it wasn't the best tool a decade later but the ecosystem is already there it is too late to swap.

Re:What Is the Switch-Case Equivalent in Python? by dragonwriter on Saturday April 03, 2021 @11:28PM (#26686674)
The Zen is not inconsistent with there being different obvious ways to do different, closely related things, and Python has always had those.

The Zen is against alternatives for the sake of alternatives, but not for facilities focussed on different use cases. Though as the use cases get more finely divided, the difference is less peeceptible.

Re:What Is the Switch-Case Equivalent in Python? by andi999 on Saturday April 03, 2021 @05:23PM (#26684865)
So what is the current one and only one pythonic way when you need a switch statement (like having a lot of cases to handle). I see two possibilities:

1.a lot of 'if'-statement 2.using a dict and the value is a function you call if the key matches

Or what else?

Re:What Is the Switch-Case Equivalent in Python? by klyrs on Saturday April 03, 2021 @06:44PM (#26685402)
There's one that's even closer to c-like switches: a list/tuple of functions or values, indexed by a small int. If you're feeling extremely cheeky, it can even handle negative cases. You'll have to implement fallthrough yourself, though.
Re:What Is the Switch-Case Equivalent in Python? by rualca on Saturday April 03, 2021 @07:49PM (#26685780)
> There's one that's even closer to c-like switches: a list/tuple of functions or values, indexed by a small int.

That sounds like a desperate plea to get stuck with a bug-riddled unmaintainable mess of a module.

If all you want to do is pick one of a finite set of possible code paths, it is never a good idea to generate a hash to pick from a map/array.

Even chained if/else if statements are cleaner than that mess.

Re:What Is the Switch-Case Equivalent in Python? by klyrs on Saturday April 03, 2021 @08:12PM (#26685888)
I've seen it used in ways that make sense. They were small and well-contained, and definitely didn't involve computing a hash.

For a not-small example, if you want to switch on an ascii character in a parser, you can make a 256-element list to implement your jump table, and index into it with ord.

If you're performance-minded enough for this to make a lick of sense, you'll take care to only build the jump table once.

And yeah, chained if/else is cleaner because it's the only tool that the language provides. The GP was asking for alternatives. They exist, but you'll hate them.

Granted, you can speed the 256-long if/elif mess up with a binary if/else tree 8 levels deep. But it probably won't beat the jump table.

If you truly find this upsetting, know that it's a practice that results from the language not supporting a switch statement.

Re:What Is the Switch-Case Equivalent in Python? by roboticmind on Saturday April 03, 2021 @06:51PM (#26685451)
I'm not sure that the second option is a very pythonic way to do it, but that's subjective of course. I'd imagine the original commenter views using a lot of ifs and elifs as the pythonic way to do it
Re:What Is the Switch-Case Equivalent in Python? by extradesgo on Saturday April 03, 2021 @06:30PM (#26685320)
I have used this dict solution before in scripts and I am not proud of it.
Re:What Is the Switch-Case Equivalent in Python? by staticautomatic on Sunday April 04, 2021 @01:39AM (#26687147)
Why not? What’s wrong with this pattern?
Re:What Is the Switch-Case Equivalent in Python? by diarrhea on Sunday April 04, 2021 @02:34AM (#26687370)
Not the parent commenter, but I use that pattern all the time, mainly to match CLI flags/args/options to an action.

Say you have a program like "docker-compose". It has multiple subcommands. Each subcommand is a dict string key and the appropriate action to take is its value, a callable. This also plays well with argparse's parser "choices" argument.

The by far biggest downside is then that all callables mustn't take arguments, or take all the same ones. You cannot dispatch to a callable and dynamically assign what arguments to call it with without losing the prior benefits. Then it gets awkward (like having to throw around args and kwargs all over the place). But up to that point, I find the pattern useful in this case.

Re:What Is the Switch-Case Equivalent in Python? by antpls on Sunday April 04, 2021 @03:13AM (#26687517)
Same. The only useful addition was type hints.

Now, every two releases they add a "language feature". Some library maintainers jump in the bandwagon, and WOOSH! : half the ecosystem depends on CPython to run. Bye Jython, Cython, PyPy, Micropython, etc and bye the code analysis and code transformation tools : all outdated until more funds or voluntary dev are willing to fix them

In an ideal world, the community should fork Python 2.7, rename it and add type hints. But that's too late, all the dev time was spent on making libraries compatible only with some recent versions of CPython

Re:What Is the Switch-Case Equivalent in Python? by coldtea on Sunday April 04, 2021 @04:13AM (#26687748)
And another person might not care at all for type hints, consider them detrimental and against the spirit of pure dynamic Python, and ask for their favorite feature (e.g. async, unicode handling, whatever) to be the "one" feature "they should have added".
Re:What Is the Switch-Case Equivalent in Python? by vram22 on Saturday April 03, 2021 @07:23PM (#26685637)
I had said this some weeks ago, in reply to a tweet by Guido:

https://mobile.twitter.com/vasudevram/status/132736428179752...

Re:What Is the Switch-Case Equivalent in Python? by DangitBobby on Sunday April 04, 2021 @12:02AM (#26686797)
My perspective on this is totally different. I don't like python because I find it to be a simple language. I like python because it's powerful, expressive, flexible, and gets out of my way while I express my intent. I quite like rust as well (for different reasons), and after using pattern matching in it, I am so excited to see it in Python. I can't think of a single change to the language that has been made that I would consider questionable, but I keep hearing complaints about them. Nothing specific to the features themselves though, the complaints are less targeted about how specifically this feature does not belong in the language as a whole, but just general noises about how peoole are worried about changes. It's quite tiresome, I must say, to have it come up in literally every discussion of Python on this forum.
Re:What Is the Switch-Case Equivalent in Python? by vram22 on Sunday April 04, 2021 @01:00PM (#26691038)
I too am getting tired of having to tell people to make sure they fully read and understood my point before replying. Just had another such incident recently. But bigger point is, there is such a trend to make fly-by comments, maybe with the aim of showing off or putting down the person to who they were replying. IOW, pretty much trolling, even if done unconsciously. Or just mental laziness.

Anyway, sick of arguing about such meta points. That is not what I come to HN for. I come for intelligent discourse via which I can learn from others' experience and share mine.

I'll just end by saying that I made specific points in that Twitter thread, such as BDD and RDD influencing the language's direction undesirably. To me, that is specific enough a complaint. A language is much more than just a bag of features. YMMV.

Re:What Is the Switch-Case Equivalent in Python? by DangitBobby on Wednesday April 07, 2021 @12:22AM (#26720574)
It seems that your comment was targeted towards me, but it failed to desribe my behavior at all, so I'm left not totally sure that it was targeted at me. If so, I don't know why you have the impression that I didn't read what you wrote (even you Twitter thread) or that I'm somehow trolling. You have no specific complaints whatsoever here or in your Twitter thread apart from complexity and implying that new steering committee are just trying to pad their resume. How are generic insults specific criticism?

How do the language features not fit? What does "influence undesirably" actually mean? What language features specifically have been added that do not fit, and how have they made the language worse or harder to read or use? That would be an interesting conversation to have.

Re:What Is the Switch-Case Equivalent in Python? by vram22 on Wednesday April 07, 2021 @03:36PM (#26729971)
You have said multiple things compactly in a couple of paragraphs in your above comment. I think at least one or two are wrong, or at the very least, misunderstandings or misinterpretations of things I said - and said in pretty clear and simple language, so it surprises me that you got them wrong. But I don't want to reply right now, because I want to check well your replies vis-a-vis my statements, see who I think is right or wrong, and why, point by point, and then give one single consolidated answer, and also want to revisit my tweets to GvR and recollect what specific background incidents I saw, motivated me to make those statements. I only half recollect right now, since it is a while. But I know there were some reasons, because even if they were my impressions, those were on the basis of facts I had observed.

But one thing I can say right now is that you are wrong on two points: it was not insults[1], and it was not directed at the steering committee.

[1] Saying that something I said is an insult, without clearly understanding it, is itself an insult - by you, to me :) Do you really think I have nothing better to do than go around insulting Python people? Wrong! Heck, I am one of them. Although not on the core team, I have done a fair amount of work in the Python ecosystem, outside of the core language, have blogged a lot about Python (with many programming example, got consulting and training work directly attributable to my blog and my published Python software - the clients said this), and have published a couple of articles about Python in sites and magazines. I've also consulted to companies on Python and trained people and orgs on it.

Those two points you were wrong on (what I said just above the footnote "[1]") are clear from my tweets themselves. So you clearly have misinterpreted, or not read the tweet thread fully. An irrefutable fact: there are at least 9 tweets in that thread, apart from GvR's original one at the top, with many by me, and two or so by Cameron Laird, another veteran Pythonista, who is much more known than me (to some people), for many more years than me, for all his work, including tons of articles, and getting a community award. Check them out, including his thanking me for "that cogent distinction":

https://mobile.twitter.com/Phaseit/status/133025441131101388...

Some of your statements clearly show you either did not read or did not grok some simple points I made in them.

For example, you repeatedly talked in both your first and second reply to me, questioning me on specifics of what language features and their overall fit I thought were wrong, although I have not said a single word in my tweets there or comments here, about any specific feature being wrong or not fitting. (I only talked about other points, like RDD and BDD, and overall language complexity, caused by steadily adding many features to the language. (Cameron later agreed on that, too, in a tweet, after I clarified a point of mine he got wrong.) And you don't get to unilaterally decide what arguments about Python are relevant. If so, I can think the same. (As in, "It's, like, just your opinion, man".) If you keep insisting on questioning me on language features and fit, when my arguments are about other issues, then you are clearly wrong, misunderstanding me, or trolling.

More complete answer after a while. in fact, I've already said many of my points above, but will add any needed others.

I know my answer here was long, but I claim Pascal's Amendment on that :) Making it more concise or better worded, needs more time, which I don't want to spend on this matter right now.

Re:What Is the Switch-Case Equivalent in Python? by diarrhea on Sunday April 04, 2021 @02:28AM (#26687356)
You don't like it because it's simple? I can somewhat relate, but imagine if everyone adopted that mindset. The world would be a complicated, toxic mess. Simplicity is beautiful!
Re:What Is the Switch-Case Equivalent in Python? by yxhuvud on Sunday April 04, 2021 @03:00AM (#26687474)
looks around

To my eyes the world does look like a complicated toxic mess. YMMV.

Re:What Is the Switch-Case Equivalent in Python? by vram22 on Sunday April 04, 2021 @06:16AM (#26688214)
Sometimes simplicity can be harder to achieve than complexity.
Re:What Is the Switch-Case Equivalent in Python? by vram22 on Sunday April 04, 2021 @12:46PM (#26690936)