This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author randolf.scholz
Recipients randolf.scholz
Date 2022-03-15.18:46:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647370009.1.0.761981911738.issue47030@roundup.psfhosted.org>
In-reply-to
Content
from functools import singledispatch
from typing import Optional

@singledispatch
def load(key: Optional[str] = None, /) -> None:
    raise NotImplementedError

@load.register
def _(key: None, /) -> None:
    print(f"loaded {key=}") 

@load.register
def _(key: str, /) -> None:
    print(f"loaded {key=}")
    
load()  # TypeError: load requires at least 1 positional argument
History
Date User Action Args
2022-03-15 18:46:49randolf.scholzsetrecipients: + randolf.scholz
2022-03-15 18:46:49randolf.scholzsetmessageid: <1647370009.1.0.761981911738.issue47030@roundup.psfhosted.org>
2022-03-15 18:46:49randolf.scholzlinkissue47030 messages
2022-03-15 18:46:49randolf.scholzcreate