> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of John Machin
> Sent: Friday, January 11, 2008 4:08 PM
> To: python-list@python.org
> Subject: Re: Newbie question on Classes
>
> On Jan 11, 9:27 am, "Reedick, Andr
On Jan 11, 9:27 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: [EMAIL PROTECTED] [mailto:python-
> > [EMAIL PROTECTED] On Behalf Of Adrian Wood
> > Sent: Thursday, January 10, 2008 4:47 PM
> > To: [EMAIL PROT
On Jan 10, 5:32 pm, "Steven Clark" <[EMAIL PROTECTED]> wrote:
> > l = []
> > l.append(man)
> > l.append(woman)
>
> > # Print the state.
> > for item in l:
> > print item.state()
>
> Small, off-topic nitpick:
> please don't use "l" (lower-case el) as a variable name.
>
> >Fromhttp://www.python.or
On Jan 11, 8:46 am, "Adrian Wood" <[EMAIL PROTECTED]> wrote:
> Hi al! I'm new to the list, and reasonably new to Python, so be gentle.
>
> Long story short, I'm having a hard time finding a way to call a
> function on every object of a class at once.
A class is a factory that creates objects. It k
> l = []
> l.append(man)
> l.append(woman)
>
> # Print the state.
> for item in l:
> print item.state()
>
>
Small, off-topic nitpick:
please don't use "l" (lower-case el) as a variable name.
>From http://www.python.org/dev/peps/pep-0008/:
"Naming Conventions
Names to Avoid
Never use the cha
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:python-
> [EMAIL PROTECTED] On Behalf Of Adrian Wood
> Sent: Thursday, January 10, 2008 4:47 PM
> To: python-list@python.org
> Subject: Newbie question on Classes
>
>
> I can call man.state() and then wo
Adrian Wood wrote:
> I can call man.state() and then woman.state() or Person.state(man) and
> Person.state(woman) to print the status of each. This takes time and
> space however, and becomes unmanageable if we start talking about a
> large number of objects, and unworkable if there is an unknown
On Jan 10, 4:46 pm, "Adrian Wood" <[EMAIL PROTECTED]> wrote:
> Hi al! I'm new to the list, and reasonably new to Python, so be gentle.
>
> Long story short, I'm having a hard time finding a way to call a
> function on every object of a class at once. Example:
>
> I have a class Person, which has a
On Jan 10, 2008 4:54 PM, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Adrian Wood wrote:
>
> > I can call man.state() and then woman.state() or Person.state(man) and
> > Person.state(woman) to print the status of each. This takes time and
> > space however, and becomes unmanageable if we start talki
Adrian Wood wrote:
> I can call man.state() and then woman.state() or Person.state(man) and
> Person.state(woman) to print the status of each. This takes time and
> space however, and becomes unmanageable if we start talking about a
> large number of objects, and unworkable if there is an unknown
Hi al! I'm new to the list, and reasonably new to Python, so be gentle.
Long story short, I'm having a hard time finding a way to call a
function on every object of a class at once. Example:
I have a class Person, which has a function state(). This prints a
basic string about the Person (position
11 matches
Mail list logo