Commit Graph

5849 Commits

Author SHA1 Message Date
PylanceBot
0175810505
pull-pylance-with-pyright-1.1.291 (#4527) 2023-01-25 05:33:00 -08:00
Eric Traut
624fedaccb Published 1.1.291 2023-01-24 18:23:01 -08:00
Eric Traut
c6cda1f42c Added optimization to handle unions that contain large numbers of union literals. This addresses part of https://github.com/microsoft/pyright/discussions/4516#discussioncomment-4771824. 2023-01-24 15:52:47 -08:00
André Fontenele
7ca9a91823
fix: empty range for submodule fallback (#4522)
This addresses https://github.com/microsoft/pyright/issues/4521
Co-authored-by: Eric Traut <eric@traut.com>
2023-01-24 13:00:04 -08:00
Eric Traut
8c856d3098 Improved type analysis performance in some cases that involve protocol matching where the protocol incorporates an overloaded method. This partially addresses https://github.com/microsoft/pyright/discussions/4516#discussioncomment-4762888. 2023-01-24 12:53:36 -08:00
Eric Traut
b0d01a6e93 Revert "Improved type analysis performance in some cases that involve protocol matching where the protocol incorporates an overloaded method. This partially addresses https://github.com/microsoft/pyright/issues/4519."
This reverts commit cf4801e10e.
2023-01-24 12:52:50 -08:00
Eric Traut
cf4801e10e Improved type analysis performance in some cases that involve protocol matching where the protocol incorporates an overloaded method. This partially addresses https://github.com/microsoft/pyright/issues/4519. 2023-01-24 12:51:47 -08:00
Eric Traut
675fafdeb7 Removed the "draft" status of PEP 692 since it has been accepted by the SC. 2023-01-24 12:50:29 -08:00
Eric Traut
96b29389aa Fixed a bug that resulted in a false positive error when generic class with an invariant type parameter is used in specialized form as a type argument for a class with a contravariant type parameter. This addresses https://github.com/microsoft/pyright/issues/4517. 2023-01-23 19:11:35 -08:00
Eric Traut
24844047ca Fixed inconsistency within isinstance type guard logic when handling the narrowing of a type that contains a union with Any or Unknown. This addresses https://github.com/microsoft/pyright/issues/4508. 2023-01-23 18:40:11 -08:00
Eric Traut
84cf7e8f9c Revert "Fixed inconsistency within isinstance type guard logic when handling the narrowing of a type that contains a union with Any or Unknown. This addresses https://github.com/microsoft/pyright/issues/4508."
This reverts commit dd1e727929.
2023-01-23 11:10:38 -08:00
Eric Traut
dd1e727929 Fixed inconsistency within isinstance type guard logic when handling the narrowing of a type that contains a union with Any or Unknown. This addresses https://github.com/microsoft/pyright/issues/4508. 2023-01-22 21:48:35 -08:00
Eric Traut
4eef3dad90 Fixed a bug that resulted in incorrect type evaluation for a symbols within a py.typed module that is contained with a non-py.typed namespace package. This addresses https://github.com/microsoft/pyright/issues/4507. 2023-01-22 15:58:49 -08:00
Eric Traut
eca831a955 Fixed spelling for method in program.ts module. 2023-01-22 15:57:50 -08:00
Eric Traut
c0486a1663 Fixed a bug that led to a crash under certain circumstances when a dictionary expansion subexpression (**val) was used. 2023-01-22 09:07:12 -08:00
Eric Traut
0314c24133 Fixed a bug that led to a crash in certain circumstances where a TypedDict field annotation contained a circular reference to the TypedDict. 2023-01-22 09:07:12 -08:00
Erik De Bonte
591c04ec7a
Allow non-identifier characters immediately after #region (#4501) 2023-01-20 17:11:00 -08:00
Eric Traut
9fe3675562 Removed initsubclass3 test because it's not effective at catching a regression as it's designed to do. 2023-01-20 10:11:19 -08:00
Eric Traut
8d08659d22 Fixed a bug that led to the incorrect evaluation of StrEnum member types in some rare circumstances. The problem is due to a circular dependency in the enum.pyi type stub involving the StrEnum, ReprEnum and EnumMeta classes. The solution is to detect this case and defer evaluation to handle the circular dependency. This addresses https://github.com/microsoft/pyright/issues/3997. 2023-01-20 09:37:30 -08:00
Eric Traut
20fae82b48 Fixed misspelled words in comments within indentationUtils.ts 2023-01-20 08:16:41 -08:00
Eric Traut
bffc50a59d
Changed hover provider to limit its display of overloaded functions w… (#4492)
* Changed hover provider to limit its display of overloaded functions when hovering over a name that is part of a call expression. In such cases, the context of the call's arguments often provides sufficient context to select one (or in some cases, several) overloads.

* Added unit test for overload-aware hover capability.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2023-01-19 09:38:03 -08:00
Eric Traut
b0fc5b0afb Moved common code from checker to parseTreeUtils so it can be used by language service providers. No functional change. 2023-01-18 19:10:10 -08:00
Eric Traut
dc4b8b45ba Fixed regression that resulted in an incorrect type evaluation of dict(a) when a is typed as Any or Unknown. This addresses https://github.com/microsoft/pyright/issues/4490. 2023-01-18 19:08:59 -08:00
Eric Traut
0659a661d0 When converting a class into a callable (by combining its __new__ and __init__ methods), capture the docstring of the constructor or class. This preserves docstrings when using a class decorator. This addresses https://github.com/microsoft/pyright/discussions/4488#discussioncomment-4721194. 2023-01-18 12:40:42 -08:00
PylanceBot
e96b3ece2b
pull-pylance-with-pyright-1.1.290 (#4489)
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-01-18 12:01:42 -08:00
Eric Traut
418aaf84f7 Fixed a bug that could lead to infinite type evaluation time when inferring the type of a tuple in a loop. This addresses https://github.com/microsoft/pyright/issues/4484. 2023-01-18 11:12:38 -08:00
Eric Traut
30f824c05d Small code improvement to use an existing helper function. No functional change. 2023-01-18 10:39:43 -08:00
Eric Traut
797fe3f4bb Fixed a bug in the constraint solver that led to unsolved type variables in the case where a lambda x:x was passed to a Callable[[T], S]. This addresses https://github.com/microsoft/pyright/issues/4486. 2023-01-18 09:30:56 -08:00
Eric Traut
c6e79efbba Published 1.1.290 2023-01-17 18:47:36 -08:00
Eric Traut
cfc265545a Extended user-defined TypeGuard functions to support objects with __call__ method. This addresses https://github.com/microsoft/pyright/issues/4482. 2023-01-17 18:43:49 -08:00
Eric Traut
62e8f51acb Fixed a bug that resulted in false positive errors when an f-string uses an escape character sequence within the format string section. This addresses https://github.com/microsoft/pyright/issues/4481. 2023-01-17 16:14:37 -08:00
Eric Traut
2e231b26a3 Fixed a bug in the type printer that generated incorrect output for bytes literal types that include non-printable characters. This addresses https://github.com/microsoft/pyright/issues/4479. 2023-01-17 15:43:27 -08:00
Eric Traut
831b9f0e09 Fixed a bug that led to infinite recursion in certain circumstances when using a recursive type alias with a type variable. This addresses https://github.com/microsoft/pyright/issues/4475. 2023-01-17 12:43:19 -08:00
Eric Traut
390cd8e0c6 Fixed a bug that resulted in a false negative when binding an object to an overloaded method where all of the overloads have an annotated self type and none of them match the type of the object. This addresses https://github.com/microsoft/pyright/issues/4477. 2023-01-17 09:47:15 -08:00
Eric Traut
12baf03db2 Moved __init_subclass__ argument validation from the checker to the type evaluator so types of keyword arguments used in the class declaration are evaluated consistently. Prior to this, hovering over a keyword argument sometimes displayed an Unknown type. 2023-01-16 12:24:03 -08:00
Eric Traut
84103c89f4 Fixed bug that resulted in a false positive error when using the | operator for two sets of str values within a join call. This addresses https://github.com/microsoft/pyright/issues/4470. 2023-01-16 09:16:13 -08:00
Eric Traut
cf53a9d14a Improved error message for implied return type mismatch. This addresses https://github.com/microsoft/pyright/issues/4466. 2023-01-15 14:30:17 -08:00
Eric Traut
470564dcb3 Fixed a recent regression with the truthy/falsy type guard logic when a constrained TypeVar is involved. This addresses https://github.com/microsoft/pyright/issues/4463. 2023-01-15 09:53:39 -08:00
Eric Traut
612fc69ae9 Improved bidirectional type inference logic to handle cases where an expected type includes a TypeVar that is bound to a type that influences the type inference. This addresses https://github.com/microsoft/pyright/issues/4457. 2023-01-14 20:47:11 -08:00
Eric Traut
285a154870 Fixed bug that resulted in incorrect contextual evaluation of certain sub-expressions. 2023-01-14 18:04:02 -08:00
Eric Traut
bd010d1192 Fixed regression that resulted in an incorrect Unknown type when evaluating a list comprehension in a loop. This addresses https://github.com/microsoft/pyright/issues/4459. 2023-01-14 17:03:14 -08:00
Eric Traut
a8aed2c51d Small code improvement. No functional change. 2023-01-14 13:04:11 -08:00
Eric Traut
7233868ebb Renamed some internal flag names for consistency. No functional change. 2023-01-14 12:35:53 -08:00
Eric Traut
9a0820df09 Published 1.1.289 2023-01-13 22:25:16 -08:00
Eric Traut
53e8cd4145 Added provisional support for draft PEP 702 (marking deprecations using the type system). 2023-01-13 21:16:07 -08:00
Eric Traut
761fabc9c3 Fixed a bug that resulted in a crash within the document symbol provider when a "naked" decorator is present. This addresses https://github.com/microsoft/pyright/issues/4455. 2023-01-13 18:21:11 -08:00
Eric Traut
f0a75d24c5 Added support for the tentatively-accepted PEP 649 (deferred evaluation of annotations) in Python 3.12. 2023-01-13 17:06:54 -08:00
Eric Traut
a2784020f2 Added support for x[K] is V and x[K] is not V type narrowing forms. This addresses https://github.com/microsoft/pyright/issues/4453. 2023-01-13 16:53:18 -08:00
Eric Traut
8544b19923 Updated typeshed stubs to the latest version 2023-01-12 19:19:57 -08:00
Eric Traut
8bc7dea346 Fixed a bug that resulted in a false negative when bidirectional type inference was used for a list expression and a list entry with an incompatible type is present. This addresses https://github.com/microsoft/pyright/issues/4422. 2023-01-12 18:33:15 -08:00