2668 Commits
Author SHA1 Message Date
Nikita Paniukhinandintellij-monorepo-bot 8382012150 PY-45958 Add generated comparison operators for ordered dataclasses
GitOrigin-RevId: c6766c81e1bbf0f088d2afdc55fdf1436227506d
2026-03-25 13:59:10 +00:00
Nikita Paniukhinandintellij-monorepo-bot ae74035556 [python] PY-85419 PyDataclassClassMembersProvider: resolve members individually
GitOrigin-RevId: 60fb002790b0859c13623893354a0d6caecbb5a9
2026-03-25 13:59:10 +00:00
Nikita Paniukhinandintellij-monorepo-bot 66447e5142 [python] PY-85419 Convert PyDataclassClassMembersProvider to Kotlin
GitOrigin-RevId: 2ae4d96600d6a0c16d9b9bb3514bb89884b2054b
2026-03-25 13:59:10 +00:00
Nikita Paniukhinandintellij-monorepo-bot 81a4409d5a [python] PY-85419 Rename PyDataclassClassMembersProvider file to Kotlin
GitOrigin-RevId: 6bf2540df0186539ff788c09400a8fb4313d79da
2026-03-25 13:59:10 +00:00
Morgan Bartholomewandintellij-monorepo-bot 9993c55871 PY-88578 type-checker: don't report ellipsis as a default in an overload
(cherry picked from commit 4d81e3cdaf267e0e8997110e1bc10c7b52e00dfc)

GitOrigin-RevId: d6136cb5f4ddd34fb4b37f57ed7bfc480e154a46
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot b3ea8e8736 PY-52839 Overload types: initial
- is not yet applied at call-sites

(cherry picked from commit ce966e6b5d9abe33d7e51f95e4e7083fcd76ecc7)

GitOrigin-RevId: 69bb2e09a9ab4fa447c8ec4b23d48cd4b807e419
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot b3b8047d22 PY-57621 tuple types: widen for generic calls
(cherry picked from commit 4b8536f547d3e86dec3e07755751640d67f01f63)

GitOrigin-RevId: bb449c274a0a207e0a11eaf2112b26e458478447
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot e6495387ce misc python: support unions in PyStringFormatInspection
(cherry picked from commit b57bf859f88dbe3508e87c5d88609e84f8ae0452)

GitOrigin-RevId: 21e3b7972f3efe1c4e5f4d52d75f5c21d3bef901
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot 4d95ecde4e PY-57621 type inference: infer tuples with literal types
(cherry picked from commit d3f6711e4d187fac8b426eb1d5ed75def4932b3b)

GitOrigin-RevId: cc327f405e9a133425bcfbb091e22f1e267b6383
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot 90bbd2ac21 refactor python: j2k PyTupleExpressionImpl
(cherry picked from commit c39511add7e7172eb21cba4820b0c7b01dffd3bb)

GitOrigin-RevId: bc40928bf8641bcb64af84e21ef894ce96146888
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot 420ec435ec Rename .java to .kt
(cherry picked from commit 202b67aaa54b06b182359d0d073a0325fcc7e318)

GitOrigin-RevId: fb24d6e72cce2eac002c156c306121495295b1dd
2026-03-25 07:22:50 +00:00
Morgan Bartholomewandintellij-monorepo-bot f901605192 PY-87998 PyStringConversionWithoutDunderMethodInspection: fix str/tuple and report list label
(cherry picked from commit ab32f336558da96ee037edc727d4a06681820817)

GitOrigin-RevId: 5d2a9e914b53f2764b9b6dfa2d2bd7b662be1eba
2026-03-24 04:40:40 +00:00
Morgan Bartholomewandintellij-monorepo-bot cbe872c85a PY-87998 PyStringConversionWithoutDunderMethodInspection: initial
(cherry picked from commit 359b9a41515da9a841aad787695dee4ed14a12f5)

GitOrigin-RevId: 76a2706e3175e2cd8768b2c7882c3506120a82cb
2026-03-24 04:40:40 +00:00
Marcus Mewsandintellij-monorepo-bot d7cce9ec1f PY-76838 Conformance test failure: aliases_variance.py. Approved in IJ-MR-194934
GitOrigin-RevId: 3dad863825f88471262f20a4d1d37b181602a1d5
2026-03-23 18:36:54 +00:00
Morgan Bartholomewandintellij-monorepo-bot 36a47a31df PY-88372 PyTypeHintsInspection: improve self referential type alias check
(cherry picked from commit ca52f2a682bf54eaa923ef768f9305cacf33da34)

GitOrigin-RevId: 7f16aa78c753fe66d880b3356ed11c184a994b04
2026-03-23 04:40:25 +00:00
Morgan Bartholomewandintellij-monorepo-bot 069606d508 PY-88281 typing: partially unresolved union leads to complete Any
(cherry picked from commit 12afe1b92d81a439887680383ae0e4afbb8decb7)

GitOrigin-RevId: 6796d0fd9da021e9f66165021be3b29c508515d3
2026-03-23 04:40:25 +00:00
Morgan Bartholomewandintellij-monorepo-bot 53e012bc7b PY-78235 PyAnyType: add tests and refactor some more usages
GitOrigin-RevId: 9a9028d259fb33e450390653fb3984fbae43529e
2026-03-22 07:40:27 +00:00
Morgan Bartholomewandintellij-monorepo-bot 85a7b49911 PY-78235 PyAnyType: validate types
GitOrigin-RevId: d9552b3949bb45aee0a50e1e67f3c158fd2f01fa
2026-03-22 07:40:26 +00:00
Morgan Bartholomewandintellij-monorepo-bot d3a3be4cd7 PY-78235 PyAnyType: option to enable
(cherry picked from commit 9774a8d25a879a47ffe2200cc8a68eeca138274e)

GitOrigin-RevId: 6d04596d71db1589225f7263615aafdeeebcc425
2026-03-22 07:40:26 +00:00
Daniil Kalininandintellij-monorepo-bot 128fbd3bb0 PY-87344 Bind actual class types to Self when matching protocols
The issue was highlighted by the following semantics:
`Enum`'s metaclass is `EnumMeta` and implements iterable protocol as
```
def __iter__(self: type[_EnumMemberT]) -> Iterator[_EnumMemberT]: ...
```
Thus, we need to correctly bind the actual type of `Enum` implementation we're working with (say, `MyEnum`) to `_EnumMemberT` to be able to infer `Iterator[MyEnum]` and then get the correct type of e.g., `set(MyEnum)`

(cherry picked from commit 53b26f963bdf8746c1f8fde5ee41aa37c415d920)


(cherry picked from commit b0ce2298ae6a3e4706b55a56a6ba357ae9f6470d)

IJ-CR-196674

GitOrigin-RevId: 49990c2629af7a8674a8db52eee1cb6751b9343a
2026-03-21 11:35:33 +00:00
Daniil Kalininandintellij-monorepo-bot 254f0c8129 PY-87575 Correctly handle protocol methods defined in metaclasses
These changes provide correct handling of protocol methods defined in metaclasses.
Such methods have the highest priority when operating on class objects, even if the class inherits a direct implementation of the protocol, e.g., Iterable

(cherry picked from commit 1556c15d2b78dfe8f02797862d75e24462b637de)


(cherry picked from commit 89676de48b29d89219898b3d99f08f3e4f27863d)

IJ-CR-196674

GitOrigin-RevId: d75ebf09bd9676094c07d3ec1a2de6017675bce5
2026-03-21 11:35:33 +00:00
Morgan Bartholomewandintellij-monorepo-bot 9602a24b02 misc python: reject None literals in PyLiteralType.classOfAcceptableLiteral
GitOrigin-RevId: e3da34795615abbf1d409e53757fd82ae4ba2a6e
2026-03-19 17:06:21 +00:00
Vitaly Legchilkinandintellij-monorepo-bot 1dc7eb5123 PY-88280 Convert PyModuleService to Kotlin project-level service with suspended SDK resolution
- Convert PyModuleService (abstract class) to Kotlin interface
- Convert PyModuleServiceImpl to Kotlin with project-level scope
- Change from application-level to project-level service
- Add findPythonSdkWaitingForProjectModel suspend method that awaits
  JPS project model loading before resolving the SDK
- Mark old findPythonSdk as @ApiStatus.Obsolete
- Update all call sites to use getInstance(project)

(cherry picked from commit 4dc39a57dbc6063d37522fac8befe01329c10cde)

GitOrigin-RevId: 529405c76d8e2fa503ccc40e15dd0834dd59f469
2026-03-18 17:22:13 +00:00
Petrandintellij-monorepo-bot 099f8d4fb0 PY-87343 Fix missing resolve for typing.NewType.__or__
(cherry picked from commit 983304fb955d228d946ff75b0c3f20aa35a5d0f1)

IJ-CR-192634

GitOrigin-RevId: ece63ce2f6920edb40bdd656da2a8f6f972549a8
2026-03-18 17:13:42 +00:00
Petrandintellij-monorepo-bot 8ccd3073fe PY-87549 Fix infinite recursion when calling PyAstFile.hasImportFromFuture
Before, `PyAstFile.hasImportFromFuture` collected all `PyFromImportStatement`s using `PyFileImpl.collectChildren`. `PyFileImpl.collectChildren` evaluates static if-conditions (using `PyTypeCheckedElementVisitor.visitPyIfStatement`), which, in presense of a string literal inside if-condition, formed a cycle:

`PyAstFile.hasImportFromFuture()` -> `PyFileImpl.collectChildren()` -> `PyEvaluator.evaluateAsBooleanNoResolve()` -> `PyAstStringLiteralExpression.getStringValue()` -> `PyStringLiteralDecoder.isUnicodeByDefault` -> `PyAstFile.hasImportFromFuture()`

Now `PyAstFile.hasImportFromFuture()` does not collect all `PyFromImportStatement`s. According to spec, only imports at the beginning of a file can be future statements.

(cherry picked from commit bd6b7d73c173954e5cfa0203d9b01931267dea58)

GitOrigin-RevId: 6063a73df368863699388c318bf6bf4e6da00413
2026-03-13 19:52:27 +00:00
Tatiana Berandintellij-monorepo-bot c733d1898f refactor python: replace utility helpers with kotlin equivalents in PyTypingTypeProvider
(cherry picked from commit a1d8d52a6bd5bdbcecd8698b7bed96260b11b3f0)

GitOrigin-RevId: c52d3c037743383fa9e5faabec3733695a78544d
2026-03-12 12:22:02 +00:00
Tatiana Berandintellij-monorepo-bot cc77134fc9 PY-87777 python: async def should return a types.CoroutineType, not a typing.Coroutine
(cherry picked from commit 7992f6b1eef198e35771fa59e3587656e252b24d)

GitOrigin-RevId: db84f2dc3a485670f02f9aba039007c769c03ed9
2026-03-12 12:22:02 +00:00
Marcus Mewsandintellij-monorepo-bot 4e32246445 PY-88071 / PY-88089: Adjust CSP solution to use correct default type / type var solved to default when it should remain unsolved
(cherry picked from commit 9bc20a4b39ca1a01284d28787808ec88cf7ccc63)

IJ-MR-194284

GitOrigin-RevId: 4244f1b31a0584753a8899df8869dab11234a966
2026-03-05 17:00:59 +00:00
Marcus Mewsandintellij-monorepo-bot 911628cb74 PY-88120 Slight improvement of debuggability in PyTypingTypeProvider
(cherry picked from commit 5b8d18b07b2dda008ded501ccbf02c2780e81051)

IJ-MR-194342

GitOrigin-RevId: 1664dfd42619a120c73da18225fb361e3175f0a3
2026-03-04 17:13:13 +00:00
Marcus Mewsandintellij-monorepo-bot 859db02320 PY-87890 pandas.DataFrame is considered Any with pandas >= 3 and pycharm 2026.1
(cherry picked from commit 7bab57dfde79fc86f672f7cb14193d7e1cbcdd6a)

IJ-MR-193139

GitOrigin-RevId: dc4a5bd0a1f4deb2865525b7db9841ab57ac42dd
2026-03-02 21:39:01 +00:00
evgeny.bovykinandintellij-monorepo-bot ebc3f5f250 PY-60352 Consider overriding attributes when checking dataclass attributes with default values with inheritance
(cherry picked from commit 9a3332cb0f5e0ef4af8ee891c442b6fe4076ea0e)

IJ-MR-192626

GitOrigin-RevId: 781f98ea792933e93e7e960ac139407efe1a0261
2026-03-02 16:59:16 +00:00
evgeny.bovykinandintellij-monorepo-bot adb4cfccd5 PY-87730 Don't report a type checker error for ... default value in protocol methods
(cherry picked from commit 0497793f59bb3056bc5a3d3ef8e10445db973763)

IJ-MR-192129

GitOrigin-RevId: 0c95bab2735a89514a6fcddb8e57df2bfb5015d5
2026-03-02 16:55:19 +00:00
evgeny.bovykinandintellij-monorepo-bot d1d4f53e45 PY-86873 Support nested lists unpacking
(cherry picked from commit 0b8dbad603f5b08570e31fa910847a0b844ff6a3)

GitOrigin-RevId: bbc091c2c3195450830a7223636a204e6d814667
2026-03-02 16:24:46 +00:00
Morgan Bartholomewandintellij-monorepo-bot 92a861df05 PY-87740/PY-87763 type engine: ui features
GitOrigin-RevId: c1ee6bd5e0e0e31af41dcb403bccecada40096b7
2026-02-26 07:10:45 +00:00
Morgan Bartholomewandintellij-monorepo-bot 867a754295 refactor python: j2k apply fixes from review
- document `PyAnyType`
- remove wildcards from `PyType` methods
- revert `PyTypeUtil.notNullToRef` to a function

GitOrigin-RevId: 4ba489184c466e57b28a149fb39c9858c5070f80
2026-02-26 04:34:02 +00:00
Tatiana Berandintellij-monorepo-bot d99b42eef2 PY-87796 UI Texts: Fix typos and grammar mistakes (Feb 2026)
(cherry picked from commit 8996fec06c52cda4d28cd5176ba1d97a7036639b)

GitOrigin-RevId: 3bc91b31ef8ecea7cd57b67c7298ed815f9a9116
2026-02-25 17:03:10 +00:00
evgeny.bovykinandintellij-monorepo-bot c6dc992360 refactor pycharm: Remove all non-const variables and methods from companion objects
See IJPL-115436 for more info

(cherry picked from commit 6c300e982830c5cd70d501763daf6b2087b51c64)

GitOrigin-RevId: 5d47cdd2da551fbc44040418ff8613c4c4d4580a
2026-02-25 12:38:14 +00:00
Marcus Mewsandintellij-monorepo-bot c49593a948 PY-87859 / PY-87913: variance error on frozen dataclass / ReadOnly attribute
(cherry picked from commit cf4316e5c0fb0c7230348d52cba7bd333d64667a)

IJ-MR-192922

GitOrigin-RevId: 0b9e9955ec63534feee9c8bbcfdb2a07f73ee95e
2026-02-25 11:15:51 +00:00
Vitaly Legchilkinandintellij-monorepo-bot 20b5c8c972 PY-86864 Replace PyInterpreterInspection with EditorNotificationProvider
Replace the LocalInspectionTool-based "no interpreter" warning with an
EditorNotificationProvider banner. This extends coverage to pyproject.toml
and README.md files (in addition to .py files) and simplifies the fix
architecture.

Key changes:
- Delete PyInterpreterInspection, replace with PyInterpreterNotificationProvider
- Add PyInterpreterNotificationFileOpenedListener for split-editor timing
- Replace LocalQuickFix with a simpler InterpreterFix interface (no ProblemDescriptor)
- Simplify PyAsyncFileInspectionRunner: use refreshAfterWrite for flicker-free
  cache refresh, use EditorNotifications instead of DaemonCodeAnalyzer
- Remove PyInterpreterInspectionSuppressor (no longer needed without inspection)
- Add isPythonModule check for the module
- Move bundle keys from PyPsiBundle to PyBundle with python.sdk.* prefix
- Extract CONFIGURABLE_ID constant in PyActiveSdkModuleConfigurable

IJ-MR-192977

(cherry picked from commit 6b3584d6c6beac53f4b8f0abb9a34e698b4ad03f)

GitOrigin-RevId: 1df48bbfbade2f7f31ffae7b02a0cab2f1f68389
2026-02-24 08:23:28 +00:00
Morgan Bartholomewandintellij-monorepo-bot cb03d603c8 PY-87568 PySuspiciousBooleanConditionInspection: fixes from review
GitOrigin-RevId: d8581d8f40a3b6e5d5865660aa9b7e39e3ac3fe5
2026-02-24 05:53:37 +00:00
Marcus Mewsandintellij-monorepo-bot 80f38711ec PY-87831 incorrect (invariant) variance on subtype
(cherry picked from commit c0254d65914f2e6fab1b69eecc6fc4e4837b6ce7)

IJ-MR-192664

GitOrigin-RevId: b8d3a12e6774ccff04d368d30a0a49572e303e1e
2026-02-21 11:10:10 +00:00
Tatiana Berandintellij-monorepo-bot 2bf9d316a5 PY-87796 UI Texts: Fix typos and grammar mistakes (Feb 2026)
(cherry picked from commit f4b52fc04911cc80b05fc155485fa5aafcd70bf4)

GitOrigin-RevId: 76b3859ef35485c1704d9d12419fae927a3989c6
2026-02-20 23:47:12 +00:00
Alexey Katsmanandintellij-monorepo-bot fc0731b0ef PY-87227 Suggest a tool installation if it is not already installed
Support a mechanism for recommending a tool installation if we're
confident it should be used for SDK configuration. For now, it only
supports uv (with uv.lock check).

It also fixes PY-87744, since we dropped all usages of PyDetectedSdk in
our SDK configurators.

GitOrigin-RevId: f99a1089025079313db9aae09e3cfc0205e7e37f
2026-02-20 22:53:20 +00:00
Tatiana Berandintellij-monorepo-bot fbaaccf8e9 PY-87768 False positive Function '...' doesn't return anything for in lambda
(cherry picked from commit 90024a242e07d61663f6378640bedb4faf2cbdb2)

GitOrigin-RevId: d13860dd925790527875cb35dbfce2b6926039ed
2026-02-20 21:34:21 +00:00
Morgan Bartholomewandintellij-monorepo-bot 13fceb92ce PY-87791 type engine: fix callable parameter representation type
(cherry picked from commit 7cbc0c26a00a260f8ac9ce4c3ddf18e999e5114e)

IJ-MR-192392

GitOrigin-RevId: 65b3919f8073254dad6a631bc5326ae4ad99f6c5
2026-02-20 18:37:43 +00:00
Morgan Bartholomewandintellij-monorepo-bot efa90148b5 PY-87253 type engine: fix module resolution
(cherry picked from commit e89cee30443819a3d00eed58d9f502922365ab08)

IJ-MR-192392

GitOrigin-RevId: efac9ad6bc44d3b208909b1516059a48bc4684a2
2026-02-20 18:37:43 +00:00
Mikhail Golubevandintellij-monorepo-bot 945299aeb7 PY-64359 Handle Any as a generic type argument in PyTypeUtil.convertToType()
Turns out there are still problems with handling explicit Any as a type argument.
Namely, after matching `Iterable[T@Iterable]` with `Iterable[Any]`, we don't retain
the mapping `T@Iterable -> Any` in PyTypeChecker.MatchContext#mySubstitutions.

It doesn't hit during handling of generic calls because in cases like the following

```python
from typing import Any

def first[T](xs: list[T]) -> T | None:
    ...

xs: list[Any]
expr = first(xs)
```

we forcibly replace unbound `T@first` in the result type with Any in
PyTypeChecker.getSubstitutionsWithUnresolvedReturnGenerics, hence masking
the underlying issue. I temporarily extended this approach to `convertToType`.
Specializing all type parameters through CSP should help with that.

(cherry picked from commit 111c6c0d0a15fd290de6df7388e9f6ada70cf998)

GitOrigin-RevId: 0777fdac0034d04dfec517f970aa91fa7d6eba6a
2026-02-20 12:15:44 +00:00
evgeny.bovykinandintellij-monorepo-bot 9c7526244e refactor pycharm: Extract "typing.Iterable" string to PyTypingTypeProvider.ITERABLE
(cherry picked from commit cc99d3cfe0d71c55fc01acc69d0016ed524da6e9)

GitOrigin-RevId: 3d54a69c6b99b569d760ce7c606efb54e220459c
2026-02-20 12:15:44 +00:00
evgeny.bovykinandintellij-monorepo-bot 587cdcf35a PY-64359 Upcast PyCollectionTypeImpl to Iterable to get its proper iterated item type
(cherry picked from commit 2366c4b215a3631d270cd69850291da38e70b2ec)

GitOrigin-RevId: 8175cdbea5ff6f05c5b1beaa0fa5fe21e03ec5cf
2026-02-20 12:15:44 +00:00
Morgan Bartholomewandintellij-monorepo-bot 68037d2f98 PY-80351 PyNoneFunctionAssignmentInspection: review feedback
(cherry picked from commit 1028edb99d96676e17a439e07f56a331bf5d907b)

IJ-MR-192558

GitOrigin-RevId: 43bfdb87df46803bf78b93c5345ad4b7a7e323db
2026-02-20 11:46:29 +00:00