[Baypiggies] Question on Python's MRO...

Craig Rodrigues rodrigc at freebsd.org
Wed Jan 4 14:29:12 EST 2017


Hi,

If you haven't read them, I suggest that you read these tutorials on the
Python MRO:

https://makina-corpus.com/blog/metier/2014/python-tutorial-understanding-python-mro-class-search-path
http://stackoverflow.com/questions/1848474/method-resolution-order-mro-in-new-style-python-classes

I read those tutorials a few times and went through the examples.
I found that going through the examples helped my understanding of
the MRO and differences between "old-style" and "new-style" classes.
--
Craig




On Wed, Jan 4, 2017 at 9:30 AM, Braun Brelin <bbrelin at gmail.com> wrote:

> Hi all,
>
> I'm trying to figure out how to understand Python's Method Resolution
> order.
> One of the things that's really confusing me is that from my understanding
> if I have a class declaration like this
>
> class C(A,B):
>       ...
>
> Python does the inheritance order from right to left, yet all the
> tutorials on MRO
> start talking about inheritance from left to right.
>
> Is the right to left order a property of the older Python 2 style classes
> that didn't
> explicitly inherit from object?
>
> Thanks
>
>
>
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> https://mail.python.org/mailman/listinfo/baypiggies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20170104/369ac756/attachment.html>


More information about the Baypiggies mailing list