Commit Graph

5353 Commits

Author SHA1 Message Date
PylanceBot
59bdc42ed8
Update lerna (#3992) 2022-09-28 14:34:34 -07:00
PylanceBot
4047554222
pull-pylance-with-pyright-1.1.273 (#3991)
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>
2022-09-28 10:03:38 -07:00
Eric Traut
f04730ce92 Published 1.1.273 2022-09-27 17:26:24 -07:00
Eric Traut
7ff291348a Revert "Fixed a bug that resulted in incorrect type narrowing based on literal field discrimination (<a>.field == <literal>) where the expression <a> is a member access expression. This addresses https://github.com/microsoft/pyright/issues/3985."
This reverts commit 4d60cc2866.
2022-09-27 17:22:28 -07:00
Eric Traut
130f028f00 Fixed a bug that resulted in incorrect type evaluation for instance variables accessed within a nested loop. This addresses issue https://github.com/microsoft/pyright/issues/3987. 2022-09-27 17:22:09 -07:00
Eric Traut
4d60cc2866 Fixed a bug that resulted in incorrect type narrowing based on literal field discrimination (<a>.field == <literal>) where the expression <a> is a member access expression. This addresses https://github.com/microsoft/pyright/issues/3985. 2022-09-26 07:19:46 -07:00
Eric Traut
889b83c575 Replaced some internal usage of Map with Set. 2022-09-25 11:57:45 -07:00
Eric Traut
a8d5719769 Extended check for base class variance to also detect covariant/contravariant mismatches. This case is unlikely to come up in practice, but it should be included for completeness. This is related to https://github.com/microsoft/pyright/issues/3981. 2022-09-23 08:40:42 -07:00
Eric Traut
cce885c15d Fixed a bug that led to the incorrect inferred type for a parameter in an unannotated __init__ method in the case where the method overrides a method in a base class. 2022-09-23 08:15:17 -07:00
Eric Traut
84a8f93c5a Added a missing check for class-scoped covariant or contravariant TypeVars that are used in a base class where the base class defines the corresponding type parameter to be invariant. This leads to a typing hole, so it should be considered an error. This addresses https://github.com/microsoft/pyright/issues/3981. 2022-09-22 20:23:44 -07:00
Eric Traut
c90fec96bf Removed some unnecessary logic that served no purpose. 2022-09-22 20:15:25 -07:00
Erik De Bonte
9fd1b94c87
Fix argsRemainingCount calculation (#3975) 2022-09-21 08:34:43 -07:00
PylanceBot
7c8ea0ff6a
pull-pylance-with-pyright-1.1.272 (#3976)
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>
2022-09-21 08:15:17 -07:00
Eric Traut
a7f3fdd6a5 Published 1.1.272 2022-09-20 19:28:21 -07:00
Eric Traut
16b3024340 Improved error message for positional parameter count mismatch when the signature contains an unpacked tuple with either a definite or indefinite length. 2022-09-20 19:25:00 -07:00
Erik De Bonte
1b78ef42c5
Increment paramIndex if last parameter is an unfilled unbounded tuple (#3972) 2022-09-20 18:38:02 -07:00
Eric Traut
3b738257dd Extended support for method override completions that use member access expression forms in a parameter's default value expression. This addresses https://github.com/microsoft/pylance-release/issues/3374. 2022-09-20 18:36:50 -07:00
Eric Traut
a04b15a30b Fixed a minor typo in a comment. 2022-09-20 18:35:57 -07:00
Rich Chiodo
54a3638e0f
Simplify createTypeEvaluatorWithTracker to use a factory function (#3967)
* Testing idea for generating type eval docs

* Rework withTracker to use a function factory instead of lambdas

* Make sure time is tracked when not logging

* Remove MD generator idea, not relevant

* Put back package.json

* Remove unnecessary comment

* Review feedback

* Remove unnecessary default

* Ensure filePaths are either strings or AbsoluteModuleDescriptors
2022-09-20 12:39:48 -07:00
Erik De Bonte
4fd75d712a
Use default includes/excludes when user has pyproject.toml (#3965) 2022-09-18 22:42:05 -07:00
Eric Traut
b5e461bfdb Fixed a bug that resulted in incorrect type evaluation when calling a generic class constructor from within that class implementation. This addresses https://github.com/microsoft/pyright/issues/3927. 2022-09-18 21:00:35 -07:00
Eric Traut
92b90d24c1 Improved error message readability for generic class type incompatibilities. 2022-09-18 19:45:22 -07:00
Eric Traut
5197c3416c Updated typeshed stubs to the latest version. 2022-09-17 20:10:23 -07:00
Eric Traut
8766851445 Fixed confusing error message when a value is written to a class attribute that is not defined on the class but is defined on the metaclass but with an incompatible type. This addresses https://github.com/microsoft/pyright/issues/3960. 2022-09-17 19:42:55 -07:00
Eric Traut
3a8d45b2fe Fixed false positive reportInvalidTypeVarUse diagnostic in an overload implementation. This addresses https://github.com/microsoft/pyright/issues/3958. 2022-09-17 16:17:17 -07:00
Eric Traut
43d4098e79 Improved handling of circular dependencies in a generic class hierarchy — in particular, where a class is parameterized by a constrained TypeVar where one of the constraints includes the class or its ancestors. This addresses https://github.com/microsoft/pyright/issues/3955. 2022-09-17 12:53:58 -07:00
Eric Traut
d0ebb412e7 Added bidirectional type inference support for comprehension statements that create generators. This addresses https://github.com/microsoft/pyright/issues/3948. 2022-09-14 22:01:39 -07:00
PylanceBot
df789b5ea0
pull-pylance-with-pyright-1.1.271 (#3946)
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>
2022-09-14 11:42:18 -07:00
Eric Traut
49c18e619c Published 1.1.271 2022-09-13 19:33:58 -07:00
Eric Traut
2fd2d80483 Fixed a bug that resulted in a transient false positive error in certain cases where a member access expression was used within a quoted type annotation. This addresses https://github.com/microsoft/pyright/issues/3944. 2022-09-13 19:31:54 -07:00
Eric Traut
fdd45c8d13 Fixed bug that resulted in incorrect type evaluation when an isinstance type guard results in an intersection type and one of the sources of the intersection is a conditional type. Addresses https://github.com/microsoft/pyright/issues/3935. 2022-09-13 19:14:54 -07:00
Eric Traut
a988708851 Fixed a bug that resulted in incorrect type evaluation when narrowing types for class patterns in a match statement when the matched class is a generic subclass of the subject type. Addresses https://github.com/microsoft/pyright/issues/3940. 2022-09-13 19:02:58 -07:00
Eric Traut
aa68a319f2 Added support for quoted TypeAlias type annotation. Addresses https://github.com/microsoft/pyright/issues/3934. 2022-09-13 17:34:01 -07:00
Eric Traut
0976505663 Fixed bug that results in incorrect narrowing for sequence patterns in a match statement in the negative (fall-through) case when the subject type is a tuple of known length but with elements of type Any. Addresses https://github.com/microsoft/pyright/issues/3938. 2022-09-13 08:50:31 -07:00
Eric Traut
f4ebd41b1b Fixed recent regression that resulted in a false positive error when defining a variable in a class body and using its own field name as a type annotation. Addresses #3924. 2022-09-10 22:00:22 -07:00
Eric Traut
ce5caa2829 Added new check for an attempt to instantiate Dict, Set, List, or Tuple from typing module. This generates a runtime exception. Implements #3921. 2022-09-10 15:50:20 -07:00
PylanceBot
95c059fad7
pull-pylance-with-pyright-1.1.270 (#3920)
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>
2022-09-07 11:59:07 -07:00
Eric Traut
2d195c1c22 Fixed a bug that resulted in infinite recursion when a global statement is used within the global scope of a module. 2022-09-07 07:31:41 -07:00
Eric Traut
a0714e2534 Fixed an infinite recursion bug in the type printer that shows up occasionally in the crash telemetry. 2022-09-07 07:30:43 -07:00
Eric Traut
d746e6b621 Fixed a bug in assertNever internal function that resulted in a crash when attempting to stringify a recursive data structure. This shows up occasionally in the crash telemetry. 2022-09-07 07:30:03 -07:00
Eric Traut
d09fdedba6 Published 1.1.270 2022-09-06 18:04:56 -07:00
Eric Traut
0c3ae9ff55 Revert "Fixed a bug that incorrectly synthesized an __init__ method for a class that derives from a class decorated with dataclass_transform when a class within the hierarchy provides a custom __init__ method."
This reverts commit f74557c6e4.
2022-09-05 19:26:45 -07:00
Eric Traut
05da4588e0 Updated PEP 695 functionality to reflect the latest changes in the spec. 2022-09-04 14:08:08 -06:00
Eric Traut
ae857594d3 Fixed a bug in the type checker that led it to conclude that two types were the same even though they were declared in separate modules. This occurred when the types had the same (local) name and both modules were located within project directories that contained characters that are invalid for module paths in an import statement (e.g. "-"). 2022-09-04 08:41:59 -06:00
Eric Traut
442ffb4a9d Updated typeshed stubs to the latest version. 2022-09-03 19:49:57 -06:00
Eric Traut
f74557c6e4 Fixed a bug that incorrectly synthesized an __init__ method for a class that derives from a class decorated with dataclass_transform when a class within the hierarchy provides a custom __init__ method. 2022-09-03 19:33:39 -06:00
Eric Traut
9bb6a1ab97 Fixed a bug that resulted in a false negative when an annotated variable was assigned an expression that included the variable's name and the variable was undefined prior to the assignment. 2022-09-03 14:55:53 -06:00
Eric Traut
4105b97749 Updated documentation for pre-commit hooks to eliminate confusion and point users to the pyright-python wrapper. 2022-09-03 11:58:28 -06:00
Eric Traut
7b69778781 Fixed bug in type evaluator that caused a false negative in some circumstances when constructing an instance of a generic class within that class implementation. 2022-09-03 08:29:33 -06:00
timsu92
eb94467687
docs: fix wrong description of reportUndefinedVariable (#3903) 2022-09-03 06:36:38 -06:00