Skip to content

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
wants to merge 129 commits into
base: main
Choose a base branch
from
Draft

Conversation

daweifeng-replit
Copy link
Contributor

@daweifeng-replit daweifeng-replit commented Apr 25, 2025

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

erictraut and others added 30 commits March 20, 2024 11:36
…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.
… 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).
…ypeVarTuple is used in a function defined with PEP-695 syntax. This addresses #7588. (#7599)
erictraut and others added 28 commits April 23, 2024 22:00
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.
…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.
… representation the type `type[Foo]` where `Foo` is a type alias. This addresses #7806. (#7809)
@daweifeng-replit daweifeng-replit changed the title Merge upstream Merge upstream to [email protected] Apr 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants