Граф коммитов

8055 Коммитов

Автор SHA1 Сообщение Дата
Heejae Chang 2fecb178fd
removed duplicated code and use same method to create default workspace key (#8893) 2024-09-04 11:23:40 -07:00
Eric Traut 56183a3de4
Fixed recent regression that results in a false positive under certain specific circumstances involving higher-order functions that return generic callable types. This addresses #8852. (#8892) 2024-09-04 10:55:00 -07:00
Eric Traut bf2c2bd7c5
Fixed a recent regression that results in a false positive type error when converting certain constructors (such as for the class `defaultdict`) to a callable type. This addresses #8840. (#8890) 2024-09-04 10:14:14 -07:00
Eric Traut dda4b84b75
Fixed a recent regression that results in incorrect type evaluation when using a two-argument form of `super()` and the second argument is `type[Self]`. This addresses #8763. (#8889) 2024-09-04 08:13:39 -07:00
Eric Traut 8312965d54 Published 1.1.379 2024-09-03 16:40:12 -07:00
Eric Traut 7abaf1996a
Fixed a bug that results in confusing hover information for an attrs … (#8883)
* Fixed a bug that results in confusing hover information for an attrs field that uses a converter. This addresses #8881.

* Restored previous behavior for modules.
2024-09-03 13:49:03 -07:00
Bill Schnurr 354d467593
Fixed rename step in Release pipeline (#8882)
* Update azure-pipelines-release.yml for Azure Pipelines

* Update azure-pipelines-release.yml for Azure Pipelines

* add back trigger
2024-09-03 10:12:14 -07:00
Eric Traut c29f903809 Fixed bug that results in incorrect type evaluation when assigning a recursive type alias to a tuple or list. This addresses #8879. 2024-09-02 14:29:44 -07:00
Neil Mitchell fe643945df
Fix a small typo in Understanding Type Inference (#8877) 2024-09-02 08:50:11 -07:00
Eric Traut 386b7fe0a5 Added check for concatenated bytes and str literals. This addresses #8871. 2024-09-01 17:45:21 -07:00
Eric Traut 689857dcf2
Added provisional support for draft PEP 747 and the `TypeForm` special form. (#8875) 2024-09-01 12:03:42 -07:00
Eric Traut 4773ded01f
Fixed a bug that can result in difficult-to-reproduce type evaluation errors when modifying code in your editor and using pyright as a language server. (#8873) 2024-09-01 08:14:44 -07:00
Eric Traut e43b6af921
Incorporated a bunch of code cleanup and refactoring changes from a side branch in preparation for new functionality. (#8872) 2024-08-31 16:09:35 -07:00
Eric Traut a1a83f114a Fixed bug that results in the incorrect type when the `Callable` special form is used in a value expression. 2024-08-30 14:51:31 -07:00
Eric Traut c979baf30b Updated some diagnostic strings to refer to "type expression" rather than "type annotation" since they apply to some cases that don't involve annotations. 2024-08-30 14:51:09 -07:00
Erik De Bonte ce64adc17b
Pull Pylance with Pyright 1.1.378 (#8851) 2024-08-28 16:05:36 -07:00
dependabot[bot] 2fa36386d0
Bump webpack from 5.90.1 to 5.94.0 in /packages/pyright (#8845)
Bumps [webpack](https://github.com/webpack/webpack) from 5.90.1 to 5.94.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.90.1...v5.94.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-27 20:55:52 -07:00
Eric Traut 9c003e9ff0 Published 1.1.378 2024-08-27 20:43:42 -07:00
Eric Traut 79a46a8dea
Fixed a bug that results in a false negative when overloads overlap due to default values. (#8844) 2024-08-27 14:26:36 -07:00
Eric Traut 2e11a3c6b9 Did a cleanup pass on overload tests, giving them better names. 2024-08-27 14:00:22 -07:00
Eric Traut 4dc82f79ff
Fixed bug that results in a `reportIncompatibleMethodOverride` diagnostic being reported in the wrong location in some cases involving decorators. This addresses #8842. (#8843) 2024-08-27 09:20:48 -07:00
Eric Traut 6c45f06e55
Fixed a bug that resulted in incorrect evaluation when converting a constructor to a callable and the constructed class has a metaclass with a `__call__` method whose `cls` parameter is annotated with `type[T]`. This addresses https://github.com/microsoft/pylance-release/issues/6297. (#8837) 2024-08-26 14:04:12 -07:00
Eric Traut e87bda9f02
Changed the default value of the `disableBytesTypePromotions` setting from `false` to `true`. It has been over two years since PEP 688 was accepted, so it's time for us to stop treating `bytes` as an alias for `bytes | bytearray | memoryview`. This is a breaking change and may require an update to the pyright configuration for some code bases. This addresses #8834. (#8835) 2024-08-26 11:40:16 -07:00
Eric Traut bdea6d0064
Added new type utils function isLiteralLikeType and fixed a few literal-related bugs that were masked by other logic. (#8828) 2024-08-25 09:43:28 -07:00
Eric Traut ecef512ade Improved consistency of error messages that involve type mismatches. Switched to the (now standardized) term "assignable". 2024-08-25 09:33:05 -07:00
Eric Traut 9e21b36ddc Minor code clean-ups from working branch. No functional change. 2024-08-25 09:30:31 -07:00
Eric Traut acc52c7420
Fixed bug that results in a crash in very specific circumstances that involve binding a method parameterized by a function-scoped ParamSpec. This addresses #8823. (#8824) 2024-08-23 19:31:04 -07:00
Eric Traut 020dea1381
Added some code improvements from a working branch: (#8822)
* Added some code improvements from a working branch:
* Created a shortened "fileId" for each source file. This reduces memory used for tracking symbols and TypeVars that are scoped to files.
* Removed some unused or redundant code.
* Added assertNever calls to catch potential bugs.
* Renamed a few symbols for consistency and readability.
* Improved handling of literal type expressions that are lazily parsed.
* Refactored literal type printing into a utility module.

* Fixed style issue.
2024-08-23 18:13:12 -07:00
Bill Schnurr b2d7ed5eaf
Fixed renaming vsix from version specific to general name (#8821) 2024-08-23 16:56:53 -07:00
PylanceBot ce3d4c1fb7
[PylanceBot] Pull Pylance with Pyright 1.1.377 (#8811)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-22 15:04:13 -07:00
PylanceBot ede08a0211
[PylanceBot] Pull Pylance with Pyright 1.1.377 (#8808)
* pull-pylance-with-pyright-1.1.377-10512633325

* remove duplicate line

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com>
2024-08-22 12:26:42 -07:00
Eric Traut 16879a1839
Fixed a bug that results in false negatives for errors in argument expressions used in a call to `functools.partial` in some cases. This same issue also causes symbols accessed in these arg expressions to not be marked as referenced. This addresses #8807. (#8809) 2024-08-22 10:48:21 -07:00
Rich Chiodo 38b1bd29c6
Ensure default version and platform only once (#8802)
* Ensure default version and platform only once

* Refactor execEnv creation to after everything else

* Fix tests to do the same thing as service

* Comment missing .

* Default python version to behave as it did before
2024-08-21 16:12:36 -07:00
Eric Traut a9bd905060 Fixed bug that results in incorrect logging of the pythonVersion string. This addresses #8798. 2024-08-21 08:47:48 -07:00
Eric Traut 2876baefd8 Published 1.1.377 2024-08-20 18:40:51 -07:00
Eric Traut 89193935f1
Added unreachable code reporting for case statements that are never matched based on type analysis. (#8788) 2024-08-20 08:04:53 -07:00
Eric Traut c8be6d8ab6 Updated typeshed stubs to the latest version. 2024-08-19 20:59:46 -07:00
Eric Traut 1a7ad15591 Integrating some code cleanups done on a working branch. 2024-08-19 20:53:11 -07:00
Eric Traut a93b66f06a
Fixed bug that results in a false positive error under very specific conditions involving a recursive type alias that is defined in terms of another type alias. This addresses #8784. (#8785) 2024-08-19 11:26:53 -07:00
Eric Traut 0b2dc24b79
Changed type checking logic to retain a reference to default expressions in function signatures, including synthesized signatures (such as `__init__` methods in dataclasses). This allows the original default value expression to be printed in error messages and language server strings. This addresses #8781. (#8783) 2024-08-19 10:04:17 -07:00
Eric Traut 48bb33b46b
Fixed a bug that leads to incorrect type evaluation in certain specific conditions involving a function decorator with an return type inferred from an inner function parameterized by a ParamSpec. This addresses #8779. (#8780) 2024-08-17 09:00:40 -07:00
Eric Traut bea4dc91b5
Fixed a bug that leads to a crash when `--pythonversion` and `--threads` CLI options are used together. This addresses #8775. (#8776) 2024-08-16 21:42:03 -07:00
Eric Traut c42a1587b4
Fixed a bug that results in a false positive error when assigning a `TypeGuard[T]` or `TypeIs[T]` to a supertype of `bool` (like `int`). This addresses #8769. (#8771) 2024-08-16 00:06:36 -07:00
Eric Traut ea55470da5
Fixed bug that results in a crash under certain circumstances when a ParamSpec without a scope is used illegally to specialize a class. This addresses #8757. (#8768) 2024-08-15 19:07:42 -07:00
Eric Traut deaf2641cf Refactored binary operator code for readability. No functional change. 2024-08-13 22:46:55 -06:00
Eric Traut 3a99a9cd67 Updated some out-of-date information in the documentation. 2024-08-13 21:59:31 -06:00
Eric Traut 7fd5ed20be Published 1.1.376 2024-08-13 17:56:41 -06:00
Eric Traut 75dfc6bbf9
Fixed bug that results in a confusing type in an error message when `isinstance` type narrowing between a `type` and another type creates a subclass. (#8753) 2024-08-13 09:33:21 -06:00
Eric Traut 796a483119
Fixed bug that leads to a hang under certain circumstances involving deeply-nested higher-order functions. This addresses #8723. (#8752) 2024-08-13 09:21:14 -06:00
Eric Traut c9a4eb2252
Changed behavior for protocols that have methods with method-scoped type variables. These are no longer treated as free type variables during protocol matching, so they can be used to support rank-2 polymorphism. This behavior is not currently dictated by the typing spec, but it is more consistent with mypy. This addresses #8685. (#8751) 2024-08-12 23:55:05 -06:00