-
Notifications
You must be signed in to change notification settings - Fork 2
Merge upstream to [email protected] #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
daweifeng-replit
wants to merge
129
commits into
main
Choose a base branch
from
merge-upstream
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+26,779
−16,219
Conversation
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
…TypeVar with a default that references another class-scoped TypeVar is used in a method signature in that class. This addresses #7525.
…ertain inference cases. This addresses #7527. (#7528)
… statement uses a type parameter and encloses the RHS in quotes. This addresses #7538.
…all-through) case when a runtime-checkable protocol class is used as a class pattern with arguments within a match statement. This addresses #7550. (#7552)
…a class pattern. This generates an exception at runtime. This addresses #7551.
…Var used within a method has a default that refers to another class-scoped TypeVar. This addresses #7553. (#7554)
…he lookup if the metaclass MRO contains an unknown class. This addresses #7556.
… diagnostic if the class derives from an Unknown or Any class. This addresses #7560.
Co-authored-by: Bill Schnurr <[email protected]> Co-authored-by: HeeJae Chang <[email protected]> Co-authored-by: Erik De Bonte <[email protected]> Co-authored-by: Rich Chiodo <[email protected]> Co-authored-by: Stella Huang <[email protected]> Co-authored-by: Kacie Kang <[email protected]>
…ing `__new__` on a dataclass, namedtuple, or TypedDict. These classes all require synthesized `__new__` methods. This addresses #7567.
…subexpressions in `match` statement when subject consists of a tuple expression and patterns exhaustively match the tuple. This addresses #7568.
…_` method cannot be bound without a type violation. This bug was found when writing a chapter on "constructors" for the typing spec. (#7573)
…rive from `enum.Flag`. In this case, we can't use enum expansion to a union of literals. This addresses #7576. (#7580)
…expansion operator that acts on a non-closed TypedDict. This addresses #7577. (#7582)
…overwrite previous dictionary items. Only the last value type is now considered, so if previous values (which are overwritten) would otherwise violate typing rules, this no longer generates a type error.
…ability. No functional change.
… in TD` type guard pattern (where `TD` is a TypedDict and `K` is a literal key). Narrowing was skipped if the RHS operand was not a simple identifier. This addresses #7589.
…d values but also `None`. This addresses #7590. (#7592)
…rked `ClassVar`) within dataclass class bodies. This is consistent with the runtime and [this proposed change to the typing spec](python/typing#1669).
…. This addresses #7586. (#7598)
…ypeVarTuple is used in a function defined with PEP-695 syntax. This addresses #7588. (#7599)
Co-authored-by: Bill Schnurr <[email protected]> Co-authored-by: HeeJae Chang <[email protected]> Co-authored-by: Erik De Bonte <[email protected]> Co-authored-by: Rich Chiodo <[email protected]> Co-authored-by: Stella Huang <[email protected]> Co-authored-by: Kacie Kang <[email protected]>
… type inference to evaluate the type of a lambda expression if the expected type is a union of two or more callables. This addresses #7772. (#7773)
…es for named tuple classes. This addresses #7768. (#7775)
…le subclass (using the class syntax) so the `__new__` method contains parameters based on field names and the `__init__` method contains a general `*args: Any, **kwargs: Any` parameter signature. Previously, this was swapped, but the new way is more faithful to the runtime. This addresses #7769.
…n calling a constructor for a generic class that defines no `__new__` or `__init__` method. This addresses #7764. (#7776)
… logic for consistency. This addresses #7767, #7760, and #7647. (#7777)
* Changed `TypeIs` to use the same logic as `isinstance` type narrowing logic for consistency. This addresses #7767, #7760, and #7647. * Fixed bug that results in a false positive error when a `yield` statement is used within a lambda following a function. This addresses #7779.
…ult. This addresses #7789.
…nannotated function is called through many (greater than 8) call expressions within a loop using different literal-value arguments each time. This addresses #7791. (#7792)
…a_items__` (PEP 728) with a `TypedDict` imported from `typing_extensions`. This addresses #7784.
…atching under certain circumstances that involve recursive protocol definitions. This addresses #7786.
…is used as a class pattern and the subject type is `Any` or `Unknown`. This addresses #7794. (#7796)
…e within a class body. This addresses #7797. (#7801)
…n tokenizer in versions 3.10 and newer in the case where a backslash (continuation character) is located by itself on a line. This addresses #7799.
…module-scoped) variable is captured within an inner scope and the variable is not modified anywhere below the inner scope. It's possible in this case for the variable to be modified by code outside of the module. This addresses #7780. (#7803)
… in a method parameter type annotation if it shadows a forward reference in a class scope when the method is using PEP 695 type parameters. This addresses #7800.
… take advantage of machines with more cores. On my new MacBook Pro, this drops the time to run tests from 45s to 23s.
…n a union. This isn't allowed. (#7805)
… representation the type `type[Foo]` where `Foo` is a type alias. This addresses #7806. (#7809)
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.
Why
This PR brings in the upstream changes from [email protected] to [email protected]. This reason it is not updated to the latest version is because there is a breaking change on FileWatcher starting
[email protected]
. We should be cautious and do that in a separate PR.What changed
Test plan
Describe what you did to test this change to a level of detail that allows your reviewer to test it