I would favor a shorthand where a bare name means a typed positional-only argument. That means we both get a nice shorthand (e.g., `(int, str) -> int` corresponds to `Callable[[int, str], int]`) and full power to represent all signatures (you can write `(a: int, /, b: str, *, c: int = ...) -> int` if you really need it).El mié, 16 jun 2021 a las 11:06, Guido van Rossum (<guido@python.org>) escribió:[...]Additionally, what are the concerns with allowing a hybrid of named and unnamed params, ie.:
f: (int, str, *, foo: int = ..., **kwargs: str) -> bool
If we were to allow this, it'd be harder to give a simple rule for when the argument names can be omitted or not -- for example would we allow this?f: (int, name: str) -> boolThis would be shorthand for a function that takes a positional-only argument of type int and a positional-or-keyword argument named "name" of type str.
or this?f: (count: int, str) -> boolor even this?f: (a: int, b, c: str) -> boolThese two would be illegal because a positional-only argument cannot follow a positional-or-keyword argument.