Commit Graph

5779 Commits

Author SHA1 Message Date
Eric Traut
f5e43ca29f Published 1.1.295 2023-02-22 01:03:48 -07:00
Eric Traut
f4aae1a98f Fixed bug that resulted in incorrect type evaluation when a __new__ is called and is bound to a class that is different from the cls argument passed to it. This addresses https://github.com/microsoft/pyright/issues/4668. 2023-02-22 01:01:40 -07:00
Declan Brady
28ef5bcbf0
Added parameter documentation on hover from function docString (#4655)
* Added parameter documentation on hover from function docString

* Added test cases for hover, cleaned up nits

* Added edge case test for parameter symbol reassignment

* Ran prettier

---------

Co-authored-by: Rich Chiodo <rchiodo@users.noreply.github.com>
2023-02-21 15:07:58 -08:00
Eric Traut
6017cdad5e Updated typeshed stubs to the latest. 2023-02-21 01:14:08 -07:00
Eric Traut
8024a16ed0 Fixed test case that was broken by changes in typeshed definition of object.__class__. 2023-02-21 01:11:09 -07:00
Eric Traut
ea23ba58b1 Fixed issue that caused the type of None.__class__ to be evaluated incorrectly with new typeshed definition of object.__class__. 2023-02-21 01:10:38 -07:00
Eric Traut
d62aff206e Fixed a bug that resulted in a false positive diagnostic when using a TypeVarLike with a default value by itself in a function signature. This addresses https://github.com/microsoft/pyright/issues/4667. 2023-02-20 16:59:48 -07:00
Eric Traut
d22850b041 Fixed a bug that resulted in a false positive "overlapping overload" diagnostic in certain cases. This addresses https://github.com/microsoft/pyright/issues/4622. 2023-02-20 09:57:21 -07:00
Eric Traut
453e3b26fb Fixed a bug that caused a Final variable to lose its literal value when imported from another file. This addresses https://github.com/microsoft/pyright/issues/4661. 2023-02-19 12:20:51 -07:00
Eric Traut
7fc77ec149 Fixed a bug that resulted in an incorrect inferred function return type when one or more of the return statements returned an expression based on an empty container ({} or []). This addresses https://github.com/microsoft/pyright/issues/4654. 2023-02-17 09:49:06 -07:00
Eric Traut
36e9e448fd Added logic to exempt a self with annotated type Never from the check that verifies the self type is a subtype of the class. This addresses https://github.com/microsoft/pyright/issues/4653. 2023-02-17 09:02:35 -07:00
Eric Traut
5162b3d882 Fixed a bug that led to false positive errors when evaluating comparison operator overrides (e.g. __eq__ or __lt__) in cases where the LHS type didn't support the comparison but the RHS type did. This addresses https://github.com/microsoft/pyright/issues/4636. 2023-02-15 13:23:35 -08:00
Eric Traut
085dfbfa2d Updated the handling of type narrowing for class pattern matching in cases where a class subclasses from one of the special built-in types listed in PEP 634 as treating a single positional argument as matching the entire subject. The behavior of the CPython implementation deviates from the PEP in this manner, but the implementation takes precedent over the spec in this case. This addresses https://github.com/microsoft/pyright/issues/4634. 2023-02-15 02:28:29 -08:00
Eric Traut
58f6824913 Published 1.1.294 2023-02-14 21:29:23 -08:00
Eric Traut
7be253b45e Fixed a bug that resulted in a false positive when accessing an instance method from a metaclass (i.e. a class that derives from type) if the self parameter of that instance method is annotated with a type[T] annotation. This addresses https://github.com/microsoft/pyright/issues/4637. 2023-02-14 21:27:30 -08:00
Bill Schnurr
ab7fa64e0b
Push pylance changes to pyright (#4639) 2023-02-14 21:18:06 -08:00
Eric Traut
344b091bfe Minor formatting improvements to documentation. 2023-02-14 18:23:13 -08:00
Eric Traut
9e585a630c Added error reporting for malformed # pyright comments. This addresses https://github.com/microsoft/pyright/issues/4630. 2023-02-14 00:21:07 -08:00
Eric Traut
bf7f326805 Fixed bug that led to incorrect type evaluation when a yield statement was used in conjunction with a declared Iterator return type. This addresses https://github.com/microsoft/pyright/issues/4631. 2023-02-13 13:01:36 -08:00
Eric Traut
13492d8126 Improved error handling for constructor call to NoneType. 2023-02-12 10:39:45 -08:00
Eric Traut
d40c156879 Fixed bug that resulted in a false positive error when calling type(None)(). This addresses https://github.com/microsoft/pyright/issues/4627. 2023-02-12 10:33:27 -08:00
Erik De Bonte
8caefa502c
Change dataClassFieldWithDefault from error to diagnostic (#4614) 2023-02-11 12:17:43 -08:00
dependabot[bot]
76d18391e5
Bump cacheable-request from 10.2.2 to 10.2.7 (#4612)
Bumps [cacheable-request](https://github.com/jaredwray/cacheable-request) from 10.2.2 to 10.2.7.
- [Release notes](https://github.com/jaredwray/cacheable-request/releases)
- [Commits](https://github.com/jaredwray/cacheable-request/commits)

---
updated-dependencies:
- dependency-name: cacheable-request
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Traut <eric@traut.com>
2023-02-10 17:26:55 -08:00
Rich Chiodo
67d23318b7
Completions and signature help for PEP 692 (#4599)
* Completions and signature help for PEP 692

* Fix comment

* More comment changes

* Use common function for parameter checking

* Review feedback

* Update comment

* More review feedback
2023-02-10 16:41:31 -08:00
Heejae Chang
662bcb539a
Use binary search in findNodeByOffset if we can. (#4607)
* use binary search in findNodeByOffset if we can

* address PR feedbacks
2023-02-10 15:27:20 -08:00
Eric Traut
06917bb920 Removed typeshed tensorflow stubs because they're too incomplete at this time. This addresses https://github.com/microsoft/pylance-release/issues/3937. 2023-02-10 06:16:24 -08:00
Eric Traut
5d735d40b2 Fixed a bug that results in a false positive error when using Self in a type annotation for a parameter with a default value. This addresses https://github.com/microsoft/pyright/issues/4605. 2023-02-09 21:38:06 -08:00
Eric Traut
2191a20105 Fixed false negative error where an attempt to assign a value of type type[T] to type T was not flagged as an error. This addresses https://github.com/microsoft/pyright/issues/4609. 2023-02-09 20:45:58 -08:00
Eric Traut
e7e19af579 Fixed a false negative where a variable used within a TypeAlias definition was not flagged as an error. This addresses https://github.com/microsoft/pyright/issues/4598. 2023-02-08 20:59:42 -08:00
PylanceBot
dec6aa2096
[PylanceBot] Pull Pylance with Pyright 1.1.293 (#4595)
Co-authored-by: Bill Schnurr <bschnurr@microsoft.com>
2023-02-08 13:42:49 -08:00
Eric Traut
4eb4397a90 Updated documentation for default exclude settings. 2023-02-08 13:09:55 -08:00
Eric Traut
f3a7ba79f1 Fixed a bug that led to a false positive error when using a type alias within an __init__ or __hash__ method in a dataclass. This addresses https://github.com/microsoft/pyright/issues/4596. 2023-02-08 12:01:29 -08:00
Eric Traut
ceb2a2d5a4 Published 1.1.293 2023-02-07 21:22:44 -08:00
Eric Traut
06e750935f Fixed bug in signature help that resulted in incorrect or misleading signature for a constructor call when the __init__ method accepts no arguments. This addresses https://github.com/microsoft/pylance-release/issues/3916. 2023-02-07 08:54:44 -08:00
Eric Traut
8b0c7257d7 Updated typeshed stubs to the latest. 2023-02-06 16:49:13 -08:00
Eric Traut
a0e80925c7 Fixed bug that resulted in a false positive when using a ParamSpec with an overloaded function. 2023-02-06 16:38:17 -08:00
Eric Traut
492332796a Implemented support for overloaded functions captured by a ParamSpec. This addresses https://github.com/microsoft/pyright/issues/4572. 2023-02-05 20:53:59 -08:00
Eric Traut
e6fbf54730 Added error for a dataclass that uses a private attribute name that appears within a synthesized __init__ method. This addresses https://github.com/microsoft/pyright/issues/4584. 2023-02-04 23:52:54 -08:00
Eric Traut
8632688b4b Simplified typeVarContext by combining tuple types into main TypeVar map entries. 2023-02-04 13:43:19 -08:00
Eric Traut
9dabb3a3cf Fixed a bug that led to a false positive error when a magic method (such as in a binary operation) was used with bidirectional type inference. This addresses https://github.com/microsoft/pyright/issues/4576. 2023-02-04 13:01:04 -08:00
Eric Traut
fa88fbd571 Fixed false negative bug when checking for valid use of identifiers within a type annotation. Variables used within a type annotation should always generate an error, even if the variable is imported from another file. This addresses https://github.com/microsoft/pyright/issues/4582. 2023-02-04 08:23:19 -08:00
Eric Traut
f4d022b829 Fixed a bug that resulted in a false positive error and incorrect type evaluation when a lambda is evaluated with an incomplete "expected" type. This addresses https://github.com/microsoft/pyright/issues/4567. 2023-02-03 23:32:02 -08:00
PylanceBot
a822ae55d3
[PylanceBot] Pull Pylance with Pyright 1.1.292 (#4581) 2023-02-03 15:55:13 -08:00
Eric Traut
dd08483a90 Improved handling of a class declaration that uses a dynamic unpacked argument type to define its base classes. This addresses https://github.com/microsoft/pyright/issues/4580. 2023-02-03 14:02:44 -08:00
Bill Schnurr
3a8155d572
modifying class and function signatures to make them more textmate co… (#4575) 2023-02-03 11:10:28 -08:00
Eric Traut
6078f13404 Added specialized logic to better handle imports of the form from .x import x where x is later referenced from an inner scope within the module. This addresses https://github.com/microsoft/pyright/issues/4579. 2023-02-03 09:56:20 -08:00
dependabot[bot]
dbc5c4232d
Bump http-cache-semantics from 4.1.0 to 4.1.1 (#4578)
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-03 07:12:43 -08:00
Eric Traut
d1a8be7b7a Tweaked the "type complexity" heuristic to produce more intuitive results in the constraint solver. This addresses https://github.com/python/typing/discussions/1342. 2023-02-02 15:20:13 -08:00
Eric Traut
cb2c338335 Fixed a bug that resulted in an inconsistent "import not accessed" diagnostic based on evaluation ordering. 2023-02-02 13:12:28 -08:00
Eric Traut
b3ff34f90b Marked PEP 698 as no longer "draft" since it was accepted. 2023-02-02 07:53:44 -08:00