Commit Graph

3731 Commits

Author SHA1 Message Date
Heejae Chang
abd41b7273
Added literal type support in more places, fixed using wrong console bug and some refactoring around Host environment (#2176) 2021-08-11 13:11:54 -07:00
Eric Traut
bf8b5511d3 Fixed false positive error caused by inappropriate method binding for instance methods. 2021-08-11 11:53:23 -07:00
Eric Traut
fbb0d521ee Fixed regression that affected type narrowing of subscript expressions for TypedDict objects. 2021-08-11 09:28:50 -07:00
Eric Traut
ae2cb23bbc Improved "implied else" code flow logic to handle nested "implied else" constructs. 2021-08-10 21:52:08 -07:00
Eric Traut
e79a9d613e Improved match statement code flow logic to handle the case where a pattern is exhausted prior to the last case statement. 2021-08-10 21:49:09 -07:00
Eric Traut
c2bb348134 Added support for unpacking of objects that derive from known-length tuples. This includes named tuples. 2021-08-10 09:14:06 -07:00
Eric Traut
6748614a64 Published 1.1.161 2021-08-09 19:11:42 -07:00
Eric Traut
c5cda36782 Updated typeshed stubs to the latest version. 2021-08-09 19:11:13 -07:00
Eric Traut
231eb6ddaf Fixed false positive error when accessing __name__ instance variable in a class that derives from type. 2021-08-09 18:53:24 -07:00
Eric Traut
2e1e36077a Fixed a bug that caused methods in generic classes to be specialized twice when accessed through a member access expression. 2021-08-09 10:05:31 -07:00
Eric Traut
8132542376 Fixed style issue 2021-08-09 08:48:03 -07:00
Eric Traut
5536abf933 Added support for descriptor protocols defined on metaclasses. 2021-08-09 08:41:20 -07:00
Eric Traut
2a0d791e50 Fixed style issue. 2021-08-08 18:35:32 -07:00
Eric Traut
c544a75fbb Changed method and attribute override compatibility checks to check for inappropriate overrides of all base classes in the multi-inheritance case. Previously, this check used MRO, so some override mismatches were left unreported if they were obscured by another base class. The change also affects @final checks. 2021-08-08 18:28:47 -07:00
Eric Traut
1b54ffc291 Fixed a bug that was masking some error messages when multiple errors were reported for the same range and their message started with the same 25 characters. 2021-08-08 18:20:12 -07:00
Eric Traut
315da0227e Added heuristic to allow proper inference of list expressions when used as the RHS operand in an expression of the form my_list + [x]. 2021-08-08 13:17:12 -07:00
Eric Traut
67dc7f7385 Improved logging for import failures. The previous code was printing the same log message for both stub and non-stub package resolution attempts which resulted in seemingly redundant messages. 2021-08-08 09:13:24 -07:00
Eric Traut
0bf45ea2ed Added support for new type narrowing pattern for discriminating among tuples. The pattern is V[I] == L or V[I] != L where I is an integer literal, L is another literal value, V is a tuple with a known length and a type at index I that is declared as a literal type. 2021-08-06 23:17:21 -07:00
Eric Traut
2acdd174f0 Added support for bidirectional type inference for assignment expressions where the LHS is an index expression that indexes into a TypedDict instance. 2021-08-06 08:36:32 -07:00
Eric Traut
923eb705c3 Fixed bug that resulted in a false when evaluating nested lambdas (i.e. a lambda that returns a lambda). 2021-08-06 08:14:16 -07:00
Eric Traut
0cf1c82563 Fixed bug in declaration provider that caused declaration not to be found when it referred to a metadata method. 2021-08-06 08:13:37 -07:00
Eric Traut
7dbd463f4a Published 1.1.160 2021-08-05 23:17:24 -07:00
Eric Traut
015de94f89 Implemented support for new Python 3.10 dataclass features: kw_only parameter for dataclass and field and KW_ONLY separator. 2021-08-05 23:10:58 -07:00
Eric Traut
74a24b7efc Fixed bug in the handling of generic recursive type aliases. 2021-08-05 20:33:37 -07:00
Eric Traut
111d3b8a98 Removed the assumption that all top-level modules in typeshed third-party stubs are unique. The typeshed folder structure allows multiple packages to have the same top-level module. 2021-08-05 16:53:25 -07:00
Jake Bailey
9ba8d6bdba
Update dependencies (#2156) 2021-08-05 16:03:07 -07:00
Nihaal Sangha
bf0bd17268
Update issue template labels (#2155) 2021-08-05 15:19:47 -07:00
Eric Traut
94ba4e21e3 Fixed bug where a union of Literal[False] and Literal[True] were being coalesced into bool inappropriately in the case where they were conditional types that came from a constrained TypeVar. 2021-08-05 13:47:51 -07:00
Eric Traut
8ee2fc001e Fixed bug that verified that a protocol class used within an isinstance call is runtime_checkable. It was skipping this check when the first argument to isinstance was an Any or Unknown type. 2021-08-05 13:47:51 -07:00
Heejae Chang
dfb796d84c
upgrade vscode dependency to 1.57 (#2147) 2021-08-04 12:26:18 -07:00
Eric Traut
1bda9b05c3 Fixed bug in x is None type narrowing logic when x was typed as object. 2021-08-04 07:02:36 -07:00
Eric Traut
7ee5feb4e7 Fixed false positive that occurs when defining an abstract dataclass and one of its fields refers to the class itself in its type annotation. 2021-08-03 07:01:42 -07:00
Eric Traut
bfc4fc3a13 Updated typeshed stubs to the latest version 2021-08-01 08:30:52 -07:00
Eric Traut
1d015d2db3 Fixed bug that prevented "rename symbol" from working when in single-file mode. Rather than failing, it will now perform a rename only within a single file. 2021-08-01 08:13:08 -07:00
Eric Traut
a7df474075 Updated the "type(x) is y" type narrowing logic to handle the negative case when the class type is "final". 2021-07-31 19:29:28 -07:00
Eric Traut
bcf7ce7f2b Published 1.1.159 2021-07-30 22:34:01 -07:00
Eric Traut
726ff55bba Fixed false positive error when @property is combined with @functools.cache. 2021-07-30 22:24:36 -07:00
Eric Traut
f5676d3c0c Modified assignment type narrowing for index expressions so it applies only to built-in types. This eliminates incorrect type inference when using a class that has assymetric __setitem__ and __getitem__ methods. 2021-07-29 21:02:32 -07:00
Eric Traut
ab49b4254d Added logic to enforce protocol mismatches if a member in the protocol is marked "Final" and the class is not (or vice versa). 2021-07-29 20:36:08 -07:00
Eric Traut
4d727e7290 Added check for inappropriate use of ClassVar that will generate runtime exceptions. 2021-07-29 14:50:07 -07:00
Eric Traut
6a867b651a Implemented new check for a class that is decorated with @final but does not implement all abstract methods from abstract classes that it derives from. 2021-07-29 14:11:55 -07:00
Eric Traut
f02a069650 Fixed style issue. 2021-07-29 00:39:10 -07:00
Eric Traut
198649c602 Added check for illegal use of "Protocol" as a type argument. 2021-07-29 00:30:12 -07:00
Eric Traut
8f79bc2cab Added check for illegal trailing comma in "from x import y," statement. This generates a syntax error at runtime. 2021-07-29 00:23:03 -07:00
Eric Traut
e6efcc661c Replaced unsafe use of objects with Map. 2021-07-29 00:14:46 -07:00
Eric Traut
3010fa0909 Fixed bug in "type(x) is y" type narrowing logic to handle the case where x is an instance of a generic class. 2021-07-29 00:02:07 -07:00
Jake Bailey
9a2379d1b3
Fixed bug in tokenizer which treated 'constructor' as a keyword (#2126) 2021-07-28 16:59:11 -07:00
Bill Schnurr
fa453b2e5d
Add VirtualDirent class, URI path conversion Updates, Language Updates, Improved OpenFile mode (#2125) 2021-07-28 10:29:58 -07:00
Eric Traut
eac4d7d142 Added a new log error for the case where enumeration of files within the workspace is taking longer than 10 seconds. 2021-07-27 20:33:09 -07:00
Eric Traut
5a8296605e Fixed several bugs that caused crashes (dereference of undefined variable) in certain circumstances. 2021-07-27 17:45:22 -07:00