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

MNT: how should we handle Python 3.10 becoming our oldest supported version ? #4749

Open
neutrinoceros opened this issue Nov 22, 2023 · 0 comments
Labels
code style Related to linting tools question

Comments

@neutrinoceros
Copy link
Member

neutrinoceros commented Nov 22, 2023

Python 3.10 is next in line to become our oldest supported version (currently it's 3.9), sometime about October 2024 (extrapolating from the last couple year's pace).
This version comes with a couple changes that will be picked up but our linters (pyugrade and flake8-bugbear via ruff) and that would affect a large number of lines, so I'd like to start the discussion early to decide what to do about them.

Here are the rules I know about

pyupgrade UP038

Basically this would change

isinstance(x, (int, float))

to

isinstance(x, int | float)

It's noted that the more modern ("good") alternative is actually slower, so we might want to just ignore this specific rule.

flake8-bugbear B905

Python 3.10 added a strict argument to the builtin zip function which is False by default for backward compatibility.
This rule checks that strict is explicitly set everywhere, which is always safer or more explicit than leaving it unset.
I don't think it'd be controversial to follow this rule ? It'd a bit tedious to retro-actively set it everywhere but I'd happily volunteer for this boring task. It can actually be addressed right now by using yt._maintenance.backports.zip which imitate the Python 3.10 function.

@neutrinoceros neutrinoceros added question code style Related to linting tools labels Nov 22, 2023
@neutrinoceros neutrinoceros changed the title MNT: how should we handle Python 3.10 becoming our old supported version ? MNT: how should we handle Python 3.10 becoming our oldest supported version ? Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code style Related to linting tools question
Projects
None yet
Development

No branches or pull requests

1 participant