Removed a number of tests in Py3TypeTest duplicating those of PyDecoratedFunctionTypeProviderTest.
Removed the tests about PY-23067 in Py3ArgumentListInspectionTest and Py3CompletionTest because
this issue was actually not addressed in 05e8ed4df0c7faa24bd972e1b422f664d708b510, and the behavior
some of them assert is not what users wanted.
More consistent naming of tests in PyDecoratedFunctionTypeProviderTest and PyParameterInfoTest.
Removed there excess tests too similar to others or checking scenarios not relevant to
the current approach to type inference for decorators, e.g. presense of @functools.wraps and
alternatives inside decorators — we don't even analyze their bodies anymore.
Add a few extra tests illustrating problems with the current approach:
- testNotAnnotatedDecoratorChangingFunctionSignatureIsIgnored
- testInStackOfDecoratorsChangingFunctionSignatureOnlyAnnotatedAreConsidered
- testInStackOfImportedDecoratorsChangingFunctionSignatureOnlyAnnotatedAreConsidered
- testNotAnnotatedDecoratorRetainsParametersOfOriginalFunctionEvenIfItChangesItsSignature
GitOrigin-RevId: 0bf5070fc523b88dcc9d3009786dd028bdfa0feb
While resolving an aliased method exported from a module, we might lose
the context that it was referenced via instance and hence its first "self"
parameter is already bound and doesn't need to be passed explicitly.
The reason is PyResolveUtil#doResolveQualifiedNameInScope (called in
PyTargetExpressionImpl.multiResolveAssignedValue) performs resolve
over qualified names saved in PSI stubs and returns plain PsiElements
(end results) that don't retain such information about their qualifiers.
QualifiedResolveResult can't be used there either because we don't keep
PyExpressions in PSI stubs. What's more, when later such function is referenced
via some module we consider it definitely unbound, even though a module cannot
possibly have a method as its immediate attribute. I changed the logic so that
we no longer consider referencing a method through a module as somehow affecting
its bound/unbound state.
GitOrigin-RevId: 17a6c3e5d43c088d0663ba54651004c8370d5eca
Makes it possible to mark individual TypedDict keys as required or not required, covered in [PEP-655](https://peps.python.org/pep-0655/)
GitOrigin-RevId: 6567fd1009430e37f32924eb29ab8b4a1a17f315
PY-38422 Unify warning message for 'clear' and 'popitem' TypedDict methods
PY-38505 Infer proper type for TypedDict subscription expressions
PY-38439 Fix TypedDict consistency check
PY-38415 Fix TypedDict keys order in parameter info
PY-38413 Add * before all arguments in TypedDict parameter hint
PY-38873 Fix detection of TypedDict subscription expression type when value is a dict, Dict or TypedDict
GitOrigin-RevId: 25ff441042f2e2d7791e28632a5016fb367685df
Update PyDataclassesTypeProvider to ignore such fields or correctly specify default value for them.
Create custom target stubs for such fields to store parameters.
Update PyCallableParameterImpl to be able to store default value and use this in PyNamedTupleType.
Class inherited from typing.NamedTuple passes default values to PyNamedTupleType.
PY-23253 Fixed: NamedTuple subclass inspection
Update PyNamedTupleType and PyNamedTupleStub to store fields' types.
Parameter hints show expected types and PyTypeCheckerInspection verifies them correctly.
PY-22102 Fixed: NamedTuple class declaration for Python 3.6 not supported by PyCharm
PY-22249 Fixed: Add parameters tooltip to namedtuple constructor
PY-22740 Fixed: Unexpected argument for field names of class inherited from namedtuple
Update PyNamedTupleType to be callable and provide parameters when creating new namedtuple instance.
Update PyStdlibTypeProvider to provide special callable types when creating new namedtuple inheritor instance.
Update PyCallExpressionHelper to check type providers when resolving callee.
Update PyClassImpl to return PyNamedTupleType when class inherits typing.NamedTuple.
Parameter hints and PyArgumentListInspection work correctly with creating new namedtuple instances.
It allows to calculate arguments-to-parameters mapping for types that don't have psi callable (i.e. typing.Callable).
Update PyParameterInfoHandler to work with callable types instead of callables.
Update PyReferenceImpl to resolve to the latest definition of the callable and prepend it with overloads.
Update PyParameterInfoHandler and PyTypeChecker to take into account overloads only if they exist.