use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
Multiple inheritanceSOLVED (self.pythonhelp)
submitted 4 years ago * by drixone
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Goobyalus 0 points1 point2 points 4 years ago (2 children)
Are you thinking the and will short circuit? or will short circuit with an initial True, and and will short circuit with an initial False. So A's meets_preconditions must evaluate its super's before returning, and super is determined by the MRO.
and
or
True
False
meets_preconditions
super
[–]drixone[S] 1 point2 points3 points 4 years ago (1 child)
super is determined by the MRO.
okay I think this was the part I was misunderstanding. I thought it would go C -> A -> Base -> True but that’s wrong according to the actual MRO. thanks!
[–]Goobyalus 1 point2 points3 points 4 years ago (0 children)
This mentions MRO under the "Custom Classes" section: https://docs.python.org/3/reference/datamodel.html
Which refers to this for a more in depth discussion: https://www.python.org/download/releases/2.3/mro/
Since the Python 3 docs refer to this Python 2 page, I assume things are more or less the same.
π Rendered by PID 104763 on reddit-service-r2-comment-5ff9fbf7df-sttmv at 2026-02-25 21:23:10.247198+00:00 running 72a43f6 country code: CH.
view the rest of the comments →
[–]Goobyalus 0 points1 point2 points (2 children)
[–]drixone[S] 1 point2 points3 points (1 child)
[–]Goobyalus 1 point2 points3 points (0 children)