Skip to content

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