PY-76894 Add an inspection for raw usage of 'Concatenate' in type hints

* Ensure 'Concatenate' is only allowed as the first argument to 'Callable' in type hints.
* Added a test
* Exclude 'generics_paramspec_basic.py' from ignored as it passes now

GitOrigin-RevId: f44af8fc1426ce7b6d7f725b4a72270bc8015d0f
This commit is contained in:
Daniil Kalinin
2025-03-27 13:26:32 +01:00
committed by intellij-monorepo-bot
parent 92e25c9022
commit 5ba41876dc
4 changed files with 40 additions and 1 deletions

View File

@@ -1130,6 +1130,7 @@ INSP.type.hints.paramspec.expects.string.literal.as.first.argument='ParamSpec()'
INSP.type.hints.argument.to.typevar.must.be.string.equal.to.variable.name=The argument to 'TypeVar()' must be a string equal to the variable name to which it is assigned
INSP.type.hints.argument.to.typevar.tuple.must.be.string.equal.to.variable.name=The argument to 'TypeVarTuple()' must be a string equal to the variable name to which it is assigned
INSP.type.hints.argument.to.paramspec.must.be.string.equal.to.variable.name=The argument to 'ParamSpec()' must be a string equal to the variable name to which it is assigned
INSP.type.hints.concatenate.can.only.be.used.inside.callable='Concatenate' can only be used as the first argument to 'Callable' in this context
INSP.type.hints.bivariant.type.variables.are.not.supported=Bivariant type variables are not supported
INSP.type.hints.typevar.constraints.cannot.be.combined.with.bound=Constraints cannot be combined with bound=\u2026
INSP.type.hints.single.typevar.constraint.not.allowed=A single constraint is not allowed