Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PEP696 + PEP749: Defer evaluation of defaults when parametrizing #144361

Open
Labels
stdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or error
@randolf-scholz

Description

@randolf-scholz

Bug report

Bug description:

WithPEP 696 +PEP 749, the following works just fine:

classScalar[CompatT,TruthT=BoolScalar]: ...classBoolScalar(Scalar): ...classIntScalar(Scalar[int]): ...# OK ✅️

However, if we switch around the order of definition, the code breaks:

classScalar[CompatT,TruthT=BoolScalar]: ...classIntScalar(Scalar[int]): ...# ❌️ NameError: name 'BoolScalar' is not definedclassBoolScalar(Scalar): ...

I guess since the default gets evaluated here. Not sure whether this is a bug or feature request, but it would be nice if the evaluation of the default could be deferred in is case as well.

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2026 Movatter.jp