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

MAINT: Apply UP038 #12799

Merged
merged 1 commit into from
Aug 19, 2024
Merged

MAINT: Apply UP038 #12799

merged 1 commit into from
Aug 19, 2024

Conversation

larsoner
Copy link
Member

Convert isinstance(x, (a, b)) into isinstance(x, a | b).

I guess we need to decide if we actually want this first. But I'm happy to follow ruff's lead/opinion on what's best style practice.

Once merged we should add to .git-blame-ignore-revs.

@mscheltienne
Copy link
Member

Happy to follow ruff's rules.

@hoechenberger
Copy link
Member

the | operator only works for Python 3.10+ IIRC

otherwise we need a future import

i'm happy to see the change in any case

@agramfort
Copy link
Member

agramfort commented Aug 19, 2024

works for me if it passes our minimal dep python version.

@larsoner
Copy link
Member Author

We will require 3.10+ in the next release so we should be good.

Ruff was actually smart enough to use our pyproject.toml to know whether or not to apply the rule, which is neat!

@agramfort
Copy link
Member

agramfort commented Aug 19, 2024 via email

@hoechenberger
Copy link
Member

Great!

@drammock drammock enabled auto-merge (squash) August 19, 2024 12:00
@larsoner larsoner disabled auto-merge August 19, 2024 13:53
@larsoner larsoner merged commit 362f933 into mne-tools:main Aug 19, 2024
30 checks passed
@larsoner larsoner deleted the up038 branch August 19, 2024 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants