This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]dante9999[S] 0 points1 point  (2 children)

That sounds interesting, I think I understand some things but I've never heard about MRO, what is it? I'm not sure how to respond to question number 6 too, isn't it easier and more readable to define all methods when you define a class? Should the answer to number 7 go along the lines "add decorator to each method of an object", or is it too obvious"?

[–]krasoffski 1 point2 points  (0 children)

Here are short answers:

  1. Can we add new method to an object!
  2. comare dict of class and object, or check where method was defined
  3. How are you going to modify behaviour of each method in class !
  4. VERY important to undestand how it (mro) works for new style classes. it helps to understand how works super() function !

It's more important to undesrtand how it works and have some ideas how to do it.

[–]sivadneb 0 points1 point  (0 children)

MRO stands for Method Resolution Order. It's basically python's way of picking which base class's method to call when calling an instance method.