Commit Graph

132 Commits

Author SHA1 Message Date
PyCharm Automation Bot
cadd0b15df Update typeshed version to f8773eb27a29946d3c56dbdcb683c7e6413dbf21
GitOrigin-RevId: adc61539e24fdf9b9d895546cc70a0c8870c9659
2025-09-02 13:32:35 +00:00
evgeny.bovykin
37ba08cc8d PY-74332 Patch typeshed: remove xxlimited.pyi
GitOrigin-RevId: 63799caadb71cdc2abf3c7498f5968ba5d2dcb16
2025-08-21 11:05:23 +00:00
evgeny.bovykin
b58fa5467b PY-74332 Patch typeshed: Restore python2 folder
GitOrigin-RevId: d95bbd14b182315c504c9b2c7943163eecea03b1
2025-08-21 11:05:23 +00:00
evgeny.bovykin
37a4e639a8 PY-74332 Patch typeshed: Restore SQLAlchemy and Flask-SQLAlchemy
GitOrigin-RevId: ab77ea6b5faeb37bd8b687ab3e859818f5e6eb6a
2025-08-21 11:05:23 +00:00
evgeny.bovykin
7e2d1c4cd6 PY-74332 Patch typeshed: import collections.abc using X as X instead of X syntax
GitOrigin-RevId: 3bc82ccaedfdfeec81fa06027487cf092deb26ef
2025-08-21 11:05:23 +00:00
evgeny.bovykin
19e8b9a19c PY-74332 Update typeshed manually
GitOrigin-RevId: 8d4b91f89d26c6fa0f6370a9341e750eee2428f8
2025-08-21 11:05:23 +00:00
Morgan Bartholomew
eff9a0e663 [python] PY-81542 remove paho-mqtt stubs
GitOrigin-RevId: 8b146fc53ce0dc0da318152a987764f25bbb4e8b
2025-05-30 14:43:13 +00:00
Morgan Bartholomew
4b1d24562a [python] PY-80436 support ellipsis
GitOrigin-RevId: 82e38fcb502ed68d5676f2cc774ef2653d69febb
2025-05-29 01:00:27 +00:00
Daniil Kalinin
10969f37de PY-79967 Stubs: move string.pyi contents to string/__init__.pyi
GitOrigin-RevId: 12161fa9a897ed9a0322fe69784b3edc67748b43
2025-04-28 19:14:39 +00:00
Koudai Aono
7239d2ef2c PY-79967 Support t-prefixed strings, Related PR: https://github.com/JetBrains/intellij-community/pull/302
* Add PYTHON314_PREFIXES to CompatibilityVisitor
* Patch typeshed, add t-string related stubs
* Infer `string.templatelib.Template` type for t-strings instead of plain `str`



GitOrigin-RevId: 0e913910ab9e0dca4052856b0585ce66265291c0
2025-04-28 19:14:39 +00:00
evgeny.bovykin
235ddff8af PY-53599 Manually update tensorflow Typeshed. Enable enable.tensorflow.pyi.stubs by default
New Tensorflow Typeshed has updated stubs for the keras module, as well as for other Tensorflow modules. So PY-65966 should not be reproducible anymore

GitOrigin-RevId: 929e1da40c82bf6dd26efd227c0421087df3b75c
2025-03-25 19:12:05 +00:00
Andrey Vokin
3f295d3e6c PY-73263 Python 3.13 Support - Code Insight - Typeshed
Support hashable and other implicit protocols

GitOrigin-RevId: 96abbd57142f4b105f54e728fac746402440e3bd
2024-09-09 13:54:00 +00:00
Andrey Vokin
1041f5e6a0 PY-73263 Python 3.13 Support - Code Insight - Typeshed
GitOrigin-RevId: 94973415b96b2a0f859d29b0201d1ccee0d06462
2024-09-09 13:54:00 +00:00
Andrey Vokin
9293cc2ad7 PY-73263 Python 3.13 Support - Code Insight - Typeshed
update dataclass typeshed

GitOrigin-RevId: bda7fda7ef235351f9ec6b21aa9021d6dcbd8b80
2024-09-09 13:54:00 +00:00
Andrey Vokin
80934bca38 PY-73263 Python 3.13 Support - Code Insight - Typeshed
update class enumerate

GitOrigin-RevId: 95fc30b01c3c99144fec4f36188dc28875b3dc42
2024-08-08 21:53:20 +00:00
Andrey Vokin
09ac564e51 PY-73263 Python 3.13 Support - Code Insight - Typeshed
PY-73099 Support PEP 705 – TypedDict: Read-only items

GitOrigin-RevId: f9596fdc5d0f6a9318abd4aa1366b0c94a5487fd
2024-08-07 10:13:26 +00:00
Petr
93b9066edf PY-34617 Support version check
GitOrigin-RevId: 3318ff79cdcc5ba0ce5e4feb65abad5ad0f4acfa
2024-07-28 00:24:15 +00:00
Andrey Vokin
673383c3da PY-61651 Deprecation highlighting with PEP 702 @deprecated decorator
GitOrigin-RevId: 426e7001d20849d7029fea55431d3e2cfae3eb11
2024-06-10 15:58:53 +00:00
Mikhail Golubev
d99a86efeb PY-35190 Fix resolving the register method of ABCMeta
The root cause was introduced in PY-23540 (see cb598c94c5).
Namely, abs.ABCMeta was explicitly filtered out from the list of metaclasses in
`PyClassImpl.getMostDerivedClassType` because for some reason in Typeshed stubs for
Python 2 `basestring`, and hence `str`, uses `ABCMeta` as its metaclass,
which is not true at runtime. It caused a metaclass conflict when inheriting `str`
with another user-defined metaclass (`ABCMeta` and a user metaclass didn't extend
each other), so we didn't detect any metaclass in a class as a result.

I've updated Typeshed stubs for Python 2 manually to process ABCMeta normally.
We don't update these stubs anyway, so these changes won't be lost on a future
Typeshed sync.

GitOrigin-RevId: 680e9fa890d00ea63987f3cf73e636e430685f34
2024-05-28 08:41:05 +00:00
Mikhail Golubev
93ac5fe566 PY-70528 Add support for typing_extensions.TypeVarTuple and Unpack
I've add-hoc updated typing_extensions.pyi in the bundled Typeshed to
recognize Unpack there.

GitOrigin-RevId: 953402e42984712a630c1772cf2f2cd4cbacdccf
2024-05-28 01:10:05 +00:00
Andrey.Matveev
c8942900df PY-63273 Restore SQLAlchemy and Flask-SQLAlchemy
GitOrigin-RevId: 0a3731899cc9d108839dd89128a2d3e583e8c56b
2023-11-10 17:48:23 +00:00
Andrey.Matveev
9aec9be967 PY-63273 Restore @python2
GitOrigin-RevId: f0bcf7431f279abab4332048fbdbadb0b221f44e
2023-11-10 17:48:23 +00:00
Andrey.Matveev
93919e49b3 PY-63273 Remove DataclassInstance related things
Issue: PY-63688

GitOrigin-RevId: 1c27f8d7d709bca75cb2b91abeacc5365d5ebab0
2023-11-10 17:48:23 +00:00
Andrey.Matveev
7d9e2720df PY-63273 Remove overloads of write and writelines
Issue: PY-63689

GitOrigin-RevId: 683e93628761b0f4ea7b6f9a048a25a6630eec48
2023-11-10 17:48:23 +00:00
Andrey.Matveev
5f61744b47 PY-63273 Revert __new__ to __init__
Issue: PY-62301

GitOrigin-RevId: 3f3738447b7cff0ff27953492189eb99527bd948
2023-11-10 17:48:23 +00:00
Andrey.Matveev
9a26cf0c14 PY-63273 Revert NewType function remove class
Issue: PY-34617

GitOrigin-RevId: 72fe29747517bfe58fd0b1c75376b52799dad4a9
2023-11-10 17:48:23 +00:00
Andrey.Matveev
4b088c972e PY-63273 Change order of if sys.version_info in collections
Issue: PY-34617

GitOrigin-RevId: 7e688d37a0fb518736d7df16d214121d2082259d
2023-11-10 17:48:23 +00:00
Andrey.Matveev
5a1bf3501e PY-63273 Update typeshed: run script
typeshed commit hash: 21fcd8960f1dae5ec4563dd99860d0918efe5cff

GitOrigin-RevId: 0fd8f2c47be13006dbfd556d1ae57f0bbb23d1bd
2023-11-10 17:48:22 +00:00
Andrey.Matveev
c24752ceb1 PY-58752 Impl inspection for check matching override signature
GitOrigin-RevId: 4520138ac657a514b53f2f939521f0336701be46
2023-10-22 10:27:24 +00:00
Mikhail Golubev
a14c9ef92c PY-53105 Support PEP 646 and TypeVarTuples. Take 2.
The introduction of TypeVarTuples and the concept of unpacked tuple types made us
revise all the places where we match sequences of types in type inference.
For instance, when matching type parameters and type arguments for generic
specialization in:

* type hints, i.e. xs: MyGeneric[int, str] = MyGeneric()
* constructor invocations, i.e. xs = MyGeneric[int, str]()
* class declarations, i.e. class MyGeneric(Base[T1, T2, str]): ...
* type alias declarations, i.e. MyAlias: TypeAlias = MyGeneric[T, int]

as well as during type matching of all generic types, both normal non-variadic and
existing "built-in" generic variadics in the type system, namely tuples and
Callables.

Previously, this logic was spread across numerous places in PyTypeChecker and
PyTypingTypeProvider, all with their own subtle differences. The first attempt
of PEP 646 support put all the code for uniform matching of type parameters directly
in PyTypeChecker, significantly complicating its already arcane internals.
I've introduced a unified API for that called PyTypeParameterMapping.
It still retains some of the former quirks in form of its Option flags, controlling
in particular how we handle having some of the expected types unmatched
(imagine expecting MyGeneric[T1, T2, *Ts] and receiving MyGeneric[int]),
but I'm planning to gradually eliminate this conditional logic.

The same class is now also responsible for matching parameter types of callables
that already allowed to fix some of the known problems, such as ignoring their
arity (PY-16994), but I'm going to extract a separate API entity for that, since
matching of callable signatures is a much more complicated task involving
compatibility of different types of parameters (positional-only, keyword-only,
defaults, varargs, etc.).

Another positive side effect of these changes is that substitution of type
parameters during type inference became more consistent, and we no longer lose
useful type information by replacing all unbound type parameters with Any. It's
particularly visible in type checker errors where we stopped dropping unbound type
parameters from messages about mismatched parameter-argument types.

Among other improvements in this changeset are proper scoping for
TypeVarTuples, consistent with other type parameters, and recognizing TypeVarTuples
and unpacked tuples in types of *args parameters in function bodies, e.g.
`*args: *Ts` translates to "args" parameter having the type `tuple[*Ts]`.

Confusing PyNoMatchedType used only for reporting of missing arguments for *args
parameters annotated with unpacked tuples in the type checker inspection, e.g.

def f(*args: *tuple[int, str]): ...
f(42)  # a type checker error about a missing argument for str

was also removed from the type system in favor of a simpler approach with handling
such errors directly in the inspection. We might need such a general type in
the future, but it has to be well thought-through.

GitOrigin-RevId: 63db6202254205863657f014632d141d340fe147
2023-10-20 13:38:06 +00:00
andrey.matveev
a75c569022 PY-53105 Support TypeVarTuple
GitOrigin-RevId: f8160e9d802b09991daa710ed9a20f3e30d455da
2023-10-20 13:38:04 +00:00
Pavel Karateev
904c6d68ea [python] PY-63580 Sync sys with the latest typeshed to include sys.monitoring
Introduced by 838dd3a5ba

GitOrigin-RevId: 1ba68c25956ede8c6a8afe3cd8560720d8ed7b95
2023-10-17 23:24:36 +00:00
lada.gagina
015a641eb9 Undo the rollback in builtins
Since PY-53896 got implemented, I'm making builtins up-to-date. They were reverted to workaround PY-52648 & PY-52656

GitOrigin-RevId: f7bacdc06c0bc0669ec8cb65ec64eec02834d2a1
2023-04-14 12:44:47 +00:00
lada.gagina
18590c0781 Sync with typeshed @ f611d18f70fd9f20797c832f10bba3bfb9d99e47
[PY-59793](https://youtrack.jetbrains.com/issue/PY-59793/Sync-bundled-typeshed-f611d18f70fd9f20797c832f10bba3bfb9d99e47-sep-22)

GitOrigin-RevId: 9dcaafbd9bf1bc6f077e130042883a7a0436961f
2023-04-14 12:44:45 +00:00
Mikhail Golubev
2135871356 PY-57541 PY-53896 Add missing AnyStr_co to partially updated Typeshed
Its absence made Py3TypeCheckerInspectionTest.testPathlibPathMatchingOsPathLike
fail as os.PathLike protocol wasn't considered generic. Once the changes
for generics are in the upstream, we will be able to update the Typeshed
fully at long last.

GitOrigin-RevId: 1333cc19bff15e328996c57362124a7fdb5ab057
2023-01-24 08:56:54 +00:00
lada.gagina
f5db62e099 Sync with typeshed @ df905102da05e99e7e7cd6cd0a1e3ddea2eddba2 (excluding the python2 removal)
[PY-57541](https://youtrack.jetbrains.com/issue/PY-57541/Sync-bundled-typeshed-df905102da05e99e7e7cd6cd0a1e3ddea2eddba2)

GitOrigin-RevId: 50eb01e74255002005343caa51bf8eb21c6028a6
2023-01-13 18:45:18 +00:00
lada.gagina
293bb95998 Sync with typeshed @ 460537c7f69ea36aa9ad12ca1bfb48ea56239462
Fixes PY-53839, PY-56090, PY-55053, PY-57120, PY-53965, PY-56368, PY-54532

GitOrigin-RevId: 1b80465a7c72f89f48b22d35b69e4da4ea1efd46
2022-11-21 14:46:32 +00:00
andrey.matveev
44cc11bb75 PY-44557 Update flask_sqlalchemy stubs in typeshed to inference Query type for Model.query
Type annotation Model for SQLAlchemy.Model will appear in 6a9c06edb95c9ecae7a76789e906fbbd420e5a25

GitOrigin-RevId: a4c601d534630253489fef55d08ce5afaa41d3c4
2022-09-20 11:03:27 +00:00
andrey.matveev
254902f1b5 PY-31296 Add annotation for __iter__ in stubs and comment special case in SQLAlchemyTypeProvider
The changes in typeshed will be in 0e4ea44080cff090ead62943de15487963ef0b2a and 234250384dad99367c181f2c8e2370ae2a2e3e83 revisions

GitOrigin-RevId: 9ee9953b0efa7f98cac2ee23756a30cf25e0fdb2
2022-08-03 13:14:49 +00:00
Mikhail Golubev
bb7e382697 PY-52648 PY-52656 Revert problematic Typeshed changes and add regression tests
This is a workaround until PY-53896 is implemented.

It effectively brings the stubs for builtins in Typeshed to their state at
37ee52ec2d883d8bbf244e4d1a871cde7f678d17, with the exception that I kept new
definitions for __build_class__ and ExceptionGroup (for 3.11).

GitOrigin-RevId: 92fdf169d228c52bcefa7edc3f185cb931ff4d79
2022-07-20 17:19:46 +00:00
Lada Gagina
b8c68586bc Sync with typeshed @ 4e87b9058f0908fa895076c0d9643e18be785be6 (PY-41510)
GitOrigin-RevId: 31a3e761d5a4e2508e2eceb33170e8283bedcb36
2022-03-15 14:03:04 +00:00
Semyon Proshev
38dd9d9e84 Sync with typeshed @ 7682ae957a32686becaf884de26cf79c9de5b221 (PY-41510)
GitOrigin-RevId: b199b44b7611b70ddc52848dfc4f71684f49e711
2022-02-14 16:49:39 +00:00
Semyon Proshev
d09cfa814b Sync with typeshed @ 48f13e451a3ef21002cca3f3b325ff3635f32d66 (PY-41510)
GitOrigin-RevId: b758ee90685ea9ad1e70cd8df2ea92afcb3f0f35
2021-12-24 13:26:30 +00:00
Semyon Proshev
2260f4b7d8 Enable more stubs from typeshed (PY-41509)
GitOrigin-RevId: 0ec9af526f5e90502b9411c806cd1d8170d71482
2021-10-18 16:33:51 +00:00
Semyon Proshev
59a6eeaae4 Sync with typeshed @ 53087be4eb935e5db24e9dddad3567ecaf1909a7 (PY-41510)
GitOrigin-RevId: 37ee52ec2d883d8bbf244e4d1a871cde7f678d17
2021-10-18 16:02:12 +00:00
Semyon Proshev
644ab20a24 Enable more stubs from typeshed (PY-41509)
GitOrigin-RevId: 70e4e01cef508a36c2cdf780c13f07d5d1ee3ddc
2021-08-19 17:20:27 +00:00
Semyon Proshev
7f77fb1c37 Sync with typeshed @ 837b57fdd1a814237ef4b15f6ce19c701303aebb (PY-41510)
Temporarily exclude https://github.com/python/typeshed/pull/4987
Temporarily exclude https://github.com/python/typeshed/pull/5206 from `collections/__init__.pyi`

GitOrigin-RevId: 6146af923d749b0cff56e823101b8f2b8525383d
2021-08-18 15:24:40 +00:00
Semyon Proshev
40e13e1069 Sync with typeshed @ 55a2a180c6f095d7a897ac5da3f7e0e7f8dd908b (PY-41510, PY-44548, PY-46355, PY-48948, PY-48958)
Temporarily exclude https://github.com/python/typeshed/pull/4987
Temporarily exclude https://github.com/python/typeshed/pull/5206 from `collections/__init__.pyi`

GitOrigin-RevId: 1bf4e6120ecd5927a113716878e503239ba33873
2021-05-27 10:14:40 +00:00
Semyon Proshev
fbadbbc40d Sync with typeshed @ 2c8cb605961bf76a88f9c21624893e4368ac3638
Temporarily exclude https://github.com/python/typeshed/pull/4987
Temporarily exclude https://github.com/python/typeshed/pull/5206 from `collections/__init__.pyi`

GitOrigin-RevId: 78775cc6c09fd8d867d8f46bf9908bd5cdbb05f6
2021-04-28 00:06:58 +00:00
Semyon Proshev
2465b8a67d Enable pyi stubs for several modules (PY-41509, PY-46229)
_ast, _dummy_thread, datetimerange, dummy_thread, dummy_threading, formatter, jwt, platform, string, thread

GitOrigin-RevId: a8010a0bd2381712599be0f96b35ce74e3e0c7d2
2021-03-03 22:46:06 +00:00