Commit Graph

7204 Commits

Author SHA1 Message Date
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
Eric Traut
bf0388ba57 Fixed a bug in the isinstance type guard logic. It was not properly handling tuples that included unions. This addresses #7422. 2024-03-07 13:45:13 -07:00
Eric Traut
1536aa5f4b Simplified interface to code flow engine by moving some parameters to options object. No functional change. 2024-03-07 01:13:27 -07:00
Eric Traut
aea1839e7b
Fixed hard-coded type information for module attribute __package__. It should be str | None rather than str. This addresses #7408. (#7409) 2024-03-06 09:23:07 -07:00
Eric Traut
e8e8464038 Fixed a regression that caused the signature help provider to not display the __new__ method of a constructor if it is overloaded. This addresses #7405. 2024-03-05 15:56:15 -07:00
Eric Traut
d58393b630 Updated documentation for "implied else". 2024-03-04 10:49:40 -07:00
Eric Traut
f27b71e236 Fixed a bug that results in incorrect type evaluation when an index expression is assigned a value within a doubly-nested loop under certain circumstances. This addresses #7381. 2024-03-03 14:11:26 -07:00
Eric Traut
9dce19cc87
Fixed a bug that results in a false positive error when expanding the type arguments to a TypeVarTuple under certain circumstances. This addresses #7389. (#7390) 2024-03-03 00:35:43 -07:00
Eric Traut
c64f9b3f1f
Improved support for instance variables whose type is declared in a metaclass. Pyright now honors this type and enforces type consistency in derived classes. This addresses #7372. (#7387) 2024-03-01 11:28:07 -07:00
Eric Traut
97267a53d6 Added check for inappropriate use of Annotated passed as second argument to NewType call. This addresses #7383. 2024-03-01 09:15:26 -07:00
Eric Traut
9fd49f6a13
Fixed a bug that leads to a false positive error when a match statement is used in a loop and the subject expression is potentially narrowed as a result of the match statement. This addresses #7371. (#7377) 2024-02-29 12:15:32 -07:00
Eric Traut
28e71ace0d
Fixed a bug that results in a false negative when a dundered method overrides a base class method of the same name and uses different parameter names along with different types. This addresses #7373. (#7376) 2024-02-29 10:54:40 -07:00
Rich Chiodo
ab402404b3
Drop support for node 12 (#7375)
* Drop support for node 12

* Forgot to update package-lock.json
2024-02-29 10:47:42 -07:00
Eric Traut
1f8fd8e2b0 Enabled PEP 705 and PEP 696 functionality without the use of enableExperimentalFeatures now that they are accepted. 2024-02-29 09:34:35 -07:00
Eric Traut
e19d1e7758 Fixed a couple of translation bugs for French. 2024-02-29 00:46:07 -07:00
Eric Traut
08397a0db3 Published 1.1.352 2024-02-28 16:59:21 -07:00
Eric Traut
3586183cd8 Updated closed TypedDict implementation to match latest thinking in typing forum. It is now generally agreed that a dict cannot be assigned to a closed TypedDict under any circumstance. https://discuss.python.org/t/pep-728-typeddict-with-typed-extra-items 2024-02-28 16:45:57 -07:00
Eric Traut
c81b09e595 Changed behavior of command-line "--pythonversion" and "--pythonplatform" options so they now override the same-named options in the config file. This addresses #7330. 2024-02-28 16:36:49 -07:00
Eric Traut
1c84fc0062
Fixed a bug that results in an incorrect "Unbound" type evaluation for a variable assigned within a loop. This addresses #7217. (#7361) 2024-02-28 00:45:13 -07:00
Eric Traut
495bd5b36f Fixed a bug that results in a false positive error when an await expression is passed as an argument to an overloaded function. This addresses #7222. 2024-02-28 00:22:46 -07:00
Eric Traut
8e184445e2
Fixed a bug in the import resolver that resulted in an incorrect resolution when an import within a __init__.py file uses the form from .a import a. This addresses #7233. (#7360) 2024-02-27 20:05:45 -07:00
Eric Traut
a8ee9f5554 Added missing check for inappropriate use of InitVar outside of a dataclass. 2024-02-27 18:52:11 -07:00
Eric Traut
afc6bca5ca
Refined the heuristic for when to use bidirectional type inference for the RHS of and and or operators. This addresses #7245. (#7348) 2024-02-26 14:25:05 -07:00
Eric Traut
e50cb1c315 Improved handling of enum.nonmember in cases where the attribute has a declared type. This addresses #7346. 2024-02-26 12:16:14 -07:00
Eric Traut
162d6c39ae
Fixed a bug that results in a false negative when passing an unpacked dict of the wrong type to a function that contains a positional-only parameter marker plus one or more keyword parameters. This addresses #7271. (#7341) 2024-02-25 20:14:09 -07:00
Eric Traut
b04f03d383
Fixed a bug that leads to a false positive type violation when reassigning a value within a loop and the target variable has a declared type of a constrained type variable. This addresses #7302. (#7340) 2024-02-25 19:48:01 -07:00
Eric Traut
a8bc2bdf59 Fixed style issue. 2024-02-25 19:04:18 -07:00
Lucian Wischik
c0fbb93ee4
Debugging (#7332)
* launch.json CLI debug that bypasses webpack

I got a bit irritated in my edit-build-debug inner loop with the time to run webpack.

This commit adds a new launch target called "Pyright CLI (pyright-internal)" which bypasses webpack and just runs the package straight from the packages/pyright-internal/out directory where tsc has built it.

* fix outFiles directive

The VSCode docs say about outFiles:
> By default, VS Code will search your entire workspace, excluding node_modules, for sourcemaps. In large workspaces, this search might be slow. You can configure the locations where VS Code will search for source maps by setting the outFiles attribute in your launch.json.

I guess this is the right change to make? it didn't make any difference in VSCode debugger's ability to hit breakpoints, though.

---------

Co-authored-by: Eric Traut <eric@traut.com>
2024-02-25 15:26:06 -07:00
Eric Traut
f7e37d51b9
Added support for call-site return type inference for class and instance methods. This addresses https://github.com/microsoft/pylance-release/issues/5515. (#7335) 2024-02-25 14:50:28 -07:00
Eric Traut
3232c25589 Added special-case handling for 'typing_extensions' module whose stubs are part of typeshed's stdlib stubs even though it is not part of stdlib. This addresses #7318. 2024-02-24 05:13:20 -07:00
Eric Traut
22b94ae3c3 Fixed a bug that leads to incorrect type inference for a lambda when passed to a constructor in certain circumstances. This addresses #7326. 2024-02-23 14:09:10 -07:00
Eric Traut
218ee2f82c Fixed a bug that resulted in "reportUnnecessaryTypeIgnoreComment" diagnostics to be generated even if the source file was in the "ignore" list. This addresses #7325. 2024-02-23 11:04:16 -07:00
Eric Traut
c8f1f082fc Added support for concatenated strings used in a @deprecated decorator. This addresses #7319. 2024-02-23 08:09:20 -07:00
Eric Traut
2b36897227 Fixed a bug that resulted in a false negative when attempting to use TypedDict or Protocol as an upper bound when using PEP 695 syntax. This addresses #7317. 2024-02-22 14:39:51 -07:00
Eric Traut
e67047551e Improved consistency of documentation when talking about diagnostic settings. 2024-02-21 15:39:13 -07:00
Eric Traut
512e29e70e Documented support for PEP 728. 2024-02-21 15:34:05 -07:00
Eric Traut
bcf694bd9c
Implemented provisional support for PEP 728 (support for extra items within TypedDicts). You must set enableExperimentalFeatures to true for now. This addresses #7232. (#7313) 2024-02-21 15:33:28 -07:00
dependabot[bot]
87171fbf96
Bump ip from 2.0.0 to 2.0.1 (#7304)
Bumps [ip](https://github.com/indutny/node-ip) from 2.0.0 to 2.0.1.
- [Commits](https://github.com/indutny/node-ip/compare/v2.0.0...v2.0.1)

---
updated-dependencies:
- dependency-name: ip
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-20 12:11:31 -07:00
PylanceBot
e955fab18e
[PylanceBot] Pull Pylance with Pyright 1.1.351 (#7298)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-20 10:58:51 -08:00
Eric Traut
bc2544c996 Published 1.1.351 2024-02-19 15:25:09 -07:00
Eric Traut
6078f3deea Fixed build break. 2024-02-19 15:17:19 -07:00
Eric Traut
9265ebd4b0
Added check for the use of an implicit position-only parameter (one that starts with a double underscore) that is located after a non-position-only parameter. This addresses #7290. (#7297) 2024-02-19 15:13:25 -07:00
Eric Traut
9af0c64c88
Fixed a bug that led to incorrect type evaluation for a call that targets a generic function that uses a default argument for one of the generic parameters. This addresses #7291. (#7296) 2024-02-19 14:23:27 -07:00
Eric Traut
8cc8a75bf6 Fixed a bug that results in a false positive with the reportUnnecessaryCast check if the second argument is a special form. This addresses #7294. 2024-02-19 09:10:10 -07:00
Eric Traut
9e32b8fd57 Updated documentation to indicate support for PEP 742. 2024-02-19 01:17:00 -07:00