Skip to content

super() objects should be callable #143817

@smurfix

Description

@smurfix

Bug report

Bug description:

IMHO, calling an inherited __call__ method should work without spelling it out.

class Foo:
    def __call__(self):
        print("A")
class Bar(Foo):
    def __call__(self):
        print("B")
        super()()  # TypeError: 'super' object is not callable
        super().__call__()  # works
Bar()()

CPython versions tested on:

3.14

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-featureA feature request or enhancement

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions