Commit Graph

7548 Commits

Author SHA1 Message Date
Eric Traut
e69974cee0 Fixed bug that results in a false positive error under certain circumstances involving a call to a higher-order generic function with another function that involves a class with a contravariant type variable. This addresses #7212. 2024-05-31 13:44:51 -07:00
Eric Traut
0e42a7ea56 Removed support for inlined TypedDict annotations. This idea never gained enough support to make it into a PEP. 2024-05-30 18:16:13 -07:00
Eric Traut
1bc5949959 Added comments for experimental features. 2024-05-30 18:14:47 -07:00
Eric Traut
181382d6a1 More cleanup of prefetched types. 2024-05-30 18:08:46 -07:00
Eric Traut
ce229098e6 Code cleanup for prefetched types used in type evaluator. 2024-05-30 17:41:39 -07:00
Eric Traut
32fa85e3ed
Changed behavior of constructor call evaluation when __new__ evaluation results in type evaluation errors. Previously, pyright skipped the __init__ evaluation in this case. It now proceeds to evaluate __init__, potentially generating redundant errors. This addresses #8026. (#8029) 2024-05-30 12:49:11 -07:00
PylanceBot
2e397e9a0a
[PylanceBot] Pull Pylance with Pyright 1.1.365 (#8016)
* pull-pylance-with-pyright-1.1.365-9280185292

* Update package.nls.ko.json typo

Fix typo

---------

Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rich Chiodo <rchiodo@users.noreply.github.com>
2024-05-29 09:49:41 -07:00
Eric Traut
66101ee0c5 Published 1.1.365 2024-05-28 21:12:35 -07:00
Eric Traut
ece525e960
Fixed bug that results in a false negative when a Final class variable is assigned a value in the class body and reassigned a value in the __init__ method. This addresses #8013. (#8015) 2024-05-28 20:42:09 -07:00
Eric Traut
59eabcb60f
Fixed bug that leads to inconsistent narrowing-on-assignment behavior when a tuple instance with unknown type arguments is assigned to a target symbol with a declared tuple type. This addresses #8001. (#8005) 2024-05-26 23:42:37 -07:00
Eric Traut
a4d165ec02 Fixed regular expression for # type: ignore and # pyright: ignore comments. This addresses #8000. 2024-05-25 09:30:05 -07:00
Eric Traut
c1b5bccca0 Did some internal refactoring in preparation for implementation of new functionality. No functional change. 2024-05-25 00:33:38 -07:00
Eric Traut
1bba737d93
Fixed a bug that results in an unsolved TypeVar when calling list(tuple()). This addresses #7998. (#7999) 2024-05-25 00:25:05 -07:00
Eric Traut
1466ccb653 Fixed issue with chained config files related to typeCheckingMode. 2024-05-24 18:01:20 -07:00
Eric Traut
421dabee57
Added support for configuration inheritance through an "extends" configuration option. This addresses #4366. (#7997) 2024-05-24 17:22:12 -07:00
Eric Traut
0a83d6459c
Fixed a bug that results in incorrect type compatibility checks for a… (#7994)
* Fixed a bug that results in incorrect type compatibility checks for a callable that uses `*args: *tuple[T, *tuple[S, ...]]`. This addresses #7987.

* Improved diagnostic messages for parameter mismatch.
2024-05-24 13:19:16 -07:00
Eric Traut
af916c6644 First step in improving code for parameter matching for callable assignments. This step involves simple renaming. No functional change. 2024-05-24 10:10:16 -07:00
Eric Traut
a1ac859982 Small cleanup in callback protocol test. 2024-05-24 10:09:14 -07:00
Eric Traut
59b8963684 Attempted to clarify meaning of "include" and "exclude" in documentation. 2024-05-23 16:27:39 -07:00
Eric Traut
aed4c75980 Fixed regression that results in the incorrect type evaluation for the value attribute of a StrEnum or IntEnum class. This addresses #7983. 2024-05-23 09:18:30 -07:00
Ujan RoyBandyopadhyay
bfc60526a0
Use typeshed version info for stdlib module list (#7982) 2024-05-23 09:04:55 -07:00
Eric Traut
50d4f44735
Changed tuple expression inference behavior to not preserve literal entry types if the tuple expression is embedded within another tuple, set, list, or dictionary expression. This addresses #7159. (#7970) 2024-05-22 16:10:05 -07:00
Bill Schnurr
0618acc535
pylance-22-5-2024 -> pyright (#7980)
* pullpylance-22-5-2024

  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>
  Co-authored-by: Stella Huang <stellahuang@microsoft.com>
  Co-authored-by: Kacie Kang <jikang@microsoft.com>
2024-05-22 15:34:30 -07:00
Raphael Boidol
766a012627
Update GitHub Actions from "actions" org & update mypy_primer for changed upload-artifacts behaviour (#7978)
* Update actions/checkout, actions/setup-node, actions/setup-python, actions/github-script

* Update actions/upload-artifact & actions/download-artifact includign migrations
2024-05-22 12:31:23 -07:00
Eric Traut
a18387f1c4 Published 1.1.364 2024-05-21 19:04:30 -07:00
Eric Traut
4a8b2dbbdd Removed unused import in test. 2024-05-21 16:45:54 -07:00
Eric Traut
b93dc627fc Added small memory and performance optimization. 2024-05-21 13:00:33 -07:00
Eric Traut
be320a8b08
Added support for using Literal and various other special forms in a value expression. This addresses #7547. (#7969) 2024-05-21 12:20:01 -07:00
Eric Traut
4c49f1b8cd Improved type printer (the component that converts an internal type to textual format for diagnostic messages) so it better handles special forms like Literal or unions when used in a value expression. This partly addresses #7547. 2024-05-21 10:49:29 -07:00
Eric Traut
1027400ac0
Fixed bug that leads to a false negative when calling a callback function that returns a callable with a generic parameter type. This addresses #7718. (#7965) 2024-05-21 01:47:44 -07:00
Eric Traut
582ead0aa0 Updated typeshed stubs to the latest version. 2024-05-21 01:02:48 -07:00
Eric Traut
e4e48b9d26 Added test case for #7250, which was fixed by the same fix for #7141. 2024-05-21 00:02:51 -07:00
Eric Traut
39962012cb Added test case for previous commit. 2024-05-20 23:58:55 -07:00
Eric Traut
9f76ed501e
Fixed a bug that resulted in an infinite loop when a function that uses an *args: *Ts parameter is passed as an argument to itself. This partially addresses #7141. (#7964) 2024-05-20 23:35:11 -07:00
Eric Traut
51225759d2
Fixed regression that results in incorrect type evaluation for annotations that involve nested protocols (such as P[P[T]]). This addresses #6767. (#7963) 2024-05-20 19:34:46 -07:00
Eric Traut
7fb7b4158d
Added support for recent addendum to typing spec that provides a special case for dataclasses so ClassVar and Final can be used together to distinguish between a regular Final instance variable and a ClassVar that is also Final. This addresses #7959. (#7962) 2024-05-20 15:52:34 -07:00
Eric Traut
24787dad22 Revert "Update GitHub Actions from "actions" org to resolve Node.js deprecations (#7956)"
This reverts commit 17921d4f1e.
2024-05-20 15:42:56 -07:00
Eric Traut
d1515002d9 Fixed a bug in the dataclass "converter" support that resulted in an error if the converter is tuple. This addresses https://github.com/microsoft/pylance-release/issues/5391. 2024-05-20 12:53:20 -07:00
Raphael Boidol
17921d4f1e
Update GitHub Actions from "actions" org to resolve Node.js deprecations (#7956) 2024-05-20 08:53:43 -07:00
Eric Traut
dbac83d45c
Fixed a bug that results in a false negative when a generic function has a parameter with a generic type and a default argument value. This could lead to a typing hole when considering subtyping rules for callables. This addresses #7288. (#7954) 2024-05-19 21:34:08 -07:00
Eric Traut
0b7860b15e Fixed regression related to "converter" field parameter for dataclasses when the converter refers to a generic class constructor. This addresses #7713. 2024-05-18 14:22:47 -07:00
Eric Traut
7426e71d2c Changed support for dataclass "converter" field parameter to be off by default. The "enableExperimentalFeatures" must now be enabled to use this feature. If and when PEP 712 is approved, we can move out of experimental. 2024-05-18 14:21:46 -07:00
Eric Traut
017f7c2767
Fixed a bug that results in incorrect type narrowing for a type guard function that uses TypeIs[type[T]]. This addresses #7946. (#7947) 2024-05-18 00:11:08 -07:00
Eric Traut
7d146aad07 Simplified isinstance code. No functional change. 2024-05-17 23:26:18 -07:00
Eric Traut
7724fce513
Fixed a bug in the code flow engine that results in incorrect type evaluation in certain cases involving codependent variables in a loop. This addresses #7466. (#7945) 2024-05-17 10:09:18 -07:00
Eric Traut
c345c561a0
Changed the handling of Enum subclasses that explicitly override value or name to avoid using the special-case logic for computing these types. This is done regardless of whether the class uses a custom metaclass. This addresses #7939. (#7941) 2024-05-16 21:04:43 -07:00
Eric Traut
7699780a0a
Fixed bug that results in a false negative when determining if a callable type is compatible with another callable type and the first has a *args parameter and the second has a single positional+keyword parameter. This addresses #7937. (#7938) 2024-05-16 17:44:12 -07:00
Eric Traut
1f16eb66b5 Fixed recent regression that results in a false positive when accessing an enum member from an instance of an enum class. This addresses #7926. 2024-05-15 20:26:27 -07:00
Eric Traut
6d79c5cada Fixed a bug that leads to a false positive error when first argument to super call is an instance of a metaclass. This addresses #7931. 2024-05-15 20:11:09 -07:00
Eric Traut
022b30a1f8 Fixed bug that results in a false negative syntax error when a PEP-695 type alias uses a keyword as a name. This addresses #7933. 2024-05-15 19:56:08 -07:00