Commit Graph

5156 Commits

Author SHA1 Message Date
dependabot[bot]
cdb3516e1c
Bump parse-url from 6.0.0 to 6.0.2 (#3661)
Bumps [parse-url](https://github.com/IonicaBizau/parse-url) from 6.0.0 to 6.0.2.
- [Release notes](https://github.com/IonicaBizau/parse-url/releases)
- [Commits](https://github.com/IonicaBizau/parse-url/commits)

---
updated-dependencies:
- dependency-name: parse-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-05 21:04:12 -07:00
Eric Traut
5ac7a93735 Implemented optimization for type evaluation for index expressions. In cases where there are multiple subexpressions separated by commas, we can skip the check for the __index__ magic method. 2022-07-04 21:40:53 -07:00
Eric Traut
5fffd5bbcf Added optimization for slice expression evaluation. It can be skipped in cases where the we are speculatively evaluating the type. 2022-07-04 21:39:42 -07:00
Eric Traut
eeab5b127c Fixed bug in the expression printer. It was not properly handling a minimal slice (:). 2022-07-04 21:34:27 -07:00
Eric Traut
8bc14efec8 Fixed a bug in the handling of generic type aliases that are parameterized by ParamSpecs in the case where an explicit type argument is not provided. The type argument should default to ... in this case. 2022-07-04 11:03:07 -07:00
Eric Traut
f3d8345b75 Updated README to include provisional PEPs. 2022-07-04 10:47:08 -07:00
Eric Traut
991d8e787f Fixed a bug that resulted in incorrect type narrowing when using an in expression and the LHS operand is of type type. This situation requires some special casing. 2022-07-03 10:16:01 -07:00
Eric Traut
4c47b0b391 Published 1.1.257 2022-07-02 19:06:28 -07:00
Eric Traut
3caf21a62f Updated typeshed stubs to the latest version. 2022-07-02 19:04:12 -07:00
Eric Traut
d7e25718d7 Implemented provisional support for proposed PEP 695: Improved Syntax for Type Parameters. The new functionality is available only if you manually configure pyright to assume Python 3.12. It supports the new type parameter syntax, support for "type" statements (for type alias declarations) and support for autovariance. 2022-07-02 18:55:09 -07:00
Eric Traut
6e4d539aa7 Fixed a bug that resulted in incorrect type evaluation of NewType for versions of python older than 3.8. (In 3.8, NewType was changed from a function to a class.) 2022-07-02 18:52:02 -07:00
Eric Traut
0590eee0d2 Fixed several bugs that resulted in incorrect type evaluations when a property getter or method has an inferred return type that contains a type variable. 2022-07-02 18:21:09 -07:00
Erik De Bonte
df1b863b51
Pull Pylance 2022.7.11 (#3647) 2022-07-01 13:33:08 -07:00
Eric Traut
26cfeb97c7 Fixed a bug in the handling of for loops that resulted in incorrect type inference for the target expression. 2022-07-01 01:30:33 -07:00
Eric Traut
d9b22cfc3b Improved performance in type guard logic by not evaluating a call expression base type until after verifying that the call potentially narrows the reference expression. 2022-06-30 18:10:39 -07:00
Eric Traut
2f726c712b Improved performance of semantic highlights, hover, and completion suggestions for member access expressions. 2022-06-30 18:09:46 -07:00
Heejae Chang
7490376195
don't use "." as one of commit char (#3642) 2022-06-30 15:39:26 -07:00
Eric Traut
4784a9ed88 Changed type_assert diagnostics to fall under reportGeneralTypeIssues diagnostic rule rather than be emitted unconditionally. 2022-06-29 21:33:51 -07:00
Eric Traut
0bcf445ebc Implemented performance optimization related to overload evaluation. 2022-06-29 20:20:36 -07:00
Eric Traut
0d2a0414e3 Fixed merge issue. 2022-06-29 20:18:43 -07:00
Bill Schnurr
7cadfb7412
update dependencies (#3638) 2022-06-29 15:56:46 -07:00
Eric Traut
327ed377ba Fixed regression in isinstance type narrowing when the filter type is a type[x] rather than x. 2022-06-29 11:27:22 -07:00
Eric Traut
b2b49e26fb Moved some common code for isinstance type guard filtering to eliminate duplication and a source of potential bugs. No functional change. 2022-06-29 10:33:27 -07:00
Eric Traut
d7a5632a2c Added unit test for the previous check-in. 2022-06-29 09:19:42 -07:00
Eric Traut
2e66fc7438 Reverted recent change that resulted in false positive errors when using _ as a placeholder name for methods that are used with @register and similar decorators. 2022-06-29 09:15:49 -07:00
Eric Traut
66c44cff55 Published 1.1.256 2022-06-27 23:42:21 -07:00
Eric Traut
a358ac23a1 Fixed bug that resulted in a false positive error when handling a generic TypedDict with a literal type argument. 2022-06-27 11:31:59 -07:00
Eric Traut
6ed0571adf Fixed a bug in the handling of dataclass where an existing __eq__ method was being overwritten by a synthesized variant. The same was true for other comparison operators. 2022-06-27 08:27:26 -07:00
Eric Traut
9bad0897c6 Fixed a few inconsistent behaviors with incompatible redeclaration reporting. In particular, it's now OK to reassign a function if the assigned value is a compatible function. Also tightened up the special-casing for the symbol _, which is allowed to be redeclared only in the case where both declarations are functions (def statements). This exemption is provided for the single dispatch use case. 2022-06-27 00:53:01 -07:00
Eric Traut
ce9d689e15 Fixed a bug that resulted in a false positive when applying issubclass type narrowing from a type to an abstract class. 2022-06-24 00:20:25 -07:00
Eric Traut
72b063fa55 Fixed case sensitivity problem with test from previous commit. 2022-06-23 09:40:33 -07:00
Eric Traut
c1cb71370d Fixed bug in isinstance type guard logic that resulted in incorrect narrowing when using a dynamic type or types for the second argument. 2022-06-23 09:27:24 -07:00
Eric Traut
04945a4309 Made tweak to documentation for clarity. 2022-06-23 08:34:18 -07:00
PylanceBot
212d146574
[PylanceBot] Pull Pylance with Pyright 1.1.255 (#3606)
Co-authored-by: HeeJae Chang <hechang@microsoft.com>
Co-authored-by: Erik De Bonte <erikd@microsoft.com>
2022-06-22 13:56:46 -07:00
Eric Traut
1d0abc2411 Moved annotationNotSupported diagnostics under the reportGeneralTypeIssues diagnostic rule so they can be disabled. 2022-06-21 21:22:22 -07:00
Keming
de86a34dd4
fix typo (#3601) 2022-06-21 19:08:37 -07:00
Eric Traut
50d56824c0 Fixed false positive that occurs when overriding an abstract method (e.g. a property) with a field from a named tuple when both are used as base classes. 2022-06-21 13:27:59 -07:00
Eric Traut
44b813c761 Simplified method for determining which abstract methods are not overridden by reversing MRO traversal. No functional change. 2022-06-21 13:27:01 -07:00
Eric Traut
9ad93f8345 Added method ClassType.getReverseMro as a way to clean up a common usage pattern. No functional change. 2022-06-21 13:24:13 -07:00
Eric Traut
11f1a6e48f Improved error message generated when comparing two functions that return TypeGuard return types with incompatible types. 2022-06-21 09:44:46 -07:00
Eric Traut
a08f716f98 Published 1.1.255 2022-06-20 01:12:51 -07:00
Eric Traut
1126711a5d Fixed a bug that resulted in a false negative when assigning a union of tuple[Any] | tuple[int] to an incompatible type. 2022-06-20 00:57:13 -07:00
Eric Traut
8ffea77bf0 Updated typeshed stubs to the latest version. 2022-06-19 23:53:23 -07:00
Eric Traut
8a433a75e0 Changed heuristics in TypeVar constraint solver to handle a TypeVar bound to LiteralString and allow literal types to be retained when solving for this TypeVar. 2022-06-19 20:05:13 -07:00
Eric Traut
de43c9d6c6 Switched from a Map to a Set internally since the former was unneeded. No functional change. 2022-06-19 00:38:08 -07:00
Eric Traut
213223d0cf Added support for overloaded functions that return a TypeGuard or StrictTypeGuard for some overloads. 2022-06-19 00:32:21 -07:00
Eric Traut
b688bebc61 Fixed a bug that resulted in a false negative when performing protocol matching for a class instance when invariance is enforced. 2022-06-19 00:08:42 -07:00
Eric Traut
4ae8b9233e Made suggested improvements to documentation. 2022-06-18 23:00:11 -07:00
Erik De Bonte
35449571db
Auto-import should include import aliases from libraries (#3584) 2022-06-17 22:38:27 -07:00
Eric Traut
0f6ea804f6 Fixed bug that resulted in missing docstrings on an overloaded method when accessed through a member access expression. 2022-06-17 08:23:53 -07:00