On 31/05/18 08:23, Allan Haldane wrote:
Re: implenetation complexity, I just want to bring up multiple-dispatch
signatures again, where the new signature syntax would just be to join
some signatures together with "|", and try them in order until one works.

I'm not convinced it's better myself, I just wanted to make sure we are aware of it. The translation from the current proposed syntax would be:

  Current Syntax            Multiple-dispatch syntax

(n|1),(n|1)->()  <===>   (n),(n)->() | (n),()->() | (),(n)->()


(m?,n),(n,p?)->(m?,p?)  <===> (m,n),(n,p)->(m,p) |
                              (n),(n,p)->(p) |
                              (m,n),(n)->(m) |
                              (n),(n)->()

...
Cheers,
Allan

I am -1 on multiple signatures. We may revisit this in time, but for now I find the minimal intrusiveness of the current changes appealing, especially as it requires few to no changes whatsoever to the inner loop function. Multiple dispatch could easily break that model by allowing very different signatures to be aggregated into a single ufunc, leading to unhandled edge cases and strange segfaults. It also seems to me that looping over all signatures might slow down ufunc calling, leading to endless variations of strategies of optimizing signature ordering.

Matti
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to