Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Ian Kelly Newsgroups: comp.lang.python Subject: Re: When I need classes? Date: Tue, 12 Jan 2016 17:18:07 -0700 Lines: 14 Message-ID: References: <56927b37$0$1586$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 6oomO7M981LYp5551GUpzA2u+uyq63mFP1VReRSenfZg== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python,': 0.02; 'received:209.85.223': 0.03; 'memory.': 0.05; 'method.': 0.05; 'python': 0.10; 'jan': 0.11; 'interpreter': 0.15; '2016': 0.16; 'inheritance': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'scratch': 0.16; 'user-defined': 0.16; 'wrote:': 0.16; 'nested': 0.18; 'subject:need': 0.18; 'suppose': 0.22; 'wrote': 0.23; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'message- id:@mail.gmail.com': 0.27; 'object,': 0.27; 'classes': 0.30; 'class': 0.33; 'though.': 0.33; 'handle': 0.34; 'received:google.com': 0.35; 'could': 0.35; 'received:209.85': 0.36; 'to:addr:python-list': 0.36; 'subject:?': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'method': 0.37; 'received:209': 0.38; 'application': 0.39; 'to:addr:python.org': 0.40; 'entire': 0.61; 'more': 0.63; 'deeply': 0.64; 'limit': 0.65; 'potentially': 0.67; 'bernardo': 0.84; 'calls,': 0.84; 'oo"': 0.84; 'subject:When': 0.84; 'to:name:python': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=BBxoK8N5KLm7WaEIWdFYAJqhgxGJBtLDuiptscOwGY0=; b=ppmtIpCu/cFgwiS9dpJDJ5QpB2q6ri9hBqafdKZdfjM48YG4mLhDvnqGCecnKgb6Z8 UkH44ll8Sw4rmtXqZxg4DV9BMi04IGq4jidd7Uftyavqw/EGUS5qyZwSJZATRKTS8kOo FcW6hfuf7s4gyKvBDL4GV1oDomLJdfys8dWhNBIG52cWhJTv7w99ZxnYuC9UAc/GtzhE Xzf+X4PjmphG3Hc9kghkMEcDCaBqDU0SX2yMD3CEOVI8fQAd/bKkAHZe/Kuy7jUIxXxn dlzptQZxHjT0y5xlbUhT0k3+gy7GIjIY6+aOgdC8HISDFBGb3ElN2MC1OpCyy5OxebVv 0YLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=BBxoK8N5KLm7WaEIWdFYAJqhgxGJBtLDuiptscOwGY0=; b=RAsiYmEWDR+m44WAO9K4DeApEjWYTdQP6oC/kPY+/Gaecf+lVHIBbR6O1juwUyymTc Cve6vZ9q6qClacrL3Ng7v2dw1PglLxVzRJJ50+r4+7vfXh6iSW4qgtyeeXdzcUIOwdhT yX+fW/dGszlBv3xWsk+EkMFS5U506M4Bws/5Zs5fqQMHDdrYV7Qweo9whik3VVYw/OyV F3PnKB4EVTA2DqU6GcYHecPrcnqPlN3mMIotExeyBQXGGueMoBKxD5cfRJdxhhY1AZ+g OcvfYeIJMGIxJGbl5+v0pTyVJ3RLcUmZVjOkzTMs6oiZ37rKLUo9bzx5JtkkV/CA676Q PhYA== X-Gm-Message-State: ALoCoQmWOUfS7QdEiAAQl+SiZU7zRD/0acqnf7v+XvjHDJCmTiytNsB4pAfQzpP4HaIg864techl4HIq2Vn11VUODCR5nsP5Aw== X-Received: by 10.107.11.68 with SMTP id v65mr120145742ioi.188.1452644326788; Tue, 12 Jan 2016 16:18:46 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:101577 On Mon, Jan 11, 2016 at 5:53 PM, Bernardo Sulzbach 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.