Commit Graph

7548 Commits

Author SHA1 Message Date
Eric Traut
6ef2ca1b27 Updated typeshed stubs to the latest version. 2024-03-25 17:31:40 -06:00
Heejae Chang
1110ff90e4
push pylance to pyright (#7558) 2024-03-25 14:50:25 -07:00
Eric Traut
7cf91f78a2 Changed the logic for metaclass instance variable lookups to ignore the lookup if the metaclass MRO contains an unknown class. This addresses #7556. 2024-03-25 09:02:06 -06:00
Eric Traut
fe41569755
Fixed a bug that results in a false positive when a class-scoped TypeVar used within a method has a default that refers to another class-scoped TypeVar. This addresses #7553. (#7554) 2024-03-24 16:03:00 -06:00
Eric Traut
69a9151674 Added check for the use of a non-runtime-checkable protocol class in a class pattern. This generates an exception at runtime. This addresses #7551. 2024-03-24 11:46:16 -06:00
Eric Traut
bb95091f1c
Fixed bug that results in incorrect type narrowing in the negative (fall-through) case when a runtime-checkable protocol class is used as a class pattern with arguments within a match statement. This addresses #7550. (#7552) 2024-03-24 11:41:24 -06:00
Eric Traut
3da27fd549 Fixed bug that resulted in a false positive error if a PEP-695 type statement uses a type parameter and encloses the RHS in quotes. This addresses #7538. 2024-03-21 14:12:49 -06:00
Erik De Bonte
a6e787fd4e
Use hex char codes and show code points for surrogate pairs (#7541) 2024-03-21 12:44:55 -07:00
Erik De Bonte
7f468b8c5b
Update Unicode range tables to match Unicode 15.1 (#7539) 2024-03-21 12:16:18 -07:00
Eric Traut
52a47010b9
Tweaked bidirectional type inference behaviors for lists to improve certain inference cases. This addresses #7527. (#7528) 2024-03-20 13:06:06 -06:00
Eric Traut
01eaa6fa64 Fixed bug that results in a false positive error when a class-scoped TypeVar with a default that references another class-scoped TypeVar is used in a method signature in that class. This addresses #7525. 2024-03-20 11:36:51 -06:00
Eric Traut
a2831b7338 Published 1.1.355 2024-03-20 00:07:43 -06:00
Eric Traut
8c0f8a968a
Fixed bug that results in false positive error when a __new__ method in a metaclass uses PEP 692 (unpacked TypeDict) to annotate its **kwargs parameter. This addresses #7514. (#7518) 2024-03-19 03:26:02 -06:00
Eric Traut
02a66c5e66
Expanded handling of python versions to handle more than just major/minor version numbers. Pyright now handles micro, releaseLevel, and serial numbers as well. This addresses #7132. (#7510) 2024-03-18 00:56:18 -06:00
Eric Traut
5a64ddfe5e
Fixed a bug that results in a false positive in a complex situation that involves generic protocols, properties, and mix-in classes. This addresses #7400. (#7506) 2024-03-17 10:36:21 -06:00
dependabot[bot]
6fd9d50b4a
Bump follow-redirects from 1.15.5 to 1.15.6 (#7504)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.5 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.5...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-17 00:13:27 -06:00
Eric Traut
c7beec11c2 Fixed bug that results in a false positive "overload implementation does not match overloads" diagnostic when positional-only and keyword-only parameters are involved. This addresses #7473. 2024-03-16 17:14:51 -06:00
Eric Traut
b0d18cff0c Fixed bug that results in a false positive error when a base class defines a writable property and a subclass writes to the property. This addresses #7478. 2024-03-16 13:22:12 -06:00
Eric Traut
cb2c493dab Fixed a bug that results in a false positive error in certain circumstances involving a TypeVarTuple used within an overload. This addresses #7502. 2024-03-16 13:14:06 -06:00
Eric Traut
0f9dc4758f
Fixed bug that results in a false negative when overriding a method that has keyword parameters with a method that has a *args parameter. This addresses #7480. (#7501) 2024-03-16 11:48:08 -06:00
Eric Traut
7320a6d31a
Improved validation for except and except* statements to catch some previously-undetected invalid cases. This addresses #7483. (#7500) 2024-03-16 10:28:55 -06:00
Eric Traut
8115955fae
Fixed bug that results in false positive when a list or set expression is evaluated using bidirectional type inference when the expected type is MutableSet or MutableSequence. This addresses #7498. (#7499) 2024-03-16 00:27:38 -06:00
Eric Traut
114817af10
Updated typeshed stubs to the latest. This version of typeshed replaces the older-style positional-only parameters with PEP 570 syntax. (#7493) 2024-03-15 08:48:52 -06:00
Eric Traut
ca142066b3
Fixed bug that results in false positive when implicitly specializing a class parameterized by a TypeVarTuple when there is no default. This addresses #7489. (#7491) 2024-03-15 01:00:00 -06:00
Eric Traut
c6f8b83c4a Renamed typeUtils function for consistency. 2024-03-14 23:53:21 -06:00
Eric Traut
18243af812
Fixed bug that results in a false negative when a TypeAliasType object is used in a class pattern. This addresses #7485. (#7486) 2024-03-14 13:43:02 -06:00
Eric Traut
d7dc004c78 Fixed a bug that results in incorrect type evaluation if a list expression includes a generator expression. This addresses #7481. 2024-03-14 10:54:44 -06:00
PylanceBot
6c4b329177
pull-pylance-with-pyright-1.1.354 (#7476)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-13 11:03:37 -07:00
Eric Traut
0a73f4b0f5 Published 1.1.354 2024-03-13 09:22:00 -06:00
Eric Traut
0334a44b83 Fixed a bug that made locale overrides through environment variables no longer work on node 21. This change removes the ability to override the localized language through the use of the global navigator object. This previously applied only to browser, but now node 21 supports this, which means that pyright users had no way to override it. If the pylance team wants localization to work in a browser, they'll need to find a better way to abstract this so it doesn't break pyright. This addresses #7439. 2024-03-12 00:38:05 -06:00
Eric Traut
6a042f7b58
Added new reportUnhashable diagnostic rule. This addresses #7462. (#7464) 2024-03-12 00:34:58 -06:00
Eric Traut
3ccd7b87b5
Fixed a bug that results in a false negative when a class explicitly inherits from a protocol that defines an instance variable but the child re-declares as a ClassVar without an explicit type. This addresses #7455. (#7463) 2024-03-12 00:29:01 -06:00
Rich Chiodo
06bc912e38
Save some memory in token creation (#7434)
* Save some memory in token creation

* Found another 200k

* Fix wrong way to check for undefined

* Back out unnecessary regex change

* Remove 'ExceedsMaxSize'
2024-03-11 09:30:48 -07:00
Eric Traut
6e73064841
Fixed a bug that results in a false positive under certain circumstances when defining a type alias using the old typing.TypeAlias annotation. This addresses #7457. (#7458) 2024-03-11 09:40:44 -06:00
Eric Traut
0ff8b5aa1f
Changed the behavior when accessing a class attribute from a generic class that is not specialized. The class is now automatically specialized in the case using default type parameter values (from PEP 696) or Unknown. This change is required for conformance with PEP 696. It addresses #7445. (#7454) 2024-03-11 00:51:05 -06:00
Eric Traut
33cab2aefe Fixed bug that resulted in a false positive under certain circumstances when a constrained TypeVar is used as the default for another constrained TypeVar. This addresses #7446. 2024-03-10 16:17:57 -06:00
Eric Traut
d1b2f3331b Fixed style issue. 2024-03-10 14:58:00 -06:00
Eric Traut
37ecc8d0bb Fixed bug that resulted in false negative when narrowing a constrained or bound TypeVar with a complex() or float() class pattern. This addresses #7449. 2024-03-10 14:30:45 -06:00
Eric Traut
1ff3820b34 Fixed bug that results in false positive when a generic class or type alias uses a TypeVarTuple followed by one or more ParamSpecs that have default values. This addresses #7444. 2024-03-10 13:47:23 -06:00
Eric Traut
bbd78d5090 Added check for generic classes and type aliases that include a TypeVarTuple followed by a TypeVar that has a default value. This is illegal according to PEP 696. This addresses #7443. 2024-03-10 12:41:44 -06:00
Eric Traut
1d658bb835 Fixed two bugs that resulted in false negatives when redefining a constant variable with a non-variable symbol and when redefining a Final variable with a non-variable symbol. This addresses #7440. 2024-03-09 18:07:57 -07:00
Eric Traut
209fac9a2c Enhanced handling of type function when it is passed a class. Pyright previously evaluated this as Any, but now it returns the class' metaclass. This addresses #7437. 2024-03-09 08:34:13 -07:00
Eric Traut
39960f39e4
Fixed a bug that resulted in an incorrect type evaluation when an augmented assignment is used within an inner-scoped function to add a constant to a variable. Literal math should not be used in this case. This addresses #7431. (#7436) 2024-03-08 21:59:50 -07:00
PylanceBot
a612aa9871
[PylanceBot] Pull Pylance with Pyright 1.1.353 (#7428)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-08 11:06:09 -08:00
Eric Traut
114501e336 Published 1.1.353 2024-03-07 21:15:42 -07:00
Eric Traut
a434dfb535
Fixed bug that resulted in a false negative when a possibly-unbound variable is captured by an inner scope under certain circumstances. This addresses #7384. (#7427) 2024-03-07 20:12:20 -07:00
Eric Traut
38123df9e9
Fixed a bug that results in incorrect type narrowing behavior for member access expressions under certain circumstances. This addresses #7414. (#7426) 2024-03-07 18:38:38 -07:00
Eric Traut
34faf10e13 Removed inappropriate use of typeAtStart value in code flow engine. 2024-03-07 18:05:59 -07:00
Eric Traut
e39bc677af Further simplified interface to code flow engine. No functional change. 2024-03-07 18:05:59 -07:00
Erik De Bonte
6a8ae9215a
Show str method docstrings when called on LiteralString (#7388) 2024-03-07 13:10:27 -08:00