Commit Graph

7204 Commits

Author SHA1 Message Date
Eric Traut
9c0c056b1f
Fixed regression that resulted in a false positive error when calling an abstract method on an abstract class that passes through the constraint solver (e.g. a generic decorator). This addresses #7105. (#7127) 2024-01-25 19:25:46 -08:00
Eric Traut
df5d48c6e3
Fixed a bug that resulted in an incorrect type evaluation for a union type used as a runtime expression. The type should be UnionType, not type[UnionType]. (#7121) 2024-01-25 01:26:05 -08:00
Eric Traut
d94df3abec
Changed handling of tuple with multiple unpacked embedded tuples. Type spec now clarifies this is OK as long as there are not multiple unbounded embedded tuples. This addresses #7114. (#7120) 2024-01-25 00:44:20 -08:00
Eric Traut
dcc33ca58c
Changed the way pyright translates tuple[()] into a specialized Sequence. It used to translate it to Sequence[Any], but the typing spec now clarifies that it should be Sequence[Never]. This addresses #7118. (#7119) 2024-01-24 23:33:09 -08:00
Eric Traut
ebebb7fd3c Removed name consistency match for functional form of Enum. After a discussion in the typing community, it was decided that name consistency checks in some cases were unnecessary and inappropriate for type checkers. 2024-01-24 16:43:03 -08:00
Eric Traut
cfb1de0cc4 Fixed default for reportImplicitStringConcatenation in schema file. 2024-01-22 12:29:32 -08:00
Eric Traut
5aa10443bc Added a few useful links to the docs. 2024-01-21 20:35:11 -08:00
Eric Traut
3ebcef2d90 Fixed minor doc bug. 2024-01-21 20:28:15 -08:00
Eric Traut
015e143247 Removed tests from typeshed stubs. We don't use these, so they're just taking up unnecessary space. 2024-01-21 17:05:31 -08:00
Eric Traut
a168f42a3e Published 1.1.348 2024-01-21 09:50:43 -08:00
Eric Traut
197ecd7bc4
Added three new diagnostic rules: reportArgumentType covers argument type compatibility checks, reportAssignmentType covers type compatibility checks for assignments, and reportReturnType covers type compatibility checks for return and yield statements. This partially addresses #6973. (#7077) 2024-01-21 02:20:52 -08:00
Eric Traut
6ac1a7eebf
Added new diagnostic rule reportCallIssue that covers issues relating to call expressions and arguments. This partially addresses #6973. (#7076) 2024-01-21 01:47:43 -08:00
Eric Traut
63637459ca
Added two new diagnostic rules: reportAttributeAccessIssue is related to attribute accesses and reportIndexIssue is related to index operations and expressions. This partially addresses #6973. (#7075) 2024-01-21 01:35:19 -08:00
Eric Traut
8270551bbe
Added two new diagnostic rules: reportAbstractUsage reports invalid use of abstract classes and methods and reportOperatorIssue covers diagnostics related to unary and binary operators. This partially addresses #6973. (#7074) 2024-01-21 01:07:49 -08:00
Eric Traut
ec6052ea9d
Added two new diagnostic rules: reportInvalidTypeArguments reports invalid type arg usage and reportRedeclaration reports attempts to redeclare the type of a symbol. This partially addresses #6973. (#7073) 2024-01-21 00:33:05 -08:00
Eric Traut
7a67f4fbdb
Added two new diagnostic rules: reportInconsistentOverload reports inconsistencies between overload signatures and/or implementation and reportNoOverloadImplementation reports an overloaded function with a missing implementation. This partially addresses #6973. (#7072) 2024-01-21 00:04:55 -08:00
Eric Traut
91960fba49
Added new diagnostic rule reportPossiblyUnboundVariable, which is split off from reportUnboundVariable. This addresses #6896. (#7071) 2024-01-20 23:34:11 -08:00
Eric Traut
aa64fc5dec
Added two new diagnostic rules: reportAssertTypeFailure for type mismatches detected by typing.assert_type and reportUnusedExcept for situations where an except statement is determined to be unreachable. (#7070) 2024-01-20 22:21:42 -08:00
Eric Traut
04e0536a52
Added new diagnostic rule reportInvalidTypeForm that controls reporting of invalid type expression forms. This partly addresses #6973. (#7069) 2024-01-20 21:56:10 -08:00
Eric Traut
566f333ee1
Fixed a bug that led to a false negative when an illegal form of tuple was used: tuple[*tuple[str], ...]. (#7066) 2024-01-20 18:35:53 -08:00
Eric Traut
3c36b308d2 Changed diagnostic rule for the case where Callable is missing a second type argument. It should use reportMissingTypeArgument. 2024-01-20 17:32:49 -08:00
Eric Traut
32f0685bb1 Modernized a few diagnostic messages to refer to tuple (lowercase) rather than Tuple (uppercase). 2024-01-20 17:32:16 -08:00
Eric Traut
578ec79ae4
Fixed a bug that resulted in a false positive error and incorrect type evaluation when an assignment expression (walrus operator) is used in a comprehension. This addresses #6992. (#7064) 2024-01-20 14:55:25 -08:00
Eric Traut
301ee7df5f Disabled debug check that was accidentally enabled several builds ago. 2024-01-20 14:36:29 -08:00
Eric Traut
d21168ee64 Updated typeshed stubs to the latest version. 2024-01-19 22:08:10 -08:00
Eric Traut
af44054edb
Fixed a bug that masked an error (false negative) under certain circumstances when evaluating a lambda. This addresses #7012. (#7059) 2024-01-19 21:55:50 -08:00
Eric Traut
50f677c96d
Addressed a bug that led to a false positive (missing error) when a "bare" TypeVar is used as a base class in a class statement. This addresses #7023. (#7058) 2024-01-19 20:34:01 -08:00
Eric Traut
335255fea2
Added error reporting for the situation where a generic instance vari… (#7057)
* Added error reporting for the situation where a generic instance variable is accessed through a class object. This addresses #7051.

* Fixed style issue.
2024-01-19 17:41:53 -08:00
Eric Traut
f10455eb0b
Changed handling of tuple[Any, ...] so it is treated as though it's bidirectionally type compatible with all tuples regardless of length. This addresses #7053. (#7054) 2024-01-19 16:18:26 -08:00
PylanceBot
9ec6bebadb
pull-pylance-with-pyright- (#7052)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: rchiodo <rchiodo@microsoft.com>
2024-01-19 16:05:58 -08:00
Eric Traut
0fc568260a
Improved handling of Annotated and other special forms when they are used in runtime value expressions rather than annotations. This addresses #7049. (#7050) 2024-01-19 09:40:37 -08:00
Eric Traut
01b1aa02a1
Added type enforcement for the _value_ type in an Enum class. Also added enforcement for custom __new__ and __init__ method signatures. This addresses #7030 and #7029. (#7044) 2024-01-19 00:33:55 -08:00
Eric Traut
85e8de6397
Added special-case logic for enum classes that are invoked as though they are being constructed. This addresses #7027. (#7042) 2024-01-18 20:26:01 -08:00
Eric Traut
3f3a86a6c7
Improved handling of custom Enum classes. This addresses #7024. (#7041) 2024-01-18 18:33:13 -08:00
Eric Traut
4df6b6b63a
Fixed spec conformance issue with TypeVarTuple constraint solving. The spec indicates that if a TypeVarTuple is used multiple times in a callee's signature, the tuple must "match exactly". This addresses #6888. (#7040) 2024-01-18 17:07:50 -08:00
Eric Traut
922e746476
Added check for name mismatch for enum classes defined using the functional syntax. This addresses #7025. (#7038) 2024-01-18 12:14:47 -08:00
Rich Chiodo
81e85d10ea
Fix combining paths with empty uri (#7037)
* Fix combining paths with empty uri

* Force empty to be case sensitive

* Remove unneeded code
2024-01-18 10:54:40 -08:00
InSync
c44673d611
Typos in pyrightconfig.schema.json (#7021)
* Fix copy & paste error

* Fix typo
2024-01-17 17:20:17 -08:00
Eric Traut
923bc3788c
Fixed a bug in the isinstance type narrowing logic when type is filtered using a metaclass instance. This addresses #7008. (#7015) 2024-01-16 19:47:19 -08:00
Eric Traut
7e3f8aae6e
Fixed a bug that resulted in an incorrect type evaluation when a generator uses an await operator within the left-most for. This shouldn't result in an AsyncGenerator despite what the Python documentation indicates. This addresses #6999. (#7013) 2024-01-16 18:53:21 -08:00
Eric Traut
cab9f886de Updated "mypy comparison" documentation based on recent improvements in mypy. It's now able to handle higher-order functions. 2024-01-16 00:32:52 -08:00
Eric Traut
b21cbdc782 Fixed bug in pyright's "type printer" that resulted in an incorrect output when printing a specialized type alias parameterized by a TypeVarTuple that has a value that contains a tuple with an indeterminate length. 2024-01-15 23:37:22 -08:00
Eric Traut
e1dccb5919 Fixed regression that caused CLI publish to fail. 2024-01-15 09:17:11 -08:00
Eric Traut
b7f191c1fa Published 1.1.347 2024-01-15 09:12:41 -08:00
Eric Traut
47ea9f6fd7 Fixed regression that caused JSON output to not follow the documented schema. This addresses #6740. 2024-01-15 09:12:18 -08:00
Eric Traut
286fa2549c Made internal simplification for emitting diagnostics. 2024-01-14 23:42:34 -08:00
Eric Traut
0848427c73 Added support for Python 3.11 enum features: enum.member and enum.nonmember. This addresses #6867.
(cherry picked from commit 63e223b96454ef5b26e5a1ef10c9571f8e772d2a)
2024-01-14 22:43:25 -08:00
Eric Traut
cdcd4046b5 Added new language server setting pyright.disableTaggedHints to disable the use of diagnostics hints with tags. Some language server clients do not display these tagged hints in the intended manner and instead treat them as regular diagnostics. 2024-01-14 21:11:13 -08:00
Eric Traut
4f9ecaa96a
Diag rules (#6988)
* Added support for @no_type_check decorator. This addresses #1448.

* Changed all diagnostics (other than syntax errors and a few special informations) to have an associated diagnostic rule. Previously, some diagnostics had no associated rule.
2024-01-14 20:37:27 -08:00
Eric Traut
80b59618ac
Added support for @no_type_check decorator. This addresses #1448. (#6987) 2024-01-14 20:07:13 -08:00