An object is an instance (or not)?

Mario Figueiredo marfig at gmail.com
Tue Jan 27 19:17:31 EST 2015


In article <mailman.18191.1422400930.18130.python-list at python.org>, 
ned at nedbatchelder.com says...
> 
> A common mistake is to believe that "OOP" is a well-defined term.  It's 
> not it's a collection of ideas that are expressed slightly differently 
> in each language.

A common mistake is thinking just because OOP has different 
implementations, it doesn't have a cohesive set of well described rules 
and its own well defined terminology.

> I don't know what a "not fully realized object" is.

A fully realized object, in an object oriented paradigm, is an object 
containing or pointing to data and the methods to act on that data. It's 
an instance of a class.

A *not* fully realized object is possible in Python, since Classes are 
first-class objects, despite not being able to participate in OOP.

> 
> What does "participate in OOP" mean?

Means the object is capable of participating in inheritance and/or 
polymorphism. An instance of an object is capable of doing so, per its 
class definitions. Whereas a Python class object is not.

    >>> class Master:
            def func(self):
                pass

    >>> class Sub(Master):
            pass

    >>> Sub.func()
    TypeError: func() missing 1 required positional argument: 'self'

But somehow I think you knew the answer to all these questions and were 
instead being snarky.



More information about the Python-list mailing list