Efficient python programming...

James Ashley j_r_ashley at MAKGifts.com
Thu Jul 4 05:35:48 EDT 2002


In article <3D23D092.4E3AD523 at engcorp.com>, Peter Hansen wrote:
> Simon Foster wrote:
>> 
>> On Fri, 7 Jun 2002 21:03:08 +0100, "James Kew"
>> <james.kew at btinternet.com> wrote:
>> >I favour Kent Beck's aphorism: "Make it work, make it right, make it fast."
>> >
>> I prefer this one:
>> 
>> "You can have it right"
>> "You can have it cheap"
>> "You can have it now"
>> 
>> Pick any two.
> 
> Interestingly, XP provides a way to have all three...

Arguably.
To an extent.
More or less.
Maybe.

XP is interesting, for a particular software environment.  Its basic
truths (as I understand them) seem worth researthing.  It seems like a
more efficient way to develop software than trying to get the customer
to make any actual decisions before-hand.

But does that discussion belong here?  Seems to me that there are plenty
of python-specific theads going on.  There seem to be many other places
to examine this forum.

Then again, just because this is c.l.py:

TRUE=-1
FALSE=0

{ right: (TRUE, FALSE),
    cheap: (TRUE, FALSE),
    quick: (TRUE, FALSE)
}

What's a pythonic way to compare that dict?

Or would it make more sense to make a list of classes?

class right:
    pass

class cheap:
    pass

class quick:
    pass

if isinstance( a, ... ):
    ...
elif instance( a, ...) :

No, that's not right either.

<BLUSH>

Any suggestions?  (Including, of course, those which make me feel
stupid...those are actually preferable)

TIA,
James








More information about the Python-list mailing list