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

repr(subclass of typing.Any) shows typing.Any not <__main__.subclass of typing.Any> #95987

Closed
Labels
3.11only security fixes3.12only security fixesstdlibStandard Library Python modules in the Lib/ directorytopic-typingtype-bugAn unexpected behavior, bug, or error
@Gobot1234

Description

@Gobot1234

Bug report

fromtypingimportAnyclassFoo(Any): ...print(repr(Foo))# => typing.Any not <class '__main__.Foo'> as I would expect

I believe

cpython/Lib/typing.py

Lines 495 to 496 ine8259e0

def__repr__(self):
return"typing.Any"
needs to be changed to

def__repr__(self):ifselfisAny:return"typing.Any"returnsuper().__repr__()

Your environment

  • CPython versions tested on: 3.11 and 3.12
  • Operating system and architecture: macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixes3.12only security fixesstdlibStandard 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-2025 Movatter.jp