Stephen,
I've come into this thread late, but it looks like you're lamenting the fact
you can stipulate complex iterations on a single line, which can be nice. I'd
not really missed this in several years of programming with python.
However, Your post is interesting because it raises a point I'
Thank you for reminding me of that!
I've just started with 2.5 but that one had slipped my memory and I've
still been using
X = (z and [y] or [w])[0]
Thank!
Jeff
-Original Message-
From: Kent Johnson [mailto:[EMAIL PROTECTED]
Sent: Friday, August 10, 2007 10:23 AM
To: Smith, Jeff
Cc
"Smith, Jeff" <[EMAIL PROTECTED]> wrote
> Python should have a case statement,
I don;t care about that one, but we do ave the even less useful(IMHO)
with statement so don't give up hope!
> a ternary operator,
Well you have that now in 2.5 I believe.
> full-fledged lambdas...
I'm with you the
On 10/08/07, Alan Gauld <[EMAIL PROTECTED]> wrote:
> > full-fledged lambdas...
>
> I'm with you there but I've been waiting long enough to have
> given up. In fact I think we are more likely to lose lambdas
> altogether than see an improved version!
Guido said he's keeping lambdas in Python 3000
Hi. I'm not a real programmer/low level Unix guy yet. I realize that this
is not a Django forum per se. But, I don't know where else to turn before
giving up.
Can anyone help me install Django on my Mac? I have tried all sorts of
approaches outlnied on various blogs and have Django on my MacBo
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Kent Johnson
Stephen McInerney wrote:
>> The C for-loop syntax itself is not error-prone at all.
>> Unless you mean off-by-one errors etc., missing initializations, and
>> those are mostly semantic not syntax-related.
> Yeah other th
Stephen McInerney wrote:
> Guys,
>
> I'm annoyed at how far offtopic
If you get annoyed at threads drifting off-topic you'd better stay away
from all public mailing lists!
> and frankly rude the responses to my
> email were,
Re-reading the entire thread I don't see anything I would construe a
I think you could use sets, (I asked a similar question a few days ago
re numpy arrays).
ie
Convert both list to sets
use Set intersection
convert answer to lists
HTH
Andy
Tom Fitzhenry wrote:
> On Fri, Aug 10, 2007 at 02:54:44AM -0700, Jaggo wrote:
>> Can anyone think of any better way?
>
> If
Tom Fitzhenry wrote:
> On Fri, Aug 10, 2007 at 02:54:44AM -0700, Jaggo wrote:
>> Can anyone think of any better way?
>
> If SmallList and BigList are sorted (in order), there is a faster method:
>
> def IsAPartOfList(SmallList,BigList):
> for i in BigList:
> for j in SmallList:
>
On Fri, Aug 10, 2007 at 02:54:44AM -0700, Jaggo wrote:
> Can anyone think of any better way?
If SmallList and BigList are sorted (in order), there is a faster method:
def IsAPartOfList(SmallList,BigList):
for i in BigList:
for j in SmallList:
if i==j:
retur
Stephen McInerney wrote:
> Guys,
>
> I'm annoyed at how far offtopic and frankly rude the responses to my
> email were,
> and I'm just going to submit my doc change request to Fred Drake
> exactly as
> I was intending to before I sent the first mail.
I have found your e-mails to be far more rude
> names = ['anne', 'beth', 'george', 'damon']
> ages = [12, 45, 32, 102]
> for i in range(len(names)):
> print names[i], 'is', ages[i], 'years old'
>
> now all of it makes sense to me except for the line for i in
> range(len(names)):
> the len statement calculates the number of characters
hi, an
It seems this is a delightful exchange of rude threats and insults. ;-)
My question is: If you love C syntax so much, why don't you program in C and
leave us python people alone?
And also: It is not the responsibility of the docs to ease the way for C
programmers. That is what a specific tutori
That's a good point. He keeps indicating that the tutorial should make
reference to C/C++/Java syntax specifically because that's what the
rest of the known universe uses. To carry your example one step
farther, it's like expecting a grade school Spanish text to have
pointers for English speaker
Guys,
I'm annoyed at how far offtopic and frankly rude the responses to my email
were,
and I'm just going to submit my doc change request to Fred Drake exactly as
I was intending to before I sent the first mail.
I didn't get much decent opinion on my central question:
"isn't this idiom more res
Hello!
I desperately need a simple way to compare whether any item of SmallList is in
BigList.
My current way,
def IsAPartOfList(SmallList,BigList)
for item in SmallList:
if item in BigList:
return True
return False
Takes up waay too much time to process.
Can anyone think of any be
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Stephen McInerney
> I didn't get much decent opinion on my central question:
> "isn't this idiom more restrictive than C/C++/Java (aka the rest of
the universe),"
I thought you got plenty of decent opinion and most of was disagreement.
Jaggo wrote:
> Hello!
>
> I desperately need a simple way to compare whether any item of SmallList
> is in BigList.
>
> My current way,
>
> def IsAPartOfList(SmallList,BigList)
> for item in SmallList:
> if item in BigList:
>return True
> return False
>
> Takes up waay too much tim
David Handel wrote:
> Hi. I'm not a real programmer/low level Unix guy yet. I realize that
> this is not a Django forum per se. But, I don't know where else to turn
> before giving up.
>
> Can anyone help me install Django on my Mac? I have tried all sorts of
> approaches outlnied on variou
Hello!
I'm quiet new to Python and definitely a beginner in implementing Python
extensions in C/C++. I've followed the structure given in the formal Python
documentation to write the following code block:
===
//cmatmod.c
#include
static unsigned int eigenvect_calc(double *min_eps)
{
Hi,
You're really asking about optimisation incidentally.
On Friday 10 August 2007 10:54, Jaggo wrote:
> Hello!
>
> I desperately need a simple way to compare whether any item of SmallList is
> in BigList.
A simple way:
True in [x in BigList for x in SmallList]
Not efficient necessarily, but
Smith, Jeff wrote:
> P.S. This should in no way be construed as undercutting my belief that
> Python should have a case statement, a ternary operator, and
> full-fledged lambdas
Python 2.5 does have conditional expressions that do the work of a
ternary operator:
x = y if z else w
http://docs.py
"Stephen McInerney" <[EMAIL PROTECTED]> wrote
> I'm annoyed at how far offtopic and frankly rude the responses
Don;t get annoyed at off topic posts, that's all part of the fun in
a group like this which is aimed at teaching novices how to
program and specifically how to program in Python. The wid
David Handel wrote:
> Hi Kent,
> I'm not having much luck. I placed the Django 0.96 folder in /Library
Better to put it in a Download folder or some such, it doesn't need to
be in Library. Not a big deal though.
> and then ran the following session:
> Last login: Fri Aug 10 16:58:58 on ttyp1
>
24 matches
Mail list logo