Граф коммитов

8059 Коммитов

Автор SHA1 Сообщение Дата
Eric Traut 7fd5ed20be Published 1.1.376 2024-08-13 17:56:41 -06:00
Eric Traut 75dfc6bbf9
Fixed bug that results in a confusing type in an error message when `isinstance` type narrowing between a `type` and another type creates a subclass. (#8753) 2024-08-13 09:33:21 -06:00
Eric Traut 796a483119
Fixed bug that leads to a hang under certain circumstances involving deeply-nested higher-order functions. This addresses #8723. (#8752) 2024-08-13 09:21:14 -06:00
Eric Traut c9a4eb2252
Changed behavior for protocols that have methods with method-scoped type variables. These are no longer treated as free type variables during protocol matching, so they can be used to support rank-2 polymorphism. This behavior is not currently dictated by the typing spec, but it is more consistent with mypy. This addresses #8685. (#8751) 2024-08-12 23:55:05 -06:00
Eric Traut cef8bbb903
Fixed bug that leads to false positive error when a protocol has a read-only property a class has a Final variable. This addresses #8744. (#8747) 2024-08-11 19:50:02 -06:00
Eric Traut aff4bfbfa3 Did some code cleanup with unpacked tuples and TypeVarTuples. 2024-08-11 00:38:15 -06:00
Eric Traut 2c9c42481f Removed vestigial code in `Union` type arg logic. 2024-08-10 23:05:27 -06:00
Eric Traut fe3eca368a
Fixed bug that results in a confusing type in an error message when `isinstance` type narrowing between a `type` and another type creates a subclass. (#8741) 2024-08-10 18:32:46 -06:00
Eric Traut 142daa0a07
Removed some unnecessary special casing of None in type guard logic. (#8740) 2024-08-10 18:23:59 -06:00
Eric Traut 3905cfb852
Another round of simplification for callable return types. (#8737) 2024-08-10 13:26:07 -06:00
Eric Traut 2b82d07f69 Added small performance optimization in checker to avoid generating a diagnostic message in cases where it won't be used. 2024-08-10 12:42:17 -06:00
Eric Traut 913d18d960
Renamed some internal functions for readability and added options parameter to getEffectiveReturnType function. This is in preparation for a more involved change to fix #8723. (#8736) 2024-08-10 12:40:29 -06:00
Eric Traut 07ca233ba7 Updated typescript compiler version from 5.2 to 5.5.4 to avoid a bug I was hitting. 2024-08-10 10:58:10 -06:00
Eric Traut 1a17c0aa6b
Changed synthesized comparison methods (`__lt__`, etc.) for dataclasses when `order=True` to use `Self` rather than an instance of the class. This is not only more consistent with other synthesized methods, but it also preserves covariance of type variables if the dataclass is frozen. (#8734) 2024-08-10 10:27:32 -06:00
Eric Traut 465b04c80b Fixed a bug in the code that detects attribute docstrings to prevent it from walking all the way to the top of the parse tree. 2024-08-10 09:52:18 -06:00
Eric Traut 4fc5de5c1e
Fixed a false positive error when solving type variables in a call that involves a lambda. This addresses #8714. (#8730) 2024-08-10 00:47:49 -06:00
Rich Chiodo f85e257026
Special case pythonPath to also come from the languageServer (#8728)
* Special case pythonPath to also come from the languageServer

* Compare URI correctly
2024-08-09 18:49:18 -06:00
Rich Chiodo 2aa9bf4c20
Reapply the compiler flags change but separate out the 'language server' specific settings (#8726)
* Document different types of 'compiler' flags and ensure merging of flags is consistent (#8704)

* Make sure config options cannot be overridden by settings.json

* Make sure extraPaths and python env information is updated from the command line

* Change fromVsCodeExtension to fromLanguageServer

* Separate command line options into json ones and language server ones

* Fix build error
2024-08-09 16:15:38 -07:00
Eric Traut 152350997d
Enhanced argument-to-parameter matching logic to support dictionary unpacking where the dict key type is a union of literals. This addresses #8671. (#8724) 2024-08-09 15:30:43 -06:00
Eric Traut de0386d690 Revert "Document different types of 'compiler' flags and ensure merging of flags is consistent (#8704)"
This reverts commit a86210ccb7.
2024-08-09 13:20:55 -06:00
Eric Traut 421a87fd8a
Improved consistency of parameter name restrictions for the `reportSelfClsParameterName` check. Previously, different rules were applied to `__new__` and class methods within metaclasses. This addresses #8717. (#8720) 2024-08-09 13:11:34 -06:00
Rich Chiodo a86210ccb7
Document different types of 'compiler' flags and ensure merging of flags is consistent (#8704)
* Make sure config options cannot be overridden by settings.json

* Make sure extraPaths and python env information is updated from the command line

* Change fromVsCodeExtension to fromLanguageServer
2024-08-09 10:38:33 -07:00
Eric Traut f68a616eb2 Fixed bug that produces signatures with extra (unnecessary) positional-only and keyword-only separators when using a TypedDict with zero fields. This addresses #8712. 2024-08-09 08:39:51 -06:00
Eric Traut 778509b20d Cleaned up some out-of-date comments and removed a circular import. 2024-08-09 00:24:02 -06:00
Eric Traut 55e1681568
Fixed bug that results in a false negative `reportIncompatibleMethodOverride` when the child class method uses a type parameter that is scoped to the child class. This addresses #8622. (#8711) 2024-08-09 00:04:00 -06:00
Eric Traut fd68169161 Renamed PopulateExpectedType flag and clarified its purpose. 2024-08-08 19:32:59 -06:00
Eric Traut 77dc8848c5 Simplified internal `validateArgTypes` function. 2024-08-08 19:26:16 -06:00
Eric Traut 93115f9232
Renamed OverloadedFunctionType to OverloadedType for brevity and to reflect the fact that non-function types are now supported for overloads. No functional change, just a rename. (#8708) 2024-08-08 18:16:30 -06:00
Eric Traut 1d5420cb75
Further simplified TypeVar constraint tracking and solving. Removed the need to track separate constraints for dest and src. (#8707) 2024-08-08 17:58:48 -06:00
Eric Traut 3e448e7615
Fixed regression that resulted in a hang when determining whether an overload implementation with generics was compatible with its overloads. This addresses #8687. (#8706) 2024-08-08 17:29:08 -06:00
Kacie Kang 1f193580c8
Fix fileInfo null error (#8702)
* fix file info null reference

* check for binding

* removing fileinfo in if statement
2024-08-08 16:08:33 -07:00
Eric Traut e8f0965e5b
Removed overly-complicated (and buggy) internal function setTypeArgsRecursive. (#8703) 2024-08-08 13:48:16 -06:00
Eric Traut 65ea3e95b4
Fixed bug that results in a false positive error when type argument for `Literal` doesn't follow type expression rules within a value expression context. This addresses 8696. (#8700) 2024-08-08 12:37:39 -06:00
Eric Traut efda709120
Fixed a bug that results in a false positive reportInconsistentOverload error when the implementation of the overload includes a decorator that changes the type of the implementation to a non-function type. This addresses #8692. (#8699) 2024-08-08 12:26:27 -06:00
Eric Traut 2b603b9144
Modified OverloadedFunctionType interface in preparation for a follow-on change. Users of OverloadedFunctionType must now use the accessor functions to get the overloads and implementation. (#8695) 2024-08-08 09:32:21 -06:00
Eric Traut 8c628b0bc4 Fixed bug that results in a crash when an empty tuple is used to specialize a generic type alias parameterized by a ParamSpec. This addresses #8694. 2024-08-08 00:13:28 -06:00
Eric Traut 3d52679f59 Added optimization to shortcut overlapping overload checks if the diagnostic is suppressed. 2024-08-07 12:10:32 -06:00
Eric Traut 51c98aa945 Added small optimization that skips checks for overload consistency if these diagnostics are suppressed. 2024-08-07 12:06:15 -06:00
Eric Traut d2c0938f2b Updated example execution environments in documentation to include type checking settings. 2024-08-07 10:29:56 -06:00
Eric Traut f0c0dc8d4d Published 1.1.375 2024-08-06 20:32:59 -06:00
Bill Schnurr 5589f06936
Update azuredevops release pipeline (#8402)
* Update azure-pipelines-release.yml

* change build-visx timeout to 1 hour

* Update azure-pipelines-release.yml for Azure Pipelines

* Update azure-pipelines-release.yml for Azure Pipelines

* Update azure-pipelines-release.yml disable codeql

* add tag override for testing

* change override tag

* revert custom tag

* remove condition on publish
2024-08-06 16:09:31 -07:00
Eric Traut e5889207ff Fixed bug that causes infinite recursion and memory exhaustion under certain circumstances involving recursive type aliases where the type alias is used as a type argument. This addresses #8670. 2024-08-06 16:39:26 -06:00
Eric Traut 1ab7801331
Fixed bug in type narrowing logic for value patterns, specifically when two enums with members of the same name are involved. This addresses #8674. (#8682) 2024-08-06 13:10:35 -06:00
Eric Traut c285825dea
Allow `Final` and `ClassVar` to be combined in both directions within a dataclass. Previously, the `Final` qualifier needed to be the outermost. This addresses #8676. (#8678) 2024-08-06 11:44:51 -06:00
Eric Traut 08e02e450b
Added support for `bool` expansion to `Literal[True] | Literal[False]` during pattern matching when using value patterns. (#8677) 2024-08-06 11:11:47 -06:00
Eric Traut c1df6595a1
Fixed a bug that results in incorrect type narrowing when using `isinstance` with an instance of a generic class as the first argument and a concrete subclass as the filter type. This addresses #8672. (#8675) 2024-08-06 10:30:12 -06:00
Eric Traut 35ab773671
Another round of simplification for TypeVar solving. Add support for recursive solutions (i.e. a TypeVar that has an upper or lower bound that depends on another TypeVar). (#8663) 2024-08-05 14:12:05 -06:00
Eric Traut 4d471f154f Updated typeshed stubs to the latest version. 2024-08-05 13:25:56 -06:00
Eric Traut c10fa6d535
Fixed a bug that results in incorrect type narrowing for truthy/falsy type guards consisting of an Enum member when the enum class derives from ReprEnum. In this case, the "magic" of the enum implementation forwards the `__bool__` call to the underlying value. This addresses #8658. (#8662) 2024-08-05 13:03:06 -06:00
Eric Traut 9a5643fc5f
Further simplified TypeVar constraint tracking and solving. Removed precomputed "lowerBoundNoLiterals" from tracker. (#8656) 2024-08-05 10:31:15 -06:00