Commit Graph

4166 Commits

Author SHA1 Message Date
Eric Traut
646b06e2bb Fixed bug that resulted in a false positive when a tuple with known element types is used as an unpacked argument in a call to a function that uses position-only parameters. 2021-11-17 18:21:02 -08:00
Heejae Chang
b27108d5e0
added helper method for future refactoring (#2579) 2021-11-17 15:07:45 -08:00
Eric Traut
9927e21296 Fixed bug in type evaluator that resulted in false positive error in strict mode. Type of call argument expression was incorrectly reported as partially unknown in some cases. 2021-11-16 22:08:01 -08:00
Eric Traut
f2f5c44a80 Fixed style issue. 2021-11-16 21:27:55 -08:00
Eric Traut
5e30d59b20 Fixed bug in ParamSpec logic that resulted in false positive when a TypeVar was used as within a Concatenate expression. 2021-11-16 21:05:59 -08:00
Eric Traut
33dbcabe0b Fixed bug in ParamSpec type evaluation that caused a false positive error when assigning a callable with a Concatenate to another ParamSpec. 2021-11-15 22:56:15 -08:00
Eric Traut
fec0ac356c Fixed crash in completion provider. 2021-11-14 08:45:05 -08:00
Eric Traut
f10e8f8326 Fixed issue that caused import resolution failures for certain submodules of google.cloud. 2021-11-14 01:49:35 -08:00
Eric Traut
d60978f632 Published 1.1.187 2021-11-12 16:55:08 -08:00
Eric Traut
2f627e639d Added support for upcoming change in typing.pyi in the way that the NoReturn symbol is declared. 2021-11-12 15:48:11 -08:00
Eric Traut
a801d787b9 Fixed regression in handling of callback protocols that define a __name__ attribute, which is common to all functions. 2021-11-12 00:30:57 -08:00
Eric Traut
52a241cf42 Added reference to PEP 673 to documentation. 2021-11-11 19:29:07 -08:00
Eric Traut
8c6c2e774c Fixed bug that resulted in hover text for symbols used within a default argument expression to sometimes be displayed as "Unknown". 2021-11-11 07:30:00 -08:00
Jeremy Fleischman
d017f74711
Fix typo: add missing quotation mark (#2559) 2021-11-11 07:11:40 -08:00
Eric Traut
63c9c9f0f2 Updated typeshed stubs to the latest. 2021-11-10 21:47:08 -08:00
Eric Traut
c118babbe3 Fixed bug that resulted in a false positive error when a specialized generic class with a __call__ method uses a ParamSpec and is assigned to a Callable that is also parameterized with a ParamSpec. 2021-11-10 20:28:11 -08:00
Heejae Chang
446a9bdb63
dependency updates, bug fix on file open/close, update on getPythonVersion (#2556)
Co-authored-by: Jake Bailey <5341706+jakebailey@users.noreply.github.com> 
Co-authored-by: Rich Chiodo <rchiodo@users.noreply.github.com>
2021-11-10 12:41:56 -08:00
Eric Traut
0b88ef2fc6 Fixed missing diagnostic when a Self parameter was assigned to a Concatenate[X, P] where X is a type that is incompatible with Self. 2021-11-10 00:38:13 -08:00
Eric Traut
82aac69600 Modified the check for function declaration redefinitions to allow for same-signature overrides in cases where the declarations are not within the same statement suite (e.g. one in the "if" and the other in the "else" block). 2021-11-09 19:12:45 -08:00
Eric Traut
0e57dc2a8d Changed isTypeSame function to handle functions whose signatures include position-only parameters. Also added support for inferred return types and eliminated the check for declaration parity. This allows two function types to be deemed the same even if they originate from different declarations. 2021-11-09 18:56:04 -08:00
Eric Traut
5d2a00865c Changed Callable special form to include a position-only marker at the end of the parameter list. Changed type printer to omit the / if it is unnecessary. 2021-11-09 18:54:36 -08:00
Eric Traut
97d9daf16e Fixed false positive error when assigning type T | Any to type T. 2021-11-09 00:04:45 -08:00
Eric Traut
7360d6f088 Published 1.1.186 2021-11-08 20:44:54 -08:00
Eric Traut
c7a6a71ab6
Fixed incorrect handling of client-initiated progress reporting for "… (#2546)
* Fixed incorrect handling of client-initiated progress reporting for "onReferences" and "onExecuteCommand" handlers in language server.

* Incorporated code review feedback.

Co-authored-by: Eric Traut <erictr@microsoft.com>
2021-11-08 12:36:27 -08:00
Eric Traut
ca02505965 Fixed regression that caused a false positive error related to incorrect usage of a type variable within a type alias definition. 2021-11-08 10:04:09 -08:00
Eric Traut
aee583b94b Added support for slots parameter to dataclass, a new feature added in Python 3.10. 2021-11-08 00:00:23 -08:00
Eric Traut
44451a99c8 Fixed false positive error related to heuristics employed in bidirectional type inference for calls when the expected type comprises a union and the return type of the call is a union that includes Any and a type variable. 2021-11-07 19:39:45 -08:00
Eric Traut
2349041a68 Fixed a bug that resulted in a false positive error when accessing members from a type instance or a Type[T]. 2021-11-07 00:54:41 -07:00
Eric Traut
3d204d6b9d Added more complete type checks involving the use of a default argument for a generic parameter in a constructor. 2021-11-06 23:46:11 -07:00
Eric Traut
9656351207 Added checks for incorrect runtime usage of a UnionType object. 2021-11-06 21:47:08 -07:00
Eric Traut
b12f1347b2 Fixed style issue 2021-11-05 19:35:07 -07:00
Eric Traut
0d0c63022d Published 1.1.185 2021-11-05 19:25:14 -07:00
Eric Traut
6c9d680b3f Added check for a class-scoped generic type alias that uses a class-scoped TypeVar. This is now flagged as an error. 2021-11-05 19:22:12 -07:00
Eric Traut
2044381032 Moved one more type alias test. 2021-11-05 18:42:42 -07:00
Eric Traut
2a50c13ff3 Renamed type alias tests to separate out recursive type alias tests. 2021-11-05 18:31:18 -07:00
Eric Traut
6fec5831a0 Added support for explicit type aliases (PEP 613) within class scopes. A proposed amendment to PEP 613 will make this legal. 2021-11-05 18:11:41 -07:00
Eric Traut
a6daa8a8f3 Improved bidirectional type inference for call expressions. The logic now handles the case where the return type of the callable is a generic type that is not an exact match for the expected type but is assignable to the expected type. 2021-11-05 18:04:26 -07:00
Eric Traut
7fe30ca001 Fixed bug in type promotion logic that resulted in false positive. It wasn't properly handling subclasses of promotable types (like 'int', which can be promoted to 'float'). 2021-11-05 12:08:33 -07:00
Eric Traut
07271471c7 Added missing keyword "with" from completion provider. 2021-11-05 08:20:26 -07:00
Eric Traut
87c9ff7fcb Added missing diagnostic check for illegal type argument lists that include a ParamSpec when the type parameter list includes a ParamSpec. 2021-11-04 15:55:42 -07:00
Eric Traut
82fca64dac Fixed bug that resulted in false positive "reportUnknownMemberType" error when using a generic class within a class pattern. 2021-11-04 15:25:40 -07:00
Eric Traut
7aa2b05537 Fixed a bug that resulted in a false positive error when assigning one ParamSpec to another ParamSpec. 2021-11-04 01:24:21 -07:00
Heejae Chang
fb86eac606
dependency updates and helper methods for future refactoring features (#2530) 2021-11-03 14:57:46 -07:00
Eric Traut
a181ceaf4a Improved signature help for the constructor of classes that define a __new__ method but no __init__ method, such as the zip class. The previous logic was always preferring the __init__, which is supplied by the object class, which all classes derive from. 2021-11-02 23:03:17 -07:00
Eric Traut
5b64342144 Fixed bug in stub generation code that resulted in an error if a stub was requested for a submodule in a package that includes an __init__.py file in the same directory as the submodule source file. 2021-11-02 22:38:55 -07:00
Eric Traut
944941a286 Fixed bug that resulted in stack overflow. 2021-11-02 18:49:08 -07:00
Eric Traut
8873b0e6fc Fixed overflow 2021-11-02 18:41:09 -07:00
Eric Traut
53caa5f1d2 Increased stack trace limit from default to 256 in pyright VS Code extension to facilitate debugging of stack overflow errors. 2021-11-02 17:52:34 -07:00
Eric Traut
371a65387d Added special-case support for the __self__ attribute of a bound method. 2021-11-02 14:55:29 -07:00
Eric Traut
bcfbf8647d Fixed a bug in the handling of reveal_type that caused hover text within the argument to be displayed as Unknown in some circumstances. 2021-11-02 12:49:09 -07:00