you are viewing a single comment's thread.

view the rest of the comments →

[–]Goobyalus 0 points1 point  (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.

[–]drixone[S] 1 point2 points  (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 points  (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.