Commit graph

530 commits

Author SHA1 Message Date
charliecloudberry
45159a96da
Update installation.md (#11175)
Some checks failed
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
Remove the hardcoded docs version from PyCharm documentation link
2025-12-17 08:27:28 -08:00
charliecloudberry
5f7ce347e8
Update PyCharm setup documentation (#11105)
Some checks failed
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
2025-11-12 17:18:22 -08:00
Eric Traut
1a46b0f006 Clarified implicit import rules in docs. 2025-09-19 09:10:28 -07:00
Eric Traut
7905b1936a
Removed "reportShadowedImports" check and associated "renameShadowedFile" action. This feature is off by default in pyright although enabled by default in pylance. (#10891)
Some checks failed
Run mypy_primer on push / Run mypy_primer on push (push) Has been cancelled
Validation / Typecheck (push) Has been cancelled
Validation / Style (push) Has been cancelled
Validation / Test macos-latest (push) Has been cancelled
Validation / Test ubuntu-latest (push) Has been cancelled
Validation / Test windows-latest (push) Has been cancelled
Validation / Build (push) Has been cancelled
Validation / Required (push) Has been cancelled
It's problematic for a number of reasons:
1. It's not a type checking feature. It's a linting feature, so it really don't belong in a type checker.
2. The implementation is very problematic because it introduces an inverted dependency. Namely, it causes the Checker to depend on a language server provider and source mapper.
3. This dependency results in significant performance problems when the check is enabled.

I'd prefer to leave this feature out permanently and ask users to rely on a linter if they want to enable a check like this. If the pylance team feels that this is really important to retain, then it should be reimplemented in a way that doesn't introduce bad dependencies and performance problems.
2025-09-08 09:35:09 -07:00
konsti
b4a158f48a
Clarify editable install behavior with setuptools and uv (#10888)
Some checks are pending
Validation / Typecheck (push) Waiting to run
Validation / Style (push) Waiting to run
Validation / Test macos-latest (push) Blocked by required conditions
Validation / Test ubuntu-latest (push) Blocked by required conditions
Validation / Test windows-latest (push) Blocked by required conditions
Validation / Build (push) Blocked by required conditions
Validation / Required (push) Blocked by required conditions
* Clarify editable install behavior with setuptools and uv

Following a user question in uv (https://github.com/astral-sh/uv/issues/15652), clarify the documentation around editables.

From my uv experience, import hooks breaking static type checkers is almost exclusively a setuptools problem (see e.g. https://github.com/astral-sh/uv/issues/1708#issuecomment-2174463476 and https://github.com/astral-sh/uv/issues/3898), so I clarified the docs that this is update using uv with setuptools.

* Update docs/import-resolution.md

Co-authored-by: DetachHead <57028336+DetachHead@users.noreply.github.com>

* Remove "generally"

---------

Co-authored-by: DetachHead <57028336+DetachHead@users.noreply.github.com>
2025-09-04 00:13:18 -07:00
Nick Myatt
b45deb068b
Document editable installs with uv (#10854) 2025-08-29 09:18:12 -07:00
Eric Traut
7b90e9ef01
Made PEP 728 (TypedDict with extra items) no longer experimental since it has been accepted by the SC. (#10804) 2025-08-15 08:41:24 -07:00
Eric Traut
f326cc608a
Added reportUnreachable diagnostic check. If enabled, it emits a diagnostic for code that is determined to be structurally unreachable or unreachable via type analysis. It does not report code that is within a code block that is gated by a conditional that is statically determined to be false, such as TYPE_CHECKING and version checks. This diagnostic check is off by default even in strict mode because there are legitimate reasons for unreachable code to exist in Python code. (#10581)
This change also modifies the messages that accompany tagged hints (the mechanism by which unreachable or unanalyzed code is displayed as "dimmed" in an editor). The message now distinguishes between code that is structurally unreachable (e.g. after a `return` or `raise` statement) and code that is not analyzed because it is in a conditional block that is statically evaluated as false.

This addresses #10284.
2025-06-09 22:07:56 -07:00
Eric Traut
6ecb8f29aa
Added support for Sentinel type introduced in draft PEP 661. The enableExperimentalFeatures setting must be set to true to enable this feature. This addresses #10565. (#10574) 2025-06-09 15:15:25 -07:00
Bill Schnurr
a0dd8250f0
Pull Pylance with Pyright 1.1.400 (#10398) 2025-04-30 19:17:26 -07:00
Dima Tisnek
08e2aca3c5
docs: fix a typo in type guard descriptions (#10343) 2025-04-17 19:10:10 -07:00
Eric Traut
6c011f0a62 Fixed documentation bug for reportOptionalOperand check. It does not apply to boolean operators like or, and, and not. Use of None for such operands are legitimate and do not result in runtime errors. 2025-04-07 16:21:16 -07:00
Jiro Matsuzawa
cb09c7d22c
Fix typo in docs (#10213) 2025-03-30 01:41:48 -07:00
Eric Traut
ef98f17ec3
Added generalized support for assignment expressions (walrus operators) for type guards. This addresses #10149. (#10150) 2025-03-22 21:11:37 -07:00
Simon Legner
98dc4469cc
docs: fix "GitHub" typesetting (#10040) 2025-03-06 01:46:10 -07:00
Eric Traut
9e82df39b0 Fixed minor grammar error in documentation. 2025-02-27 18:48:03 -07:00
Eric Traut
c9d4475da2
Extended type narrowing for the X is L and X is not L type guard pattern. Previously, narrowing was performed only when L was an enum or bool literal. Narrowing is also now applied for other literal types but only in the positive (if) direction. This addresses #9758. (#9759) 2025-01-25 09:01:45 -08:00
Eric Traut
9041f88758
Added exemption to the reportUnnecessaryComparison rule for simple wildcard patterns in a case clause. This addresses #4706. (#9582) 2024-12-13 14:29:40 -08:00
Paul Mandel
f1170c07b5
Update import-statements.md (#9573) 2024-12-11 15:17:44 -08:00
Konstantin Veretennicov
5cbf4838d7
Update "mypy comparison" documentation based on recent improvements in mypy (#9502)
It now uses union over join in more situations. See https://mypy-play.net/?mypy=latest&python=3.13&gist=c8e017a31980f3c4fc6fc66ed2331da9
2024-11-24 19:05:21 +00:00
Eric Traut
932e99fc54 Fixed misspelling in documentation. 2024-10-09 12:18:17 -07:00
Eric Traut
e61f078b1a Clarified documentation for reportAssertAlwaysTrue. This addresses #9050. 2024-09-22 09:07:53 -07:00
Eric Traut
63c7c30c59
Expanded reportUnnecessaryIsinstance check to report cases where an isinstance or issubclass call always evaluates to False. This addresses #8961. (#8992) 2024-09-14 09:07:37 -07:00
Eric Traut
8698e60c1b
Removed support for custom callable type guard pattern. Now that typeshed defines this with a TypeIs, we no longer require custom logic here. This addresses #8944. (#8954) 2024-09-10 13:47:00 -07:00
Eric Traut
1c4477662b Updated execution environment documentation. 2024-09-10 08:20:11 -07:00
Luciana Abud
8ffc9cb20a
Small tweaks to configuration.md (#8800)
* Small tweaks to configuration.md

* Update configuration.md

---------

Co-authored-by: Rich Chiodo <rchiodo@users.noreply.github.com>
2024-09-04 11:27:00 -07:00
Neil Mitchell
fe643945df
Fix a small typo in Understanding Type Inference (#8877) 2024-09-02 08:50:11 -07:00
Eric Traut
e87bda9f02
Changed the default value of the disableBytesTypePromotions setting from false to true. It has been over two years since PEP 688 was accepted, so it's time for us to stop treating bytes as an alias for bytes | bytearray | memoryview. This is a breaking change and may require an update to the pyright configuration for some code bases. This addresses #8834. (#8835) 2024-08-26 11:40:16 -07:00
Eric Traut
3a99a9cd67 Updated some out-of-date information in the documentation. 2024-08-13 21:59:31 -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
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
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
d2c0938f2b Updated example execution environments in documentation to include type checking settings. 2024-08-07 10:29:56 -06:00
Eric Traut
7802376828 Changed disableLanguageServices feature to apply to hover text as well as other language services. Previously, hover text was excluded. This addresses #8639. 2024-08-02 07:59:47 -06:00
Eric Traut
ac8076818c Added documentation for "literal math inference" feature. 2024-07-26 16:37:08 -07:00
Eric Traut
06d28c39d5
Added a new configuration option enableReachabilityAnalysis. It is off by default when typeCheckingMode is "off" but otherwise on by default. When disabled, it causes pyright not to identify code blocks that are determined to be unreachable via type analysis. Code blocks that are determined to be unreachable via non-type information are still displayed as such. (#8546) 2024-07-25 19:13:15 -07:00
Eric Traut
ce99c4cbec Improved reachability documentation. 2024-07-25 17:00:15 -07:00
Eric Traut
8cac01c0e0 Added documentation about static expression evaluation and reachability. 2024-07-25 14:26:17 -07:00
Eric Traut
e6893ca140 Updated documentation to separate diagnostic severity controls from other configuration options that affect type analysis. 2024-07-25 14:23:38 -07:00
Eric Traut
057b351efa
Added support for multithreaded type checking in CLI. (#8309) 2024-07-04 20:52:37 -07:00
Jonas Vacek
4a9b9a547c
fix broken markdown link (#8186) 2024-06-20 15:55:37 +02:00
InSync
5f47007df3
Clarify description for exclude (#8148) 2024-06-16 05:59:09 +02:00
Eric Traut
8e1797cca7 Clarified in documentation that ... is an ellipsis token. 2024-06-11 14:18:55 -07:00
Eric Traut
4b84651950 Added the ability to override type checking configuration settings for each execution environment. This allows, for example, a test directory to use different settings than the directories that contain production code. This addresses #4059. 2024-06-06 15:25:01 -07:00
JR Heard
d5b6abad59
Fix typo in type-stubs.md (#8037) 2024-05-31 20:00:30 -07:00
Eric Traut
421dabee57
Added support for configuration inheritance through an "extends" configuration option. This addresses #4366. (#7997) 2024-05-24 17:22:12 -07:00
Eric Traut
59b8963684 Attempted to clarify meaning of "include" and "exclude" in documentation. 2024-05-23 16:27:39 -07:00
Eric Traut
50d4f44735
Changed tuple expression inference behavior to not preserve literal entry types if the tuple expression is embedded within another tuple, set, list, or dictionary expression. This addresses #7159. (#7970) 2024-05-22 16:10:05 -07:00
Eric Traut
496e50f65c Tweaked documentation. 2024-05-08 21:04:00 -07:00
Rich Chiodo
36e00b8785
Add note about VS code's locale being used first (#7876)
In response to https://github.com/microsoft/pyright/issues/7873
2024-05-08 11:54:50 -07:00