Python Forum

Full Version: feature request: ternary fallthroughs
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
This will not win over any advocates:
Quote:Fallthroughs make sense. they exist. you can read the docs. You're just being a hobgoblin
So far the only examples of fall-through in other languages are C or C derived languages, and there it is only used in a switch block. I grew up being told that fall-through in a switch block was something to guard against and that if you felt like you needed to use fall-through you really needed to rethink your design. As I said before, I see the fallthrough statement in go as proof that Ken Thompson agrees that fall-through was a bad idea in general and should only be used in special cases.

Now if you could site other examples where fall-through is supported, particularly where it is not used in a case statement, it may bolster your proposal. I cannot think of any such example but always like expanding my horizons. It will certainly work better than slinging insults and making vague claims.
I don't see what's the benefit of continuing this discussion. Everyone tells you that (i) you fail to present compelling case/example, (ii) there are better, more pythonic ways to do what you try to present as example, e.g. try/except block and (iii) the references you make concern switch case and does not apply to your if else example (not to mention that the core problem is the exception you will get when try to convert non-int to int).

As I already said:

(May-05-2021, 07:45 PM)buran Wrote: [ -> ]And because your thread is titled feature request - note that we are not associated with Python Software Foundation / python core development team.


Feel free to address your suggestion to PSF/core development team and see what the reaction will be.
And frankly I am tired of people coming from some other language and start to complain about some feature or try to change python to be like the language they like better. If python is not your cup of tea, just pass and continue with whatever language best serve you.
Pages: 1 2 3 4