Commit Graph

5052 Commits

Author SHA1 Message Date
Eric Traut
fd6081f12d
Did some general code cleanup in type evaluator including shortening names of some variables and functions for readability. (#8330) 2024-07-07 16:08:22 -07:00
Eric Traut
ab6fe409a6 Code cleanup for selfSpecializeClass. 2024-07-07 12:29:52 -07:00
Eric Traut
5332daa9cb Small code cleanup in validateCallForFunction. 2024-07-07 11:59:28 -07:00
Eric Traut
04490f2645 Reformatted test samples using ruff. 2024-07-07 10:34:25 -07:00
Eric Traut
7d410cfbee
Improved handling of tuple expressions used in type expressions that involve specialization, such as dict[()]. (#8329) 2024-07-07 10:06:08 -07:00
Eric Traut
f8bbf78ca5
Added code to TypeVar transform to update the boundToType and strippedFirstParamType. (#8328) 2024-07-07 09:55:03 -07:00
Eric Traut
4c001a139c
Improved type narrowing in the fall-through case for sequence patterns when the pattern includes a star pattern and the subject type is a tuple with an indeterminate entry. (#8323) 2024-07-06 14:44:46 -07:00
Eric Traut
228bd84c54 Fixed bug that results in false negative when a list or set expression includes more than 64 elements and is being evaluated with a bidirectional inference context. This addresses #8314. 2024-07-06 11:51:09 -07:00
Eric Traut
1c85d650ae
Fixed bug that results in a false positive error when using a TypeVar with an upper bound of type as a base class in a class statement. This addresses #8313. (#8321) 2024-07-06 11:47:37 -07:00
Eric Traut
3ddf0ad705
Improved detection of the use of variables used in type annotations. These are illegal according to the typing spec. (#8318)
This addresses #8316.
2024-07-06 10:18:21 -07:00
Eric Traut
598119b90f Fixed bug that results in a false positive error when an unpack operator is used in an unparenthesized tuple expression on the RHS of an augmented assignment operator on Python 3.9 and newer. This addresses #8310. 2024-07-05 09:27:25 -07:00
Eric Traut
8a23d8f596 Fixed bug that results in --outputjson command-line option being incompatible with --threads command-line option. 2024-07-05 09:10:49 -07:00
Eric Traut
057b351efa
Added support for multithreaded type checking in CLI. (#8309) 2024-07-04 20:52:37 -07:00
Eric Traut
746749272c Exposed maxSourceFileSize from sourceFile module. 2024-07-04 17:54:51 -07:00
Eric Traut
4fd12df54a Added functions for converting diagnostics to/from a form that is compatible with JSON serialization. 2024-07-04 17:54:15 -07:00
Eric Traut
4df7ba72a0 Revert "Improved the internal name given to a class that is created through the explicit instantiation of a metaclass."
This reverts commit 8792e4e493.
2024-07-03 14:48:48 -07:00
Eric Traut
8792e4e493 Improved the internal name given to a class that is created through the explicit instantiation of a metaclass. 2024-07-03 14:47:04 -07:00
Eric Traut
8ed6c10486
Changed the hard-coded type of the __class__ symbol to be Self@T rather than T (where T is the enclosing class). This addresses #8305. (#8307) 2024-07-03 14:45:58 -07:00
Eric Traut
d7c5d0691a
Fixed regression that results in a false positive when a traditional type alias (not using PEP 695 syntax) defines a union and is then used as a second argument to an isinstance or issubclass call. This addresses #8302. (#8303) 2024-07-03 12:27:02 -07:00
Eric Traut
93ac52f0b2 Published 1.1.370 2024-07-02 16:45:35 -07:00
Eric Traut
0591abaae8 Fixed bug that results in a false positive reportUntypedFunctionDecorator error under certain circumstances. This addresses #8298. 2024-07-02 16:40:34 -07:00
Eric Traut
8a766d59a4
Fixed bug that results in a false negative when passing an extra keyword argument to a callable that is parameterized with a ParamSpec. This addresses #8294. (#8299) 2024-07-02 16:35:08 -07:00
Eric Traut
280ed52e8c Shortened names of EvalFlags to improve readability. No functional change. 2024-07-02 13:38:58 -07:00
Eric Traut
33a72e3d6a
Improved handling of special forms, including TypeAliasType instances, when used in value expressions. This addresses #8185. (#8296) 2024-07-02 13:30:36 -07:00
Eric Traut
f6c9ca9feb Renamed evaluation flag for clarify and consistency. No functional change. 2024-07-02 08:47:10 -07:00
Eric Traut
2947be68bf Did more code cleanup in the assignment statement evaluation code path. 2024-07-01 20:50:20 -07:00
Eric Traut
3da465b321 Reduced duplicated code in type alias code paths. No functional change. 2024-07-01 20:28:01 -07:00
Eric Traut
139d095cd6
Implemented small optimization in the protocol matching cache. (#8288) 2024-07-01 10:47:36 -07:00
Eric Traut
21efa0ecf8 Fixed bug that results in the incorrect default value of a variadic type variable when the type argument is not provided. It should default to *tuple[Any, ...], not *tuple[Any]. This addresses #8285. 2024-07-01 08:13:44 -07:00
Eric Traut
74846de568
Improved performance of type analysis by caching additional reachability information for code flow graphs. This addresses #8275. (#8281) 2024-06-30 21:13:47 -07:00
Eric Traut
8a9ba9b77b Fixed bug that resulted in a false positive error when an abstract class is used for a NewType and the new type is constructed. This addresses #8256. 2024-06-30 19:48:08 -07:00
Eric Traut
353a17cdec
Improved analysis performance for complex code flow graphs by adding a cache for reachability. This addresses #8276. (#8278) 2024-06-30 17:17:38 -07:00
Eric Traut
4980567942
Reformatted Python test samples using the latest version of ruff. (#8277) 2024-06-30 17:07:20 -07:00
Eric Traut
3e70e7a8f9 Renamed internal function for clarity. No functional change. 2024-06-30 05:49:24 -07:00
Eric Traut
d55be983e5 Fixed a bug in the type narrowing for the "x is <class>" type guard pattern when <class> is a specific class T, as opposed to a variable of type type[T]. This addresses #8264. 2024-06-29 11:05:51 -07:00
Eric Traut
fa0f6b7349 Small code cleanup. No functional change. 2024-06-29 11:05:09 -07:00
PylanceBot
16f398976a
pull-pylance-with-pyright-1.1.369-9716881771 (#8261)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Rich Chiodo <rchiodo@users.noreply.github.com>
2024-06-28 17:41:06 -07:00
Eric Traut
bee1d912fd Fixed bug that results in a spurious error when evaluating a quoted (forward reference) type expression that includes an index expression within a TypeAlias definition. This addresses https://github.com/microsoft/pylance-release/issues/6072. 2024-06-28 15:15:20 -07:00
Eric Traut
3c70b4e0d1
Fixed bug that results in incorrect type evaluation of a function that accepts a Callable[P, T] and is passed a class object whose constructor needs to be converted to a callable. This addresses #8170. (#8258) 2024-06-28 10:19:57 -07:00
Kacie Kang
5d5fe5d15c
fix pylance issue 6052 (#8253) 2024-06-27 16:22:49 -07:00
Eric Traut
8f8f5b163d
Fixed recent regression that results in false positive when a inner function with an inferred return type is a coroutine (async) and is referenced within the function body in which it's declared. This addresses #8232 and #8229. (#8251) 2024-06-27 13:16:23 -07:00
Eric Traut
f104e7bb30
Fixed bug that results in false positive reportInconsistentOverload and reportNoOverloadImplementation errors when an overloaded decorator is applied to a non-overloaded function or method. This addresses #8246. (#8249) 2024-06-27 05:35:50 -07:00
Eric Traut
1e1e912380 Fixed bug that results in a false positive when a protocol includes a method implementation that conditionally raises NotImplementedError. This addresses #8245. 2024-06-27 04:30:13 -07:00
Eric Traut
337ef2fa00 Fixed recent regression that results in an assertion failure (and therefore a crash) when type() is called with dynamic base classes. This addresses #8228. 2024-06-26 16:51:15 -07:00
Eric Traut
bdb8eba712 Updated typeshed stubs to the latest version. 2024-06-26 16:30:53 -07:00
Eric Traut
05726120ad
Fixed bug that results in incorrect type isinstance or issubclass type narrowing when using a type variable with an upper bound that includes a promotion type. This addresses #8238. (#8243) 2024-06-26 16:30:26 -07:00
Eric Traut
427ca1143e Fixed bug that resulted in a false negative when assigning to type tuple[Never]. This addresses #8237. 2024-06-26 15:01:45 -07:00
PylanceBot
1168be715e
pull-pylance-with-pyright-1.1.369-9665934702 (#8225)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-25 10:09:34 -07:00
Eric Traut
a5cbd4725a Published 1.1.369 2024-06-25 18:02:18 +02:00
Eric Traut
24f64f7d26 Fixed bug that results in incorrect type narrowing in the negative (fall-through) case of a match expression when the subject expression is an unbounded tuple. This addresses #8219. 2024-06-25 13:56:02 +02:00