Skip to content

Attribute __annotations__ containd in FunctionType.__dict__ but is not an attribute of "FunctionType" itself #133819

Closed as not planned
@siegbert7

Description

@siegbert7

Bug report

Bug description:

# Inconsistency between FunctionType and its __dict__

from  types import FunctionType as FunctionType

print(FunctionType.__dict__['__annotations__'])       # <attribute '__annotations__' of 'function' objects>
print(FunctionType.__annotations__)                   # AttributeError: type object 'function' has no attribute '__annotations__'

CPython versions tested on:

3.13

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-typingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy