You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Python 3.10, when released in 2021, introduced the match pattern operator, which is an equivalent to switchers that we see in other languages. This pattern was something the community asked for years, and since released it helped developers to make switchers chains on Python with having to define
On rocketpy, we suffer from the same problem... Take a look at this example:
Having a bunch of elifs is something not deseireable. Using a switcher give a cleaner view, just like this:
Describe the solution you'd like
Use the python match operator to replace if/elif/else chains in the code. We have to first evaluate if there will be an improvement in terms of code clearaity. In my experience, it usually makes the code reaaaally cleaner!
Additional context
Once we implement such "feature", we have to upgrade the minimum python version for running rocketpy to 3.10.
Therefore, this issue should be kept waiting until October 2025, when Python 3.9 will finally become a dead python version.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Python 3.10, when released in 2021, introduced the match pattern operator, which is an equivalent to
switchers
that we see in other languages. This pattern was something the community asked for years, and since released it helped developers to make switchers chains on Python with having to defineOn rocketpy, we suffer from the same problem... Take a look at this example:
Having a bunch of
elifs
is something not deseireable. Using a switcher give a cleaner view, just like this:Describe the solution you'd like
match
operator to replaceif
/elif
/else
chains in the code. We have to first evaluate if there will be an improvement in terms of code clearaity. In my experience, it usually makes the code reaaaally cleaner!Additional context
Once we implement such "feature", we have to upgrade the minimum python version for running rocketpy to 3.10.
Therefore, this issue should be kept waiting until October 2025, when Python 3.9 will finally become a dead python version.
The text was updated successfully, but these errors were encountered: