Commit Graph

5886 Commits

Author SHA1 Message Date
Eric Traut
c7ab8045ba Performance: Further improved perf when determining type compatibility of unions with many subtypes. This further reduces the analysis time of pydantic from 12s to 4s. This addresses https://github.com/microsoft/pyright/issues/4781. 2023-03-16 09:12:51 -06:00
Eric Traut
99c73a0f7d Performance: sped up type analyzer by 5-25% by caching types that have been converted to or from an instance. This drops the analysis time of pydantic from 17s to 12s. 2023-03-16 08:15:56 -06:00
Eric Traut
2ca9a8af4a Fixed regression that resulted in a false positive error when using an index expression form with a class whose metaclass supplies a __getitem__ method when the expression is used as a runtime expression, as opposed to a type expression. This addresses https://github.com/microsoft/pyright/issues/4785. 2023-03-16 07:41:49 -06:00
Erik De Bonte
6de737544c
Push pylance changes to pyright (#4783)
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com>
Co-authored-by: HeeJae Chang <hechang@microsoft.com>
Co-authored-by: Erik De Bonte <erikd@microsoft.com>
Co-authored-by: Rich Chiodo <rchiodo@microsoft.com>
2023-03-15 17:27:27 -07:00
dependabot[bot]
cebfc312e5
Bump webpack from 5.75.0 to 5.76.0 in /packages/pyright (#4774)
Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.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>
2023-03-15 07:41:28 -06:00
Eric Traut
ac9b89c255 Published 1.1.299 2023-03-15 00:16:59 -06:00
Eric Traut
c272a608f3 Fixed a bug that led to incorrect "circular reference" error for a type alias declaration in certain circumstances when that type alias was used in a parameter or return type annotation. This addresses https://github.com/microsoft/pyright/issues/4770. 2023-03-14 14:45:25 -06:00
Eric Traut
ce66cc21bb Fixed a bug that led to a false negative when a non-Generic class has a metaclass that defines a __getitem__ method. Such a class should not be indexable within a type annotation, but pyright was not flagging this error. This addresses https://github.com/microsoft/pyright/discussions/4766#discussioncomment-5291138. 2023-03-13 12:24:55 -06:00
Eric Traut
a28fb5d560 Fixed bug that caused incorrect results with --verifytypes when NewType was used to define a type prior to Python 3.9. This addresses https://github.com/microsoft/pyright/issues/4764. 2023-03-12 15:21:54 -06:00
Eric Traut
7c23b1afb8 Updated logic for PEP 696 (TypeVarLike "defaults") to change the syntax for ParamSpec default expressions. The draft PEP is being changed, and list expressions will now be used instead of tuples. 2023-03-11 12:08:37 -07:00
Eric Traut
128e169415 Fixed regression that led to a false positive error in some cases where when a wildcard pattern is used in a case statement within a loop. This addresses https://github.com/microsoft/pylance-release/issues/4058. 2023-03-10 22:44:22 -07:00
Eric Traut
65fc73251b Fixed a recent regression that resulted in multi-part imports being evaluated as unknown if a namespace package was used for an intermediate part of the module path and useLibraryCodeForTypes was set to false. This addresses https://github.com/microsoft/pyright/issues/4759. 2023-03-10 07:48:12 -07:00
Eric Traut
65ca325a14 Changed # pyright: basic file-level comment so it overrides "strict" settings specified in the config file or language server settings. This allows an individual file to be "downgraded" from strict to basic. This addresses https://github.com/microsoft/pyright/issues/4751. 2023-03-09 10:28:44 -07:00
Eric Traut
3f987e3137 Fixed broken links in README for npmjs page. Added missing link to command line interface documentation in sidebar. 2023-03-09 09:46:17 -07:00
Eric Traut
ec8f6fd59b Fixed display issue with name of module when it is imported implicitly as part of a multi-part import. This addresses https://github.com/microsoft/pyright/issues/4752. 2023-03-09 09:06:52 -07:00
Eric Traut
9c6ebad347 Updated mypy comparison to reflect change in mypy's type narrowing capabilities. 2023-03-09 08:21:01 -07:00
Eric Traut
f61304ed5c Fixed bug that caused incorrect evaluation of numeric literals expressed as binary, octal, or hex. These literals were incorrectly represented as "big integers" in some cases, which caused some operations to fail during type checking. This addresses https://github.com/microsoft/pyright/issues/4754. 2023-03-09 07:46:47 -07:00
PylanceBot
adc46d3df7
pull-pylance-with-pyright-1.1.298 (#4745)
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com>
Co-authored-by: HeeJae Chang <hechang@microsoft.com>
Co-authored-by: Erik De Bonte <erikd@microsoft.com>
Co-authored-by: Rich Chiodo <rchiodo@microsoft.com>
2023-03-08 13:06:36 -08:00
Eric Traut
574fc599a7 Published 1.1.298 2023-03-08 09:15:00 -07:00
Eric Traut
92c32b0834 Updated typeshed to the latest stubs. 2023-03-08 09:13:55 -07:00
Eric Traut
da2498b0e7 Changed implementation for @typing.deprecated so the code doesn't assume it is declared as an overloaded function. This was changed in typeshed recently. 2023-03-08 09:13:42 -07:00
Eric Traut
dd9fa29f9e Fixed a regression that resulted in a false positive in some rare cases when attempting to assign a value to a property with a defined setter. This addresses https://github.com/microsoft/pyright/issues/4743. 2023-03-08 08:45:01 -07:00
Eric Traut
d016ff4153 Published 1.1.297 2023-03-07 18:07:23 -07:00
Eric Traut
c83a95e62e More improvements to documentation. 2023-03-07 16:38:22 -07:00
Eric Traut
8e56215661 Added experimental support for inlined TypedDict definitions using the dict[{'a': int}] syntax. 2023-03-07 12:59:36 -07:00
Eric Traut
a8753c745f Small code cleanup — added options interface for getTypeArgs function. 2023-03-07 11:38:26 -07:00
Eric Traut
414dce170e Updated documentation for import modeling differences between mypy and pyright. 2023-03-07 10:16:14 -07:00
Eric Traut
1fdeadeca6 Improved "getting started" documentation. 2023-03-07 09:53:49 -07:00
Eric Traut
4bc7c6eace Removed the old dataclass_transform spec. 2023-03-07 09:01:24 -07:00
Eric Traut
32a29fb0c9 Fixed several bugs relating to types of callables (functions, methods, lambdas). There were bugs in the type printer, call expression evaluator, and param spec specialization logic. 2023-03-07 09:00:51 -07:00
Eric Traut
7c2205b286 Added check and corresponding error for use of an unpacked tuple in a Concatenate. 2023-03-07 07:29:31 -07:00
Eric Traut
d3b15d1c67 Fixed a bug whereby the signature help and hover text for an overloaded method would adopt its class docstring rather than the docstring for its own implementation. This addresses https://github.com/microsoft/pylance-release/issues/4042. 2023-03-07 01:01:16 -07:00
Eric Traut
a00a026953 Fixed capitalization inconsistency in docs. 2023-03-06 18:12:20 -07:00
Eric Traut
08b2cb4698 Did a consistency pass on documentation markdown. 2023-03-06 18:10:33 -07:00
Eric Traut
f7db5822ef Ran auto-formatter on html to avoid style issue in CI. 2023-03-06 17:59:23 -07:00
Eric Traut
8f17673300 Fixed main Pyright link in sidebar. 2023-03-06 17:55:58 -07:00
Eric Traut
400dd260cc Another small tweak to docs sidebar. 2023-03-06 17:54:36 -07:00
Eric Traut
2c4a9da2ae More tweaks to documentation and README files. Added a navbar to docs site. 2023-03-06 17:52:06 -07:00
Eric Traut
65874c5254 Small tweak for main docs page. 2023-03-06 17:45:37 -07:00
Eric Traut
deabba5e6a Tweaked documentation theming and added language highlighting for json. 2023-03-06 17:44:15 -07:00
Eric Traut
2827c94d89 Small correction to settings documentation. 2023-03-06 16:10:06 -07:00
Eric Traut
dc87fa46af Added a missing HTML tag to index.html. 2023-03-06 16:03:19 -07:00
Eric Traut
f7be9cc5cc A few more README tweaks. 2023-03-06 16:03:07 -07:00
Eric Traut
6cb2f4a058 Moved installation instructions and FAQ to their own docs pages, further simplifying the main README. 2023-03-06 15:58:44 -07:00
Eric Traut
b61f121efe Minor tweak to README. 2023-03-06 15:51:49 -07:00
Eric Traut
fe4eec0a7e Added link to new documentation on main README. 2023-03-06 15:50:28 -07:00
Eric Traut
4c4aec52a5 Added support for docsify-based docs site. 2023-03-06 15:46:07 -07:00
Eric Traut
b3fd962116 Fixed bugs in documentation. 2023-03-06 15:45:51 -07:00
Eric Traut
09161fdca4 Added an error message for Concatenate if a TypeVarTuple is used in the concatenated list of types. This addresses https://github.com/microsoft/pylance-release/issues/4046. 2023-03-06 13:03:22 -07:00
Eric Traut
f8edba07e5 Fixed regression in --verifytypes where variables assigned from calls to TypeVar, ParamSpec, TypeVarTuple, NewType, TypedDict, and NamedTuple were marked as ambiguous. This addresses https://github.com/microsoft/pyright/issues/4600. 2023-03-06 12:34:09 -07:00