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

Should eq-without-hash (PLW1641) not apply to stubs? #15292

Closed
Avasam opened this issue Jan 6, 2025 · 1 comment · Fixed by #15310
Closed

Should eq-without-hash (PLW1641) not apply to stubs? #15292

Avasam opened this issue Jan 6, 2025 · 1 comment · Fixed by #15310
Assignees
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule

Comments

@Avasam
Copy link
Contributor

Avasam commented Jan 6, 2025

I don't think that eq-without-hash (PLW1641) should apply to stubs (it currently does).
Stubs authors should aim to faithfully represent the runtime implementation. And if the runtime doesn't implement __hash__, the stubs shouldn't define it either.

Third-party stub authors have no control on this. First-party stubs would get FURB189 in their source .py files.

Ruff: 0.8.5 (rule is currently in preview)

(this report is extracted from #14535 (comment) for ease of tracking and discussion)

@dhruvmanila dhruvmanila added the question Asking for support or clarification label Jan 6, 2025
@MichaReiser MichaReiser added rule Implementing or modifying a lint rule preview Related to preview mode features and removed question Asking for support or clarification labels Jan 6, 2025
@MichaReiser
Copy link
Member

I think that would make sense to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Related to preview mode features rule Implementing or modifying a lint rule
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants