[New-bugs-announce] [issue42812] @overload-ing method of parent class without actual implementation

Chaim Gewirtz report at bugs.python.org
Sun Jan 3 00:51:32 EST 2021


New submission from Chaim Gewirtz <chaim422 at gmail.com>:

Why should @overload need to be followed by an implementation when an implementation already exists in the parent class?

Illustrative example:

class Parent:
    def foo(**kwargs):
        """Argument names of foo vary depending on the child class."""

class Child(Parent):
    @overload foo(a, b): ...
    
Raises:

"NotImplementedError: You should not call an overloaded function. A series of @overload-decorated functions outside a stub module should always be followed by an implementation that is not @overload-ed."

----------
messages: 384255
nosy: chaim422
priority: normal
severity: normal
status: open
title: @overload-ing method of parent class without actual implementation
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42812>
_______________________________________


More information about the New-bugs-announce mailing list