Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: use the match operator once python 3.9 is no longer supported #725

Open
1 task
Gui-FernandesBR opened this issue Nov 8, 2024 · 0 comments
Open
1 task

Comments

@Gui-FernandesBR
Copy link
Member

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:
image

Having a bunch of elifs is something not deseireable. Using a switcher give a cleaner view, just like this:
image

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant