Skip to content

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

@A5rocks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions