Re: Nested Classes and Instances

2009-07-10 Thread J. Cliff Dyer
On Fri, 2009-07-10 at 19:00 +0200, Manuel Graune wrote: > Hello, > > as an example of what I would like to achieve, think of a street > where each house has a door and a sign with a unique (per house) > number on it. I tried to model this like this: > > class House(object): > class Door(objec

Re: Nested Classes and Instances

2009-07-10 Thread Peter Otten
Manuel Graune wrote: > as an example of what I would like to achieve, think of a street > where each house has a door and a sign with a unique (per house) > number on it. I tried to model this like this: > > class House(object): > class Door(object): > def __init__(self,color): >

Re: nested classes

2009-03-20 Thread Esmail
> Yes. It's the same convention used to indicate that a method is > "private" in Python, since the language itself has no privacy > mechanisms. Great - got it! Thanks again, Esmail -- http://mail.python.org/mailman/listinfo/python-list

Re: nested classes

2009-03-20 Thread Chris Rebert
On Fri, Mar 20, 2009 at 1:24 PM, Esmail wrote: > On Mar 20, 2:41 pm, Chris Rebert wrote: >> 2009/3/20 Benjamin Kaplan : >> > On Fri, Mar 20, 2009 at 10:06 AM, Esmail wrote: >> >> >> Hello all, >> >> >> I am curious why nested classes don't seem to be used much in Python. >> >> I see them as a gr

Re: nested classes

2009-03-20 Thread Esmail
On Mar 20, 2:35 pm, Steve Holden wrote: > Benjamin Kaplan wrote: > > > On Fri, Mar 20, 2009 at 10:06 AM, Esmail > > wrote: > > >     Hello all, > > >     I am curious why nested classes don't seem to be used much in Python. > >     I see them as a great way to encapsulate

Re: nested classes

2009-03-20 Thread Esmail
On Mar 20, 2:41 pm, Chris Rebert wrote: > 2009/3/20 Benjamin Kaplan : > > > > > > > On Fri, Mar 20, 2009 at 10:06 AM, Esmail wrote: > > >> Hello all, > > >> I am curious why nested classes don't seem to be used much in Python. > >> I see them as a great way to encapsulate related information, whi

Re: nested classes

2009-03-20 Thread Chris Rebert
2009/3/20 Benjamin Kaplan : > > > On Fri, Mar 20, 2009 at 10:06 AM, Esmail wrote: >> >> Hello all, >> >> I am curious why nested classes don't seem to be used much in Python. >> I see them as a great way to encapsulate related information, which is >> a >> good thing. >> >> In my other post "impro

Re: nested classes

2009-03-20 Thread Steve Holden
Benjamin Kaplan wrote: > > > On Fri, Mar 20, 2009 at 10:06 AM, Esmail > wrote: > > Hello all, > > I am curious why nested classes don't seem to be used much in Python. > I see them as a great way to encapsulate related information, which is > a > go

Re: nested classes

2009-03-20 Thread Benjamin Kaplan
On Fri, Mar 20, 2009 at 10:06 AM, Esmail wrote: > Hello all, > > I am curious why nested classes don't seem to be used much in Python. > I see them as a great way to encapsulate related information, which is > a > good thing. > > In my other post "improve this newbie code/nested functions in > Py