Eric Traut
e94de4dec5
Added code to log line and character offset when logging trace details.
2022-06-16 20:34:14 -07:00
Eric Traut
0962e64128
Exempted class members named _
from the "reportIncompatibleMethodOverride" diagnostic check.
2022-06-16 19:42:36 -07:00
Eric Traut
1abe5a422c
Fixed bug that results in a false positive error when evaluating type compatibility of a callable with a *args: Any
and **kwargs: Any
parameter with a callable that contains a ParamSpec.
2022-06-16 16:22:39 -07:00
Bill Schnurr
979d9c9e24
remove preivous connection wrapper for browser, now we dedup packages instead ( #3579 )
2022-06-15 14:18:18 -07:00
Eric Traut
adf7c3e92e
Added constant for Python 3.12.
2022-06-13 00:50:32 -07:00
Eric Traut
055dc1296a
Updated comments documentation to talk about reportTypeCommentUsage diagnostic check.
2022-06-12 11:50:47 -07:00
Eric Traut
4e22927305
Published 1.1.254
2022-06-11 20:55:23 -07:00
Eric Traut
d3368781ec
Fixed bug in tokenizer that results in incorrect tokenization when a hex numeric literal is followed by a newline followed by either a 'b' or 'o' character.
2022-06-11 15:29:15 -07:00
Eric Traut
ad17c2c376
Changed the handling of partial stub packages to conform with PEP 561. They should always overlay the original package even if that package is marked "py.typed". ( #3568 )
...
Co-authored-by: Eric Traut <erictr@microsoft.com>
2022-06-11 15:15:22 -07:00
Eric Traut
90b5de275a
Small code improvement in code flow engine. No functional change.
2022-06-11 10:53:40 -07:00
Eric Traut
20f27a8796
Implemented a better solution to handle circular dependencies between classes and their base classes and metaclasses.
2022-06-10 22:16:12 -07:00
Eric Traut
df23be59b9
Undid previous fix related to circular class dependency detection because it introduced a regression with sqlalchemy stubs.
2022-06-10 17:27:49 -07:00
Eric Traut
6c9bc4a63d
Added code to print the pyright version as part of the CLI output. This is useful for diagnosis.
2022-06-10 17:26:56 -07:00
Eric Traut
d7dfcd504c
Fixed a bug that resulted in a false negative when a variable with a declared type is overwritten by an incompatible type by an import statement.
2022-06-10 17:01:46 -07:00
Eric Traut
484faf7ba3
Added support for new reportTypeCommentUsage
diagnostic check. It flag the usage of # type: xxx
comments for functions and variables. These are still supported for backward compatibility, but they are increasingly irrelevant and will likely be deprecated in the next few years.
2022-06-09 21:00:47 -07:00
Eric Traut
c5153a557c
Minor code cleanup — improved comments, etc.
2022-06-09 17:49:28 -07:00
Eric Traut
376bf81935
Added code to invalidate virtual file system cache when resetting the language server.
2022-06-09 17:48:43 -07:00
Eric Traut
88abe7ae96
Removed obsolete options from launch.json file.
2022-06-09 17:48:02 -07:00
Eric Traut
44c7bf87c5
Fixed bug that resulted in a false negative when attempting to call pop
on a TypedDict with a key that is required.
2022-06-09 15:56:48 -07:00
Eric Traut
794d151050
Added new configuration setting called "defineConstant". It allows a configuration to specify one or more identifiers that should be assigned by pyright's binder to be constant anywhere they appear. Values can be boolean (true or false) or a string. If an identifier of this value is used within a conditional statement (like if not DEBUG:
) it will affect pyright's reachability analysis for the guarded code blocks.
2022-06-08 22:01:33 -07:00
Eric Traut
9b407f6c9e
Added code to detect and flag usage of # type: xxx
comments for for
and with
statements.
2022-06-08 20:34:04 -07:00
PylanceBot
bbc4282691
pull-pylance-with-pyright-1.1.253 ( #3556 )
...
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-06-08 10:16:10 -07:00
Eric Traut
ffb0ba7144
Published 1.1.253
2022-06-08 01:16:55 -07:00
Eric Traut
4d7d70d288
Fixed a bug that resulted in a false positive when using a captured variable within an inner function or lambda and the variable has been narrowed based on a NoReturn
call within a conditional block.
2022-06-07 11:19:48 -07:00
Eric Traut
bc4fa7e22b
Fixed a bug that resulted in spurious type evaluation errors when certain circular dependencies existed between class declarations. When evaluated in certain orders, a class type was being partially constructed with a corrupt MRO. This type was then cached and used in subsequent type evaluation steps, resulting in false positive errors.
2022-06-06 23:23:46 -07:00
Eric Traut
13256b4454
Small code cleanup. No functional change.
2022-06-06 22:33:20 -07:00
Eric Traut
4e0b2b9650
Fixed a bug in the reportIncompatibleMethodOverride
check that resulted in a false negatives when the override method accepted too few positional arguments but accepted a **kwargs
parameter.
2022-06-06 21:05:18 -07:00
Eric Traut
735a89b86f
Fixed bug in the "reportIncompatibleMethodOverride" check that results in a false positive if the parent class method has one or more keyword-only parameters and the override method has a kwargs of compatible type.
2022-06-06 16:41:46 -07:00
Eric Traut
b56e6b72fe
Fixed a bug that resulted in incorrect type evaluation when an asymmetric property (where the getter type doesn't match the setter type) also has a deleter.
2022-06-06 16:08:04 -07:00
Eric Traut
09a763ccfc
Small code cleanup and addition of comment for readability.
2022-06-06 15:48:37 -07:00
Eric Traut
5b348d534f
Updated typeshed stubs to the latest version.
2022-06-06 15:15:29 -07:00
Eric Traut
672b28c927
Enhanced bidirectional type inference for constructor calls to handle the case where a generic class has no __init__
method but has a __new__
method that informs the value of one or more type variables.
2022-06-06 15:15:15 -07:00
Eric Traut
22dbd0eee3
Fixed bug in type evaluator related to the handling of a recursive type alias that is self-referential. This resulted in various strange behaviors when this bogus type alias was later used as an annotation.
2022-06-06 09:18:18 -07:00
Eric Traut
e586d6f1f1
Fixed false positive error that occurs when using an issubclass
type guard to narrow a type to an abstract base class. The resulting type should be instantiable without receiving a "cannot instantiate ABC" error.
2022-06-05 22:04:19 -07:00
Eric Traut
1b09c1aea0
Added check for partially-evaluated classes when resolving symbols.
2022-06-05 14:28:01 -07:00
Eric Traut
29ddd505c4
Fixed style issue.
2022-06-05 10:23:03 -07:00
Eric Traut
8f471fdab1
Fixed bug in "--dependencies" command-line option. When used with partial stub files, it was not emitting the correct paths.
2022-06-05 10:19:59 -07:00
Eric Traut
d9beecf93b
Fixed a bug that resulted in a false positive error when using an unpacked TypedDict for a **kwargs parameter annotation, and the caller passes an unpacked TypedDict as an argument but the argument is a subclass of the parameter's TypedDict.
2022-06-05 10:10:04 -07:00
Eric Traut
ac576bbd47
Published 1.1.252
2022-06-04 16:47:14 -07:00
Eric Traut
e7759432d8
Reduced the max number of recursive inferred function return results from 16 to 12 to address a crash (stack overflow) that appears in the pylance telemetry.
2022-06-04 16:45:22 -07:00
Eric Traut
0dff59a90b
Fixed bug that causes false positive when the evaluated type of a default argument used within a base class must be specialized for a derived class.
2022-06-04 16:37:59 -07:00
Eric Traut
1528429c42
Refactored code in code flow engine related to NoReturn call evaluation. Improved handling of calls to overloads. If all overloads are annotated with NoReturn, the call is now evaluated as NoReturn. Previously, only the last overload was considered.
2022-06-04 11:44:57 -07:00
Eric Traut
7fb190f64b
Fixed regression in code flow analysis that depends on NoReturn call evaluation.
2022-06-04 10:48:59 -07:00
Eric Traut
9d201c9256
Added code to track partially-evaluated functions and lambdas and avoid caching them as complete types.
2022-06-04 10:43:43 -07:00
Eric Traut
08209850ee
Fixed bug in lambda type evaluation so it properly detects and reports when its type is incomplete due to recursion.
2022-06-04 10:40:12 -07:00
Eric Traut
66fc5a37c0
Renamed class type flag for clarity. No functional change.
2022-06-04 10:35:12 -07:00
Eric Traut
e786c86088
Increased maximum number of declarations (assignments) to consider when inferring the type of an unannotated variable. It was previously 16, but it is now 64.
2022-06-03 17:50:54 -07:00
Eric Traut
494d03f69d
Added check for a dataclass member that lacks a type annotation but is assigned a field descriptor. This combination results in a runtime exception in the dataclass implementation.
2022-06-03 17:42:44 -07:00
Eric Traut
a56e038779
Fixed bug that resulted in a crash (due to infinite recursion) in reference provider under certain circumstances involving symbol renames.
2022-06-02 13:41:13 -07:00
Eric Traut
c6e1d8dd97
Fixed a false positive error when the special form Unpack
is used in a context other than a type annotation.
2022-06-01 10:11:08 -07:00