The first incarnation of multipledispatch used mro.  It worked.  The code
to detect ambiguities and select between multiple implementations in the
multiple input case was fairly involved.  I'm pretty happy with the
abstractions behind the current setup.  As always though pull requests
welcome.  The fact that we don't support multiple inheritance well *is* a
failing and a potential source of hair pulling down the line.


On Wed, Apr 2, 2014 at 1:59 PM, Aaron Meurer <asmeu...@gmail.com> wrote:

> Also if you use __mro__, wouldn't you not have to build up some
> topological graph? Just pick the dispatched class that comes last in the
> mro.
>
> Aaron Meurer
>
>
> On Wed, Apr 2, 2014 at 3:58 PM, Matthew Rocklin <mrock...@gmail.com>wrote:
>
>> The multipledispatch project does not think hard about multiple
>> inheritance in an intelligent way.  It uses issubclass in order to support
>> abstract classes like Iterator and Number.
>>
>>
>> On Wed, Apr 2, 2014 at 1:35 PM, Aaron Meurer <asmeu...@gmail.com> wrote:
>>
>>> Why does multipledispatch use issubclass instead of __mro__? What
>>> happens when you dispatch on a diamond inheritance?
>>>
>>> Aaron Meurer
>>>
>>>
>>>  On Wed, Apr 2, 2014 at 3:32 PM, Matthew Rocklin <mrock...@gmail.com>wrote:
>>>
>>>>  The multipledispatch project detects such ambiguous situations and
>>>> raises a warning when the ambiguity is created/detected (at import time).
>>>>  If the developers don't do anything about it then multipledispatch selects
>>>> one of the implementations to take precedence pseudo-randomly.
>>>>
>>>>
>>>> http://multiple-dispatch.readthedocs.org/en/latest/resolution.html#multiple-inputs
>>>>
>>>> If you're interested in the code that does this please see
>>>> https://github.com/mrocklin/multipledispatch/blob/master/multipledispatch/conflict.py
>>>>
>>>> Pull requests welcome.
>>>>
>>>> --
>>>> You received this message because you are subscribed to the Google
>>>> Groups "sympy" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send
>>>> an email to sympy+unsubscr...@googlegroups.com.
>>>> To post to this group, send email to sympy@googlegroups.com.
>>>> Visit this group at http://groups.google.com/group/sympy.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/sympy/CAJ8oX-HUeYyeA%2BDEj7YwmftmrkFOQ1L5yReDNHOXZ59tEDKAmQ%40mail.gmail.com<https://groups.google.com/d/msgid/sympy/CAJ8oX-HUeYyeA%2BDEj7YwmftmrkFOQ1L5yReDNHOXZ59tEDKAmQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>> For more options, visit https://groups.google.com/d/optout.
>>>>
>>>
>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "sympy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to sympy+unsubscr...@googlegroups.com.
>>> To post to this group, send email to sympy@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/sympy.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/sympy/CAKgW%3D6K2pwZC7xnXee7mQdiH_xDHKKWSCxfmjnNFf3rv7BZ47g%40mail.gmail.com<https://groups.google.com/d/msgid/sympy/CAKgW%3D6K2pwZC7xnXee7mQdiH_xDHKKWSCxfmjnNFf3rv7BZ47g%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "sympy" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to sympy+unsubscr...@googlegroups.com.
>> To post to this group, send email to sympy@googlegroups.com.
>> Visit this group at http://groups.google.com/group/sympy.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/sympy/CAJ8oX-GcPt3YDJbBX4x1EUzpOM048_cKFpGqSeaTK2BpVShJUQ%40mail.gmail.com<https://groups.google.com/d/msgid/sympy/CAJ8oX-GcPt3YDJbBX4x1EUzpOM048_cKFpGqSeaTK2BpVShJUQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+unsubscr...@googlegroups.com.
> To post to this group, send email to sympy@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/CAKgW%3D6LQSuncEudUNVEp5L-55d_3y%2By7GA5fw7K2gHOdoZ9-GQ%40mail.gmail.com<https://groups.google.com/d/msgid/sympy/CAKgW%3D6LQSuncEudUNVEp5L-55d_3y%2By7GA5fw7K2gHOdoZ9-GQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sympy+unsubscr...@googlegroups.com.
To post to this group, send email to sympy@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CAJ8oX-Gkfd9-tN0UUCGn0tMFzULzDQ8kpj2318x0ec0qjWRV4Q%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to