On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Thu, 09 Nov 2006 10:36:07 +, Antoon Pardon wrote:
>
>> On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>>> On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote:
>>>
John Salerno <[EMAIL PROTECTED]> writes:
>
Steven D'Aprano wrote:
> On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote:
>
>> John Salerno <[EMAIL PROTECTED]> writes:
>>
>>> Ben Finney wrote:
If you pass a *mapping* of the
"I-might-want-to-add-more-in-the-future" values, then you get both
explicit *and* expandable, without
On Thu, 09 Nov 2006 10:36:07 +, Antoon Pardon wrote:
> On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>> On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote:
>>
>>> John Salerno <[EMAIL PROTECTED]> writes:
>>>
Ben Finney wrote:
> If you pass a *mapping* of the
> "I-
On 2006-11-09, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
> On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote:
>
>> John Salerno <[EMAIL PROTECTED]> writes:
>>
>>> Ben Finney wrote:
>>> > If you pass a *mapping* of the
>>> > "I-might-want-to-add-more-in-the-future" values, then you get both
>>>
On Thu, 09 Nov 2006 12:27:12 +1100, Ben Finney wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
>> Ben Finney wrote:
>> > If you pass a *mapping* of the
>> > "I-might-want-to-add-more-in-the-future" values, then you get both
>> > explicit *and* expandable, without an arbitrary unneeded sequenc
John Salerno <[EMAIL PROTECTED]> writes:
> Ben Finney wrote:
> > If you pass a *mapping* of the
> > "I-might-want-to-add-more-in-the-future" values, then you get both
> > explicit *and* expandable, without an arbitrary unneeded sequence.
>
> Do you mean by using the **kwargs parameter?
No. I mean
On Wed, 08 Nov 2006 10:55:57 -0500, John Salerno wrote:
> Ben Finney wrote:
>> John Salerno <[EMAIL PROTECTED]> writes:
>>
>>> But I do like Steve's suggestion that it's better to be explicit
>>> about each attribute, instead of just accepting a list of numbers
>>> (but I can't help but feel that
Ben Finney wrote:
> John Salerno <[EMAIL PROTECTED]> writes:
>
>> But I do like Steve's suggestion that it's better to be explicit
>> about each attribute, instead of just accepting a list of numbers
>> (but I can't help but feel that for some reason this is better,
>> because it's more general).
John Salerno <[EMAIL PROTECTED]> writes:
> But I do like Steve's suggestion that it's better to be explicit
> about each attribute, instead of just accepting a list of numbers
> (but I can't help but feel that for some reason this is better,
> because it's more general).
If you pass a *mapping* o
John Salerno wrote:
> Is this a good way to assign the values to the different attributes?
> Should 'stats' be a list/tuple (like this), or should I do *stats instead?
Thanks guys! The main suggestion seems to be to use setattr(), so I
might give that a try. But I do like Steve's suggestion tha
Larry Bates <[EMAIL PROTECTED]> wrote:
> John Salerno wrote:
> > Let's say I'm making a game and I have this base class:
> >
> > class Character(object):
> >
> > def __init__(self, name, stats):
> > self.name = name
> > self.strength = stats[0]
> > self.dexterity = st
John Salerno <[EMAIL PROTECTED]> writes:
> Let's say I'm making a game and I have this base class:
>
> class Character(object):
>
> def __init__(self, name, stats):
> self.name = name
> self.strength = stats[0]
> self.dexterity = stats[1]
> self.intelligenc
On Mon, 06 Nov 2006 16:57:58 -0500, John Salerno wrote:
> Let's say I'm making a game and I have this base class:
>
> class Character(object):
>
> def __init__(self, name, stats):
> self.name = name
> self.strength = stats[0]
> self.dexterity = stats[1]
>
John Salerno wrote:
> Let's say I'm making a game and I have this base class:
>
> class Character(object):
>
> def __init__(self, name, stats):
> self.name = name
> self.strength = stats[0]
> self.dexterity = stats[1]
> self.intelligence = stats[2]
>
John Salerno wrote:
> Let's say I'm making a game and I have this base class:
>
> class Character(object):
>
> def __init__(self, name, stats):
> self.name = name
> self.strength = stats[0]
> self.dexterity = stats[1]
> self.intelligence = stats[2]
>
John Salerno wrote:
> Let's say I'm making a game and I have this base class:
>
> class Character(object):
>
> def __init__(self, name, stats):
> self.name = name
> self.strength = stats[0]
> self.dexterity = stats[1]
> self.intelligence = stats[2]
> se
Let's say I'm making a game and I have this base class:
class Character(object):
def __init__(self, name, stats):
self.name = name
self.strength = stats[0]
self.dexterity = stats[1]
self.intelligence = stats[2]
self.luck = stats[3]
Is this a good
17 matches
Mail list logo