Skip to content

@typing.overload doesn't preserve function attributes (like __annotations__) #129931

Closed as not planned
@thejcannon

Description

@thejcannon

Bug report

Bug description:

Somewhat of a corner-case, but something like this

import typing

class Foo:
    @typing.overload
    def foo(): ...

    print(foo.__qualname__)

prints _overload_dummy which, yeah OK I think I'm the real dummy here, but also did it need to call me that 😝 ?

(In all seriousness I'm just doing weird things, and hit this and even though I'm doing weird things, Python never stopped me before)

CPython versions tested on:

3.11

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibPython modules in the Lib dirtopic-typingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions