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 andrei.avk
Recipients andrei.avk, randolf.scholz
Date 2022-03-22.03:49:59
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647921000.05.0.733419142339.issue47030@roundup.psfhosted.org>
In-reply-to
Content
This would be problematic for two reasons:

 - possible confusion between the default function that runs when an argument doesn't match any registered types, and another "default" which runs when argument is omitted.

 - to see which function will run when argument is omitted, you would need to check in two places - the default value of arg and then find the registered function that matches it. If we end up deciding there is a need to run a default handler when an argument is omitted, it would be more explicit and convenient and visually obvious to decorate the "default if no arg" handler in some way, which also means there'd be a single place where this behavior is defined.

We can also consider adding a note to documentation that the first argument used for dispatch should not have a default value, to make it more explicit that dispatching on default value is not supported.
History
Date User Action Args
2022-03-22 03:50:00andrei.avksetrecipients: + andrei.avk, randolf.scholz
2022-03-22 03:50:00andrei.avksetmessageid: <1647921000.05.0.733419142339.issue47030@roundup.psfhosted.org>
2022-03-22 03:50:00andrei.avklinkissue47030 messages
2022-03-22 03:49:59andrei.avkcreate