When I need classes?
Steven D'Aprano
steve at pearwood.info
Tue Jan 12 20:33:25 EST 2016
On Wed, 13 Jan 2016 11:18 am, Ian Kelly wrote:
> 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.
I'm sure Ian knows this already, but for the benefit of others...
Python is not Java:
http://dirtsimple.org/2004/12/python-is-not-java.html
And Java is not Python either:
http://dirtsimple.org/2004/12/java-is-not-python-either.html
--
Steven
More information about the Python-list
mailing list