Repository navigation
Fix typos in methods - #2
Merged
Merged
Conversation
Closed
David Foster (davidfstr)
added a commit
to davidfstr/pyright
that referenced
this pull request
May 7, 2026
Squish to -> Enable TypeForm support by default
Rich Chiodo (rchiodo)
pushed a commit
that referenced
this pull request
Jun 25, 2026
* Enable TypeForm support by default
...rather than requiring the --enableExperimentalFeatures bit to be set
* Do not try to interpret a string as a TypeForm unless one is expected
...by the current interence context or because EvalFlags.TypeFormArg is set.
Without this optimization, the call5.py test fails where it defines a
NamedTuple "X", [("a", int), ...]. Attempting to interpret the string "a"
as a forward reference looks up the name `a` (bound by a later for-loop),
and the resulting flow analysis recursively re-enters the Z(...) constructor,
causing a "Class definition for Z depends on itself" error.
* Remove test-output.txt
Squish change to -> Do not try to interpret a string as a TypeForm unless one is expected
* AI Coding: Ignore /plan directory
* Prettier fixes #1
Squish to -> Do not try to interpret a string as a TypeForm unless one is expected
* Prettier fixes #2
Squish to -> Enable TypeForm support by default
* Revert "AI Coding: Ignore /plan directory"
This reverts commit 7233033.
* Squish -> Do not try to interpret a string as a TypeForm unless one is expected
* Add build/perfCompare.py: cross-commit type-check perf benchmark
Adds a dev-facing tool, adapted from mypy's misc/perf_compare.py, that
builds the production pyright CLI bundle at each of two or more commits and
times repeated runs over a fixed corpus, reporting robust winsorized paired
deltas vs a baseline. Supports wall or CPU-time metrics and single-file or
project corpora. Cached bundles live beside the script under
build/perfCompare/binaries/ (gitignored).
Also adds a brief pointer in CONTRIBUTING.md.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* Verify TypeForm inference through container literals
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* Use someSubtypes for short-circuit in expectedTypeWantsTypeForm
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* Decline cloneWithTypeForm short-circuit: measured benefit negligible
Review feedback suggested short-circuiting cloneWithTypeForm with
`if (type.props?.typeForm === typeForm) return type;` (mirroring
cloneForCondition) to avoid allocations on the now-unconditional call
sites. After measuring, this is not worth doing: the no-op case occurs in
only ~0.2% of calls, so the guard would add a branch to the hot path while
saving almost no allocations. No code change is made.
The reference-equality check rarely holds because nearly every call site
passes a freshly-allocated value (e.g. convertToInstance(type)), which is a
new object every time. A value-equality check (isTypeSame) would catch more
cases but costs far more than the allocation it would save, so it is a net
loss on the hot path.
Supporting data (instrumented cloneWithTypeForm over the full
typeEvaluator jest suite, 1,162 tests):
cloneWithTypeForm calls : ~12,000
`=== typeForm` would fire: 23 (~0.2%)
of which both undefined: 22 (~0.18%)
non-undefined ref match: 1
So the general `=== typeForm` guard buys essentially nothing beyond the
both-undefined case, which is itself only ~0.18% of calls.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* Drop enableExperimentalFeatures from TypeForm tests
Addresses review feedback: the TypeForm tests set enableExperimentalFeatures
= true, so none validated this PR's core claim that TypeForm is enabled by
default. Remove the flag from the existing TypeForm1-8 tests so they all
exercise the default configuration and directly prove the
isTypeFormSupported gate removal is effective.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
* Squish -> Do not try to interpret a string as a TypeForm unless one is expected
Fix prettier whitespace issue
---------
Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry, missed one typo in the README file and noticed while preparing this pull request that is a bit trickier than the previous one.
It changes the name of two methods. Used the IDE to alter the methods and find their usages, but not quite sure if that's enough to guarantee I am not breaking anything else.
npm run buildpassed locally FWIWThanks