basedmypy icon indicating copy to clipboard operation
basedmypy copied to clipboard

Option to not type ignored arguments

Open 00001H opened this issue 1 year ago • 1 comments

Before you raise this, consider if it's better suited to a discussion: https://github.com/KotlinIsland/basedmypy/discussions

e.g.

def foo(x: int,_) -> int:#Error, but I don't want it to be
    ...

Sometimes, when you want to pass a function as a callback, it would be nice not to have to annotate the 9 ignored parameter.

00001H avatar Apr 30 '24 12:04 00001H

This should cover your case?

def foo(x: int, *args: object, **kwargs: object) -> int:
    ...

KotlinIsland avatar May 01 '24 03:05 KotlinIsland

Actually, I think I like your idea

KotlinIsland avatar Jun 04 '24 09:06 KotlinIsland

Sometimes, when you want to pass a function as a callback, it would be nice not to have to annotate the 9 ignored parameter.

When you have more than 1 unused parameter, how are you naming them? you can't have multiple parameters with the same name. _, __?

KotlinIsland avatar Jun 04 '24 09:06 KotlinIsland

*_ would do.

00001H avatar Jun 04 '24 12:06 00001H