Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.036 X-Spam-Evidence: '*H*': 0.93; '*S*': 0.01; 'subject:Python': 0.06; 'class,': 0.07; 'orm': 0.09; 'python:': 0.09; 'django': 0.11; '23,': 0.16; 'namespace.': 0.16; 'peewee,': 0.16; 'wrote:': 0.18; 'example': 0.22; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'class': 0.32; 'another': 0.32; 'subject:the': 0.34; 'received:google.com': 0.35; 'subject:?': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'list,': 0.38; 'pm,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'simple': 0.61; 'within': 0.65; 'saw': 0.77; 'url:latest': 0.91; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=fUgPidEqExfj/6TTr0RPoGulALgoVj4s8hYiNLbzohk=; b=nx1QCVyQwLvsY0b1CytrE0AJ4NJBG0uEiSXq/QMeGf1UMdZ7erwKj/FgUy24swbWBQ MlFDPqQqxxdZvOfT9SfrjgrLfoonrGNiyHZ7nEzOrjJbg6EnnH91ct/y7JRkvNOVmk+B 1YdhmiBx8imeVdswP3cG0L+VP2TaKiWPzdW2yVtJAR/ZLsET84lGwLH9R62l4k3bQnef R+04PvfFBw5hcGO7BA3Sc+/rKidp4225xB3SjCGEL6PmzhpRREsuufLxpj3wqtThpWjU HCKAXEyUr+ijlr69XcgNBXz2tW65w/adD7tFZivr/W+bv7grDetMcgcxch1kjvGePWYh R7gQ== X-Received: by 10.66.248.227 with SMTP id yp3mr19341500pac.158.1366755817605; Tue, 23 Apr 2013 15:23:37 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <4e46cc04-248e-4594-a24a-b272648a5e66@googlegroups.com> References: <4e46cc04-248e-4594-a24a-b272648a5e66@googlegroups.com> From: Ian Kelly Date: Tue, 23 Apr 2013 16:22:57 -0600 Subject: Re: What is the reason for defining classes within classes in Python? To: Python Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 12 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1366755826 news.xs4all.nl 2179 [2001:888:2000:d::a6]:33453 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:44226 On Tue, Apr 23, 2013 at 3:50 PM, vasudevram wrote: > > Hi list, > > I saw an example of defining a class within another class, here, in the docs for peewee, a simple ORM for Python: > > http://peewee.readthedocs.org/en/latest/peewee/quickstart.html > > In what way is this useful? In that particular case they're just using it as a namespace. Django does the same thing.