Commit Graph

30159 Commits

Author SHA1 Message Date
Andrey Vokin
915ccaa68e IJOB-583 PyCharm onboarding lesson broken (at step 16)
After PY-55548 no need to change type hint `object` to `float`


(cherry picked from commit d9ba34fb955df644b7892b070dc1f5523db7fce9)

IJ-CR-152255

GitOrigin-RevId: ae0f12168de11265c14432709abb074d35530ccc
2025-01-09 13:30:27 +00:00
Dmitriy.Panov
82fa4ae1e2 IJPL-172978 different UUIDs for IDE binaries on macOS
(cherry picked from commit e56374d6355c41d66e41e2de4c2ca14431464537)

IJ-CR-151551

GitOrigin-RevId: a18ab4cd13c6476dfff57f6cb62722f72c5dcb68
2025-01-03 15:51:13 +00:00
Alex Plate
2ab18edac8 [Python Onboarding] There is no need to require a module to open the interpreter settings
Also, silently returning from the function will leave the link non-working, what is confusing for the user


(cherry picked from commit 7b0384c5810ab38268420f172c7e3ddbef0d7b15)

IJ-CR-151630

GitOrigin-RevId: 15bdac04edde15e1b181e18d9006485c141b6308
2024-12-27 15:06:26 +00:00
Mikhail Golubev
1be05f5d9e PY-78189 Flip expected and actual types in warnings about __set__ argument
(cherry picked from commit 65f8c92b852539908c71715756ec407781a9fb6b)

IJ-CR-152050

GitOrigin-RevId: 2672bc7f5d39dd2bec1a9b2c2d322dffb3d66062
2024-12-20 14:45:15 +00:00
Aleksandr Sorotskii
4ed6a858d4 Automatically switch client/server mode in debugger tests; PY-78168
(cherry picked from commit 3714877098305edcc4eae4f9761ab176c0112355)

IJ-MR-151881

GitOrigin-RevId: e6c06cfd22fa03964b8373ecd738fec26c7d785f
2024-12-20 14:42:55 +00:00
Aleksandr Sorotskii
f5e820f848 disable python debugger single port by default; PY-78168
(cherry picked from commit e73f477e2424c4c103bfaa676cdf94098170d4b5)

IJ-MR-151881

GitOrigin-RevId: 7a665d852d77554e00a51cce697940ebd5da538b
2024-12-20 14:42:55 +00:00
Natalia.Murycheva
050782b5ea PyCharm Tables] PY-33448 PyCharm freezes with large objects in SciView #PY-33448 Fixed
* Fixed also the Python Console case: transposed 1-Dim table there as well

(cherry picked from commit a6c783dc38aa3c5050a836c36d8a76e8b3cbda19)

GitOrigin-RevId: b7fe92925fe8702ffd80e56a4fe0c313c6411372
2024-12-19 15:17:52 +00:00
Natalia.Murycheva
53d3243005 [PyCharm Tables] PY-33448 PyCharm freezes with large objects in SciView #PY-33448 Fixed
* Transposed 1-D numpy array on the Python side of the Debugger
* Applied setMaxItemsForSizeCalculation method to the myRowHeader table to minimize calculations for getRowHeight

(cherry picked from commit f88fa625f2d8673cba2c9819f2907462b3f2301d)

GitOrigin-RevId: de6f919f18caec6624b1696790a88e10659e96f0
2024-12-19 15:17:52 +00:00
Natalia.Murycheva
c68e31976c [PyCharm Tables] PY-77591 Added "is None"/"is not None" conditions to tables' filters #PY-77591 Fixed
(cherry picked from commit ad48262cab5d46f06b1ee7f72c764ee899f0c926)

GitOrigin-RevId: 75313468a9f205fce99fae1215399d32131626a5
2024-12-19 15:17:52 +00:00
Ilya.Kazakevich
785ae87864 PyCharm: Skip files in PYCHARM_PYTHONS dir in tests.
We might have scripts there (on Windows) like `fix_path.cmd`, we need to exclude them


(cherry picked from commit e09ceac554f456a3d8a931e0dfe26872908c303c)

IJ-CR-151567


(cherry picked from commit 8a8d68e41a6bd607622f3b6afa76e5dc878f4236)

IJ-CR-151953

GitOrigin-RevId: 9a463cdc1e0c348c2ffa27f26e64781f5014bd97
2024-12-19 15:16:27 +00:00
ekaterina.itsenko
c404d3fdbc [pycharm] PY-76963 Tables(Jupyter, DataView): deal with NaN's
(cherry picked from commit db266d1e3d57ab2808d04da0ec020c698a687d98)

IJ-MR-151825

GitOrigin-RevId: fa805e62023b27fde32a82f3b2563278f5060e85
2024-12-18 16:36:33 +00:00
ekaterina.itsenko
e11ed05c0b [pycharm] PY-77107 Tables(Jupyter, DataView): fix display issues
(cherry picked from commit b6eb5b7e6b62a9c850a7f7512702ce5c87685cb4)

IJ-MR-151825

GitOrigin-RevId: 4716c26e57ff3163dbd4046b653c6e0350a70554
2024-12-18 16:36:33 +00:00
Egor Eliseev
cc30351cde PY-77788 Fix Requires Thread annotations
Merge-request: IJ-MR-150426
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 58bc50470e72e24d85869fb43a2556b6ecc01c61)

IJ-MR-150426

GitOrigin-RevId: 0bb2402914a3fbb9dcda6a868ce87fdbca31af03
2024-12-18 16:04:53 +00:00
Egor Eliseev
cf06be9b95 PY-52265 Poetry in-project environment
Add the new setting: create poetry env in the project.


Merge-request: IJ-MR-149143
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit ed85efe339518cdf6949752be286172113931c22)

IJ-MR-149143

GitOrigin-RevId: 3a682aac846e4a80e8310a3dcc0a5f1c988d28e2
2024-12-18 15:50:26 +00:00
Egor Eliseev
f910392d5d PY-77160 Poetry/Pipenv modules refactoring
Split pipenv into separate files.
Rewrite functions/methods using coroutines.
Add `internal` or `@Internal`.

Merge-request: IJ-MR-148379
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit b398d04bfa358ce97bf1d30d59b2113548e7983c)


Merge-request: IJ-MR-151355
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

GitOrigin-RevId: 2cd929fad7649fd6302100b8af5ff7969de8ec3e
2024-12-18 14:01:31 +00:00
Aleksandr.Govenko
51fe58feb5 PY-20710 Fix NPE in PyTargetExpressionImpl
Merge-request: IJ-MR-150854
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit ae24337d4cf3e2f8aa3219681bb36abce17cd212)

IJ-MR-150854

GitOrigin-RevId: f42a45ee8af4e48ab83442960e1c9cbe3e15f361
2024-12-18 02:37:10 +00:00
Aleksandr.Govenko
70fe60b4c8 PY-20710 Support 'Generator' typing class
Check YieldType of yield expressions in PyTypeCheckerInspection
Check that (Async)Generator is used in (async) function
Check that in 'yield from' sync Generator is used
Convert PyMakeFunctionReturnTypeQuickFix into PsiUpdateModCommandAction
Infer Generator type for lambdas
When getting function type from annotation, do not convert Generator to AsyncGenerator
Introduce GeneratorTypeDescriptor to simplify working with generator annotations


Merge-request: IJ-MR-146521
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit b3b8182168c5224f0e03f54d443171ccf6ca7b89)

IJ-MR-146521

GitOrigin-RevId: a95670d7e2787015bcf162637ea6d7bfb47a312a
2024-12-17 20:59:50 +00:00
Tatiana Ber
362a0344a7 PY-77814 Update text in messages
GitOrigin-RevId: f04fcb10130b6fe79516d36b0b16c3f38dcc2462
2024-12-17 19:40:40 +00:00
Aleksandr.Govenko
4dd41ee9f5 PY-20611 Missing warning about functions implicitly returning None when return type is not Optional
Updated PyFunction to account for implicit 'return None' statements when inferring return statement types.

It affected return type inference of PyFunction.

Fixed a failing test related to formatted strings.

Added a quick fix to make all return statements explicit.

Updated the CFG to include PyPassStatements, enabling detection of exit points in empty functions.

Simplified PyMakeFunctionReturnTypeQuickFix to independently infer function types and handle required imports. Currently, it does not support specifying custom suggested types.



Merge-request: IJ-MR-148719
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 9f58961f9eb70e4f9dbba7359f5aafdfd392b7e2)

IJ-MR-148719

GitOrigin-RevId: 68ef5c4a1cc0fcaffd750cc0713250a106136643
2024-12-17 18:16:40 +00:00
Aleksandr.Govenko
bdbe78b63a PY-60714 PyCharm does not understand async iterators
__anext__ method is required to return Awaitable. When getting iterated type, unwrap that awaitable


Merge-request: IJ-MR-150432
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 97a070ead70c0ec0f2da08000517c592c5805965)

IJ-MR-150432

GitOrigin-RevId: 21dc20b164e6095e56707ea50bc93bf67564e88e
2024-12-17 15:42:06 +00:00
Mikhail Golubev
31678081b3 PY-77167 Simplify resolve logic for overloads, get rid of RatedResolveResult#RATE_LIFTED_PY_FILE_OVERLOAD
If there is an overload not followed by an implementation, which is
already an error, always resolve to the first overload, regardless
of whether it's a .py file, or a .pyi stub. It allows us to eliminate
the special RatedResolveResult#RATE_LIFTED_PY_FILE_OVERLOAD rate in .py
files, because we no longer need to duplicate the last, closest reachable
overload (normally an implementation should be reachable) with a higher
priority, and then filter it out during overload resolution.

Meanwhile, this filtering out didn't work right before
because some type inference logic, e.g., PyCallExpressionHelper.getCalleeType
used in PyReferenceExpressionImpl.getCallableType bypassed it. It should have
been done at the level of
PyCallExpressionHelper.forEveryScopeTakeOverloadsOtherwiseImplementations.


(cherry picked from commit 99a624ab85957d7a2d3c2c0ced596e472f9d615b)

IJ-MR-148398

GitOrigin-RevId: c2cdfe8c8b046118f4e6f7269dbf7848dd746e08
2024-12-17 15:33:39 +00:00
Mikhail Golubev
714c16f197 [python] Simplify PyResolveUtil#resolveQualifiedNameInScope
(cherry picked from commit 6b95f07ddffbbd246e5c3a852de42c0cc19098ce)

IJ-CR-151380

GitOrigin-RevId: 24a9cb2f52bdc9ace2e2d21ac0d0f2e002451dae
2024-12-17 14:53:28 +00:00
Mikhail Golubev
66f10b6356 [python] Make PyResolveUtil.resolveQualifiedNameInScope automatically traverse scopes
(cherry picked from commit 6013fdabf6967a193a60849ec0e81e153380b4b7)

IJ-CR-151380

GitOrigin-RevId: 7f238ba2bee90f15dbe9c76cbf4e089a48f52870
2024-12-17 14:53:28 +00:00
Mikhail Golubev
651f6c3310 [python] Add a clarifying comment in PyDataclassInspection
(cherry picked from commit 1f109781ad81e2b5db578a384ee5dba6b1cbbccf)

IJ-CR-151380

GitOrigin-RevId: 45a480dba35bf14df8afcd3c69707603ff5c8f19
2024-12-17 14:53:28 +00:00
Mikhail Golubev
ab6adac4d4 PY-77433 Fix resolving qualified names in field_specifiers argument of @dataclass_transform
Previously, we mistakenly tried to resolve qualified names listed in the
`field_specifiers` argument of @dataclass_transform in the same scope
where the dataclass itself is defined, not where the actual decorator
application is located.

Thus, if in the file where the dataclass is defined, a field specifier
was imported differently than where @dataclass_transform was applied, we
couldn't recognize a field specifier call in the RHS of an assignment as such
and took it for an ordinary field default value.

In particular, this is what happened with pydantic dataclasses.
`pydantic.fields.Field` is usually imported as just `pydantic.Field` where
user dataclasses are defined, but imported with an alias and set in the
`field_specifiers` argument as `PydanticModelField` in
`pydantic._internal._model_construction` where `ModelMetaclass` is defined.

It was accidentally broken in f15a07836e7aeac7c46b489b4742e8248a0e6ef4 to
support decorating class methods with dataclass_transform
(see testData/inspections/PyDataclassInspection/DataclassTransformFieldsOrder/decorator.py).
Until PyResolveUtil.resolveQualifiedNameInScope automatically traverses through
containing scopes looking for a name, the file containing decorator application
seems like a safe trade-off for the scope, because field specifiers are normally
defined or imported somewhere at the top level.


(cherry picked from commit de9afeb0831a52f058453fe678de229d41c26a4d)

IJ-CR-151380

GitOrigin-RevId: b6576ec7b72ea1e19e93b6190372a5168003c396
2024-12-17 14:53:28 +00:00
Petr
3db29fcbc8 PY-36205 False unresolved attribute reference for enum value when enum inherits str or StrEnum
(cherry picked from commit 132c996908988bccc59035c033c21325c48a6016)

GitOrigin-RevId: 8a968f2c4b2bac5c77ca60b1e22b78afc77b1eef
2024-12-17 13:31:48 +00:00
Andrey Vokin
1f72432cd7 PY-74269 In-product survey about the user's job
(cherry picked from commit 11cde9a1ce72ed0342739ec26b5deaf7cc163c5d)

IJ-CR-151713

GitOrigin-RevId: 4cd0ff5d3551bc8afe8521b989a3358fd88d4c90
2024-12-17 11:04:58 +00:00
Mikhail Golubev
6e515ed9b8 PY-77433 Don't report mutable field defaults in dataclass_transform-based dataclasses
Some dataclass implementations, such as Pydantic, allow declaring fields with
mutable defaults, deep-copying them under the hood.

See https://docs.pydantic.dev/latest/concepts/models/#fields-with-non-hashable-default-values


(cherry picked from commit e495621858950976226731dddbb01af4012704fa)

IJ-CR-151192

GitOrigin-RevId: 7412272584a4c26e404d3d84e6150f974027eca7
2024-12-11 17:33:12 +00:00
Egor Eliseev
604b412918 PY-70408 Debugger skips all breakpoints in a single test file with the name "test_common.py"
Merge-request: IJ-MR-149769
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit c517d3b49a16889c80ecf3e6f46e35380a9e8277)

IJ-MR-149769

GitOrigin-RevId: b5ccbefc1fba7708b9a2e8b59db3c23c69c96e72
2024-12-11 12:24:18 +00:00
Egor.Eliseev
32facefd58 PY-77400 Generate Cython files
(cherry picked from commit 1c6183cf5781265282d30b678e3323a6ab26cd86)

IJ-MR-150846

GitOrigin-RevId: 868a601696bf497e8e88a3774f44476ef0cf2036
2024-12-04 23:11:36 +00:00
Ilya.Kazakevich
5666495862 PY-77813: Report new project type broken in NPW.
FUS statistics consists of two parts:
1. Interpreter (i.e "venv" or "conda")
2. Project generator type ("Django" or "Flask")

`com.jetbrains.python.newProjectWizard.collector.PythonNewProjectWizardCollector.GENERATOR_FIELD` was a class without any limitation and `DirectoryProjectGenerator` instance was reported (i.e one for Django).

When migrated to NPW, we:
1. Dropped most old generator classes
2. Called this function providing `this::class` by accident, and it was `CoroutineScope`, so we finished with lots of `CoroutineScope` as generator type in FUS.

We must:
1. Provide old names for project types to preserve statistics.
2. Make it type-safe this time.

We also found that interpreter statistics is nullable for `PySdkCreator` which isn't true: SDK creation statistics is always not null.

So we:
* Introduce interface for project generators that reports "name for the statistics"
* Implement it both for DS and PyCharm by returning class name by default
* Overwrite it for several well-known generators to preserve statistics (use old named of now-deleted classes)
* Make interpreter statistics not null.


(cherry picked from commit bdfa73ba043d3584c6ba1871bca7a464a550bc21)

KT-CR-19191

GitOrigin-RevId: 53f874c18d67d33083cf8508a58be257b5e89ab7
2024-12-04 01:39:37 +00:00
Aleksandr Izmailov
fa7590530b [aia] IJPL-172594: Disable AI Promo Window in PyCharm Community
(cherry picked from commit 7bc97a704f426a1f02c06bb17415d2fd651a01b4)

IJ-CR-150127

GitOrigin-RevId: 5ff6f4d3cba4689f40e21a30f2dc72ff67be5ef9
2024-12-03 21:14:36 +00:00
Egor Eliseev
ab01b20a6b PY-72345 Pycharm 2024.1 Broken debug on Python 3.12.3
1. Fix the registration of the `PY_RETURN` signal. Stop unregistering the `PY_RETURN` signal for a `code: CodeType` after the first processing of `PY_RETURN`.
2. Fix the `LINE` callback during stepping and `SMART_STEP_INTO` commands.
3. Fix the `PY_RETURN` callback. Added handling for `SMART_STEP_INTO` and `STEP_RETURN` commands.
4. Fix the `_should_enable_line_events_for_code` function. Registration of the `PY_RETURN` and `LINE` signals for a `code: CodeType`.


Merge-request: IJ-MR-149452
Merged-by: Egor Eliseev <Egor.Eliseev@jetbrains.com>

(cherry picked from commit 8590efb7a1b2d8d6ca2393f18dcbca795e35d211)

IJ-MR-149452

GitOrigin-RevId: 4a157651e52072f3bdc186a61af7562e05a53da7
2024-12-03 16:41:46 +00:00
Aleksandr.Govenko
d5f9bf8de0 PY-55548 Use actual return type for "Specify return type using annotation"
For async functions, unwrap return type from Awaitable or Coroutine


Merge-request: IJ-MR-146295
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 9fe8d02a9d8bb584b9d6972ce999912bd93875e6)

IJ-MR-146295

GitOrigin-RevId: 9bad4877a069268a2d0181cac70b9a0d399cb5e6
2024-12-03 16:06:45 +00:00
Egor.Eliseev
3fca8d0790 fixup! PY-75638 Debugger trims value copy of a variable
(cherry picked from commit 17fc391ec1ae7f3bf3110ef34aa307298e92a04b)

IJ-MR-150450

GitOrigin-RevId: 837b356b28c4c86ded67fff8569e1ab398d8f5c3
2024-11-29 13:37:24 +00:00
Egor.Eliseev
a3d2a5be84 PY-75638 Debugger trims value copy of a variable
(cherry picked from commit ecd32c00e28a0c396459d7f81e52b3668bf3e2a2)

IJ-MR-150450

GitOrigin-RevId: bc3806cb417ca6ba756760ffe9851dc3ce9a9921
2024-11-29 13:37:24 +00:00
Irina Fediaeva
ca48a33cce PY-52574: Rephrase docstring formatter error message
(cherry picked from commit 0160800e29a630657b068f71894fef984eb8e5c9)

IJ-CR-148150

GitOrigin-RevId: da5a6e3ad423934657d8a163632564a0ab95095e
2024-11-28 01:35:55 +00:00
Irina Fediaeva
92365f2246 PY-52574: Update tests after removing Epytext docstring format
(cherry picked from commit d4a90a8da56ca889cf380aa5bc72ac82b0716abc)

IJ-CR-148150

GitOrigin-RevId: 235a0e447d84c96e9963235615b07a1caf371e74
2024-11-28 01:35:54 +00:00
Irina Fediaeva
2ac1a788e3 PY-52574: Remove Epytext docstring format & Py2 docstring rendering
Docstring rendering is no longer supported for Python 2, which became obsolete after reaching its end of life in 2020. Without updates or security patches, most tools, including documentation generators like Epydoc, have shifted focus exclusively to Python 3.


(cherry picked from commit ace78ac9ad943278449d5b20bb92db9f7571b5b5)

IJ-CR-148150

GitOrigin-RevId: 75cc87e05c61c3c17c26689552080e3c3082bfdc
2024-11-28 01:35:54 +00:00
Ilya.Kazakevich
02a8b8e3b6 PY-71771: Do not validate SSH interpreters using tools for local paths.
`isValidSdkHome` works for local paths only.
We must use `sdkSeemsValid` instead: it is aware of remote interpreters and usually ignores them if can't validate


(cherry picked from commit 31b42e14518f5a8f7a69ba35e50353f4f4894f42)

IJ-CR-149658

GitOrigin-RevId: b30a6bb5d8a6b9986b0690eabbd0d39da6310f01
2024-11-27 13:48:17 +00:00
Ilya.Kazakevich
9f31575c35 PY-77483, PY-75549, FUS-5195: Misc project pycharm (squashed commits from master)
Lots of files are picked from the master

GitOrigin-RevId: 88dfc699cbfa2be9b11d1645c2c24221d16fbdc4
2024-11-26 17:47:29 +00:00
Aleksandr Sorotskii
c45fbf5a97 fixup npe on additional data; #PY-76613 Fixed
(cherry picked from commit d287d9e07fe024e73551c3ff6e358be291cdc1fe)

IJ-MR-148504

GitOrigin-RevId: 79708c40ff115d77e253fb0095e3b1fa5bbc1d82
2024-11-26 17:12:55 +00:00
Mikhail Golubev
19a768b4d7 PY-77490 Evaluate language level only once per CFG traversal during name resolution
(cherry picked from commit 6c2a3d6eec7def72340feed8ae0ae2d6b54af6ff)

IJ-CR-149696

GitOrigin-RevId: 14edaf0fa2c49d69aa8d96883dc8b02dec7197e3
2024-11-25 22:38:29 +00:00
Mikhail Golubev
9d2070052f PY-77490 Inline private PyDefUseUtil.getLatestDefs to have access to the reference anchor element
(cherry picked from commit 0eecf0ffb305ab17d5758f20b44c4f2791ab0b02)

IJ-CR-149696

GitOrigin-RevId: 8efb9c569ea8c4c00226d3b4307ff5602f782098
2024-11-25 22:38:29 +00:00
Mikhail Golubev
b853978e3e PY-77490 Make sure PyDefUseUtil.getLatestDefs always accepts a non-null anchor
(cherry picked from commit e0ed8cedaffa90c259f4fd0cf8758e42face847b)

IJ-CR-149696

GitOrigin-RevId: 7a90e82dc6bc86fa5d5eae98951e90d13b445a15
2024-11-25 22:38:29 +00:00
Mikhail Golubev
bb5e98a07d PY-77490 Infer nullability annotations in PyDefUseUtil
(cherry picked from commit f993806b3d199160b8a18117fc6b473e52db13bb)

IJ-CR-149696

GitOrigin-RevId: 773c097981921257681a67c58fd6ba2190a3a9c2
2024-11-25 22:38:29 +00:00
Mikhail Golubev
535af53f05 PY-77168 Allow flow-sensitive resolve from unmatched version checks to reachable outer blocks
Also, don't query LanguageLevel for each element of each instruction,
only once per scope traversal.

This doesn't fix the problem with unreachable definition *inside* blocks under
unmatched version checks, i.e.

if sys.version_info < (3, 8):
    Alias = int
    expr: Alias # unresolved

but it's a more difficult problem how to handle those consistently with the idea
of unreachable version checks under the *current* interpreter version, and hopefully
it occurs rarer than, say, unresolved top-level imports of common names from typing.

(cherry picked from commit 55fd4597c6d0860d290caba15fbf4d313e985a86)

IJ-CR-149696

GitOrigin-RevId: 357ada7e10618aef75c470e6cd878f7672109e83
2024-11-25 22:38:29 +00:00
Petr
22cae80f9d PY-76076 Use proper python version for pyi files to evaluate version guards (PyDefUseUtil).
(cherry picked from commit cc6529de62f7c687c606697b9207170b7903f96d)

IJ-MR-147937

GitOrigin-RevId: 32b1f2d47fecc5592e5b93265c195ca3051497b9
2024-11-25 22:38:29 +00:00
Mikhail Golubev
3fdadc1b6b PY-40458 Use overridden method's return type for overrides only if both are async or synchronous
Because async generator methods in ABC and protocols are supposed to be declared as
plain "def" methods so as not to confuse type checkers with their AsyncIterable
return type annotations, it's better to disable such type-hint re-use if methods
async-ness don't match and not wrap anything in typing.Coroutine implicitly.

See also https://mypy.readthedocs.io/en/stable/more_types.html#asynchronous-iterators

(cherry picked from commit 6342f15a7786ec0d02ee1ab2b18fd40fd1ca1430)

IJ-CR-149694

GitOrigin-RevId: 3e19f190d9334e6c8648462ebb5b61abe931b0e6
2024-11-25 22:38:29 +00:00
Mikhail Golubev
fae8df34f4 PY-36416 Don't wrap return types of overridden async methods in Coroutine twice
(cherry picked from commit 48d01bedeb62d1a232704e58a3f39e3a7d543d2d)

IJ-CR-149694

GitOrigin-RevId: e431744a18f2b9d2976de7ee12888961e22f2298
2024-11-25 22:38:29 +00:00