Eric Traut
|
faecce31ad
|
Updated library guidance to clarify that submodules under a private module are also considered private.
|
2022-03-04 17:52:51 -07:00 |
|
Eric Traut
|
c9b9676e21
|
Updated package type verifier to differentiate between "unknown" and "ambiguous" types.
|
2022-02-24 15:12:36 -07:00 |
|
Eric Traut
|
c061adb5b8
|
Fixed typo in documentation.
|
2022-02-22 16:01:28 -07:00 |
|
Eric Traut
|
450524d004
|
Added support for parameter type inference based on annotated base class method signatures and on default argument expressions.
|
2022-02-22 12:42:14 -07:00 |
|
Eric Traut
|
dc24fab779
|
Changed strictParameterNoneValue to default to true rather than false. This reflects the updated guidance in PEP 484, which indicates that type checkers should not assume that a default argument of None should imply an Optional type.
|
2022-02-21 17:54:31 -07:00 |
|
Eric Traut
|
4d75f59065
|
Fixed typo in documentation.
|
2022-02-19 14:11:16 -07:00 |
|
Eric Traut
|
92b4028cd5
|
Changed the behavior of the package type verifier so it does not flag unannotated class or instance variables if a parent class provides a type annotation for a variable of the same name. The type is inherited in this case. Also updated the library guidance to reflect this change.
|
2022-02-11 10:25:48 -08:00 |
|
Jelle Zijlstra
|
3cc4e6ccdd
|
Document reveal_type() and reveal_locals() (#2996)
reveal_locals() was not documented anywhere, which may be part of why so few people know about it.
Happy to put this somewhere else if you prefer.
|
2022-02-05 19:21:30 -08:00 |
|
Eric Traut
|
94db5376c1
|
Added the ability to add new symbols to builtins by simply adding a type stub file named __builtins__.pyi locally.
|
2022-02-02 19:27:12 -08:00 |
|
Eric Traut
|
10a122ccd6
|
Fixed error in documentation for reportInvalidTypeVarUse.
|
2022-01-29 07:54:18 -08:00 |
|
Eric Traut
|
6776c0ce86
|
Fixed bug in documentation for reportMissingImports.
|
2022-01-29 00:05:40 -08:00 |
|
Eric Traut
|
a03acb0f41
|
Changed import resolution order to more closely match PEP 561. Typeshed stdlib type stubs are now resolved later in the import resolution process, after all local modules and modules within the python environment.
|
2022-01-27 22:57:30 -08:00 |
|
Eric Traut
|
b69843cf03
|
Updated type inference documentation to eliminate a statement that was leading to some confusion.
|
2022-01-27 13:20:55 -08:00 |
|
Eric Traut
|
b740ddfae5
|
Added new diagnostic check "reportMatchNotExhaustive" which reports cases where a match statement doesn't exhaustively cover all cases.
|
2022-01-23 12:49:27 -08:00 |
|
Eric Traut
|
da81cdf22f
|
Updated documentation to cover the new # pyright: basic comment.
|
2022-01-19 12:53:07 -08:00 |
|
Eric Traut
|
163ef21c3c
|
Changed "reportMissingSuperCall" to be off by default in strict mode.
|
2022-01-14 14:13:49 -08:00 |
|
Eric Traut
|
62ac83694e
|
Implemented a new diagnostic check "reportMissingSuperCall" that checks for __init__ , __init_subclass__ , __enter__ and __exit__ methods that fail to call through to their parent class(es) methods of the same name. This is a common source of bugs. The check is disabled by default in basic mode but enabled by default in strict mode.
|
2022-01-14 11:55:23 -08:00 |
|
Eric Traut
|
4934e906d5
|
Added new diagnostic check reportInconsistentConstructor that checks for inconsistent input signatures between __new__ and __init__ methods.
|
2022-01-12 11:31:33 -08:00 |
|
Eric Traut
|
f9f4c34b5e
|
Added new diagnostic check reportUnnecessaryTypeIgnoreComment that emits a diagnostic when a # type: ignore comment has no effect.
|
2022-01-09 11:16:22 -07:00 |
|
Eric Traut
|
17f37a2482
|
Fixed a typo in the documentation.
|
2022-01-06 13:02:31 -07:00 |
|
Eric Traut
|
130c1cc055
|
Changed type guard logic that involves is operator and literals to be limited to bool and enum literals. It was making unsafe assumptions for other forms of literals.
|
2022-01-06 09:13:05 -07:00 |
|
Eric Traut
|
4fe3f1f7c0
|
Improved type narrowing for x == L pattern to include x is L , since they are equivalent. Likewise, extended x.y == L pattern to include x.y is L .
|
2022-01-05 15:19:37 -07:00 |
|
Eric Traut
|
c09480adb7
|
Updated CI script to make it clear that the latest pyright version should be used.
|
2022-01-03 17:43:08 -07:00 |
|
Eric Traut
|
d74b89a758
|
Added support for new type narrowing pattern: len(x) == L and len(x) != L where x is a tuple or union of tuples and L is a literal integer value.
|
2022-01-01 13:31:10 -07:00 |
|
Eric Traut
|
046eab4a8d
|
Added support for bool(x) type guard.
|
2021-12-31 14:23:56 -07:00 |
|
Eric Traut
|
2f616204d9
|
Added documentation for pyright's overload matching algorithm.
|
2021-12-13 15:00:17 -08:00 |
|
Eric Traut
|
211ebe44dd
|
Changed class pattern matching behavior to support narrowing of Any or Unknown , exempting this case from the general "never narrow Any" rule.
|
2021-12-12 14:54:59 -08:00 |
|
Eric Traut
|
50b31d533f
|
Improved documentation.
|
2021-12-10 00:06:35 -08:00 |
|
Eric Traut
|
c5788d4916
|
Implemented support for type guards that are based on a local variable that is assigned an expression that narrows the type of the assigned expression. Some limitations apply. For details, refer to https://github.com/microsoft/pyright/blob/main/docs/type-concepts.md#narrowing-based-on-local-variable.
|
2021-12-09 23:56:44 -08:00 |
|
Eric Traut
|
e267b8adec
|
Improved handling of x in y type guard to handle the case where y is a tuple.
|
2021-12-08 00:17:46 -08:00 |
|
Eric Traut
|
7e59a19eaa
|
Updated library guidance doc to clarify point of confusion about import forms.
|
2021-12-01 08:57:29 -08:00 |
|
Eric Traut
|
28d60e62ae
|
Updated command-line documentation for consistency.
|
2021-11-29 22:31:14 -08:00 |
|
Jos Verlinde
|
8d32784230
|
extend documentation on JSON (#2635)
copying the information provided as answer to https://github.com/microsoft/pyright/issues/2634
|
2021-11-29 13:20:41 -08:00 |
|
Eric Traut
|
ed84eb7b36
|
Changed reportPropertyTypeMismatch to be disabled by default in all diagnostic modes.
|
2021-11-27 17:08:01 -08:00 |
|
Eric Traut
|
280d95cd80
|
Updated documentation for reportUnusedVariable.
|
2021-11-24 16:05:53 -08:00 |
|
Elijah K
|
c70cee87ea
|
Update configuration.md (#2519)
Links the description of the `executionEnvironment` option. Would have partially prevented a question in #2518.
|
2021-10-30 11:09:25 -07:00 |
|
Eric Traut
|
cc7216e66e
|
Changed text representation of inferred type of self and cls parameters to Self@ClassName . This is more consistent with the emerging standard for an explicit Self type.
|
2021-10-29 21:21:32 -07:00 |
|
Eric Traut
|
ef773d2407
|
Added "--skipunannotated" option for command-line version of pyright. If specified, pyright skips type analysis of functions and methods that have no parameter or return type annotations. Return types of functions are also never inferred from the function implementation. This matches the default behavior of mypy and allows for more efficient analysis of complex code bases that are only partially annotated.
|
2021-10-22 23:17:29 -07:00 |
|
Eric Traut
|
3fbb23a5c4
|
Fixed typo in command-line docs.
|
2021-10-15 10:01:29 -07:00 |
|
Eric Traut
|
5f0317229c
|
Updated documentation for pythonPlatform to include "All".
|
2021-10-15 09:43:28 -07:00 |
|
Eric Traut
|
9976ff0436
|
Fixed a misleading statement in the documentation about the strict config setting.
|
2021-10-14 14:56:49 -07:00 |
|
Eric Traut
|
38bd56b130
|
Clarified directory for tests
|
2021-10-12 00:10:29 -07:00 |
|
Eric Traut
|
06c69907fe
|
Added instructions for running tests.
|
2021-10-12 00:06:34 -07:00 |
|
Eric Traut
|
1cbb690b11
|
Added support for new type guard pattern: x[I] is None and x[I] is not None where x is a tuple or union of tuples with known lengths and entry types and I is an integer.
|
2021-10-06 22:48:14 -07:00 |
|
Eric Traut
|
ff55b895f9
|
Added new diagnostic check "reportMissingParameterType" that checks for function and method input parameters that are missing a type annotation.
|
2021-10-06 21:55:12 -07:00 |
|
Eric Traut
|
6107de9090
|
Added new "--warnings" command-line option that generates an exit code of 1 if one or more warnings are emitted. By default, only errors generate an exit code of 1.
|
2021-10-06 20:12:15 -07:00 |
|
Eric Traut
|
dbe41fa4d2
|
Made a few small improvements to the documentation.
|
2021-09-26 12:10:05 -07:00 |
|
Eric Traut
|
3fa5299614
|
Changed code that converts types to textual representation to prepend a tilde ("~") character for the inferred type of a "self" or "cls" parameter.
|
2021-09-24 20:01:48 -07:00 |
|
Eric Traut
|
14ad02575f
|
Extended reportCallInDefaultInitializer diagnostic check to disallow list, set or dict expressions in default argument expression.
|
2021-09-16 21:22:31 -07:00 |
|
Eric Traut
|
9035f64c71
|
Added reportPrivateImportUsage diagnostic rule, which reports usage of a symbol from a py.typed library that is not intended to be re-exported by the library's author. The rule is on by default in basic type checking mode but can be disabled. Completion provider no longer offers these symbols as completion suggestions.
|
2021-09-12 01:10:57 -07:00 |
|