Sitelet https://github.com/python/cpython/issues/93021#top
Skip to content

__text_signature__ for __get__ methods is wrong #93021

Description

@JelleZijlstra
In [18]: object.__init__.__get__.__text_signature__
Out[18]: '($self, instance, owner, /)'

In [19]: object.__init__.__get__(1)
Out[19]: <method-wrapper '__init__' of int object at 0x105e7d0b0>

In [20]: object.__init__.__get__(1, 2)
Out[20]: <method-wrapper '__init__' of int object at 0x105e7d0b0>

The signature claims there are two required positional arguments, but in fact the second argument is optional.

(Tested on 3.11 but I think it's wrong on all recent versions.)

Activity

  1. added
    type-bugAn unexpected behavior, bug, or error
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    3.11only security fixes
    3.12only security fixes
    on May 20, 2022
  2. added a commit that references this issue on May 20, 2022
  3. added a commit that references this issue on Jun 21, 2022
  4. added 2 commits that reference this issue on Jun 21, 2022
  5. added 2 commits that reference this issue on Jun 21, 2022
  6. ambv commented on Jun 21, 2022

    @ambv
    Contributor

    Fixed. Thanks! ✨ 🍰 ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.10 (EOL)end of life3.11only security fixes3.12only security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions