python the class of data and functions around the store are Victoria __dict__.
Object property and method exist inside.
Examples of methods for target search, the two, is almost the same.
class Dog ():
def spark (self):
dog = Dog ()
dog.spark () # output spark
Medium dog.__dict__ nothing, when dog.spark called, python first dog__dict__ find spark, if not, from the class Dog Medium __dict__ search.
class dict not copy the function to the instance in the go.
function Dog () ()
Dog.prototype.spark = function () (alert ( 'spark');)
dog = new Dog ();
dog.spark (); # output spark
If the modified method of class Dog dog will affect the solution?
Dog.prototype.spark = function () (alert ( 'spark2');)
dog.spark () # output spark2
From the python's class and function definitions, key: value, can be seen, python is the core of dict.
Their methods and data are stored mixed. Without "()" is the method itself, added a "()" method is called.
This way of implementation of the ruby is not the same.
Since ruby is a pure OO husband, a distinction between the internal member variables and methods, so the storage is separate from the iv_table and m_table.
js and ruby are the function of the class divided into two parts, instance_methods (prototype) and class methods (Object-private methods)