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

PLW3201 "_" is not a bad dunder name #8005

Closed
NeilGirdhar opened this issue Oct 17, 2023 · 3 comments · Fixed by #8015
Closed

PLW3201 "_" is not a bad dunder name #8005

NeilGirdhar opened this issue Oct 17, 2023 · 3 comments · Fixed by #8015
Assignees
Labels
bug Something isn't working

Comments

@NeilGirdhar
Copy link

_ is not a bad dunder name. _ is often used functions whose names are not relevant. Please consider excluding _ from PLW3201's rules.:

    prediction_energy = custom_jvp_method(  # type: ignore[assignment] # pyright: ignore
        prediction_energy, nondiff_argnums=(0, 2, 3))

    @prediction_energy.defjvp  # type: ignore[no-redef, attr-defined, misc]
    def _(self,
          observation: FisherMessage,
          weights: Weights,
          primals: tuple[RivalMessage],
          tangents: tuple[RivalMessage]
          ) -> tuple[JaxRealArray, JaxRealArray]:
        natural_explanation, = primals
@NeilGirdhar
Copy link
Author

Incidentally, not sure where to write this, but the previewed rules that were useful to me were:

  • E114 Indentation is not a multiple of 4 (comment)
  • E116 Unexpected indentation (comment)
  • E203 [*] Whitespace before ','
  • E241 Multiple spaces after comma
  • E271 Multiple spaces after keyword

@charliermarsh charliermarsh self-assigned this Oct 17, 2023
@charliermarsh
Copy link
Member

Seems reasonable, it's almost certainly intentional.

@zanieb
Copy link
Member

zanieb commented Oct 17, 2023

@NeilGirdhar perhaps you're looking for #7993?

@charliermarsh charliermarsh added the bug Something isn't working label Oct 17, 2023
charliermarsh added a commit that referenced this issue Oct 17, 2023
This is almost certainly _not_ an accidentally mistyped dunder method.
Closes #8005.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants