Skip to content

Make ignore_pos_arg_names=False for overrides when using --extra-checks #20446

Open

Description

@A5rocks

Feature

We can check positional argument names for overriding functions.

class A:
    def f(self, x: int) -> None:
        pass
    
class B(A):
    def f(self, _x: int) -> None:  # this *should* error, but doesn't currently
        pass

Pitch

Well, ignoring positional arguments is obviously not type safe. It's annoying, sure, but in my mind that's the class of checks that --extra-checks encompasses (technically correct but annoying).

Activity

  1. hauntsaninja commented on Dec 19, 2025

    @hauntsaninja
    Collaborator

    I think there's consensus that --extra-checks isn't really the way to go.

    Do agree with the feature though, see also #18355

  2. A5rocks commented on Dec 19, 2025

    @A5rocks
    CollaboratorAuthor

    Making an opt-in error code also makes sense!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions