[Python-Dev] PEP 443 - Single-dispatch generic functions (original) (raw)
Paul Moore p.f.moore at gmail.com
Thu May 23 18:56:53 CEST 2013
- Previous message: [Python-Dev] PEP 443 - Single-dispatch generic functions
- Next message: [Python-Dev] PEP 443 - Single-dispatch generic functions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 23 May 2013 17:00, Walter Dörwald <walter at livinglogic.de> wrote:
Should it be possible to register multiple types for the generic function with one register() call, i.e. should:
@fun.register(int, float) def (arg, verbose=False): ... be allowed as a synonym for @fun.register(int) @fun.register(float) def (arg, verbose=False):
No, because people will misread register(int, float) as meaning first argument int, second float. The double decorator is explicit as to what is going on, and isn't too hard to read or write.
Paul -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/python-dev/attachments/20130523/b433aaca/attachment.html>
- Previous message: [Python-Dev] PEP 443 - Single-dispatch generic functions
- Next message: [Python-Dev] PEP 443 - Single-dispatch generic functions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]