When I need classes?

Ian Kelly ian.g.kelly at gmail.com
Tue Jan 12 19:18:07 EST 2016


On Mon, Jan 11, 2016 at 5:53 PM, Bernardo Sulzbach
<mafagafogigante at gmail.com> wrote:
> I have never gone "seriously OO" with Python though. I never wrote
> from scratch an application with more than 10 classes as far as I can
> remember. However, I would suppose that the interpreter can handle
> thousands of user-defined classes simultaneously.

In Python, a class is just an object, so the only limit on how many
classes the interpreter can handle simultaneously is available memory.

However, if you have deeply nested inheritance graphs then you could
start to see performance issues on method calls, since the entire
inheritance graph potentially has to be traversed in order to find the
method.



More information about the Python-list mailing list