Skip to content

MAINT: Apply UP038#12799

Merged
larsoner merged 1 commit intomne-tools:mainfrom
larsoner:up038
Aug 19, 2024
Merged

MAINT: Apply UP038#12799
larsoner merged 1 commit intomne-tools:mainfrom
larsoner:up038

Conversation

@larsoner
Copy link
Copy Markdown
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
Copy Markdown
Member

Happy to follow ruff's rules.

@hoechenberger
Copy link
Copy Markdown
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
Copy Markdown
Member

agramfort commented Aug 19, 2024

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

@larsoner
Copy link
Copy Markdown
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
Copy Markdown
Member

agramfort commented Aug 19, 2024 via email

@hoechenberger
Copy link
Copy Markdown
Member

Great!

@drammock drammock enabled auto-merge (squash) August 19, 2024 12:00
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