Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #44232

Re: What is the reason for defining classes within classes in Python?

Newsgroups comp.lang.python
Date 2013-04-23 16:13 -0700
References <4e46cc04-248e-4594-a24a-b272648a5e66@googlegroups.com> <mailman.1001.1366755826.3114.python-list@python.org>
Message-ID <ebf43a37-c441-4a8a-9941-995377ae45e5@googlegroups.com> (permalink)
Subject Re: What is the reason for defining classes within classes in Python?
From vasudevram <vasudevram@gmail.com>

Show all headers | View raw


On Wednesday, April 24, 2013 3:52:57 AM UTC+5:30, Ian wrote:
> 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.

Not clear. An example or more explanation might help, if you can. Thanks.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

What is the reason for defining classes within classes in Python? vasudevram <vasudevram@gmail.com> - 2013-04-23 14:50 -0700
  Re: What is the reason for defining classes within classes in Python? Ian Kelly <ian.g.kelly@gmail.com> - 2013-04-23 16:22 -0600
    Re: What is the reason for defining classes within classes in Python? vasudevram <vasudevram@gmail.com> - 2013-04-23 16:13 -0700
      Re: What is the reason for defining classes within classes in Python? alex23 <wuwei23@gmail.com> - 2013-04-23 17:50 -0700
        Re: What is the reason for defining classes within classes in Python? vasudevram <vasudevram@gmail.com> - 2013-04-24 04:01 -0700
          Re: What is the reason for defining classes within classes in Python? Peter Otten <__peter__@web.de> - 2013-04-24 14:00 +0200
            Re: What is the reason for defining classes within classes in Python? vasudevram <vasudevram@gmail.com> - 2013-04-24 06:29 -0700

csiph-web