-
-
Notifications
You must be signed in to change notification settings - Fork 235
Description
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
matchoperator to replaceif/elif/elsechains 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.