Re: [Tutor] Losing the expressiveness ofC'sfor-sta tement?/RESENDwith example

2007-08-10 Thread Michael Sparks
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'

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Smith, Jeff
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

Re: [Tutor] Losing theexpressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Alan Gauld
"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

Re: [Tutor] Losing theexpressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Adam Bark
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

[Tutor] Installation of Django on Mac Tiger

2007-08-10 Thread David Handel
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

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Smith, Jeff
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

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Kent Johnson
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

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Andy Cheesman
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

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Kent Johnson
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: >

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Tom Fitzhenry
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

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Luke Paireepinart
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

Re: [Tutor] need futher explaining

2007-08-10 Thread wesley chun
> 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

Re: [Tutor] Losing the expressivenessofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Tiger12506
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

Re: [Tutor] Losing the expressivenessofC'sfor-statement?/RESENDwithexample

2007-08-10 Thread Smith, Jeff
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

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Stephen McInerney
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

[Tutor] Simple way to compare Two lists

2007-08-10 Thread Jaggo
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

Re: [Tutor] Losing the expressivenessofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Smith, Jeff
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.

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Kent Johnson
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

Re: [Tutor] Installation of Django on Mac Tiger

2007-08-10 Thread Kent Johnson
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

[Tutor] Extension problem

2007-08-10 Thread Ali Alhakim
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) {

Re: [Tutor] Simple way to compare Two lists

2007-08-10 Thread Michael Sparks
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

Re: [Tutor] Losing the expressiveness ofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Kent Johnson
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

Re: [Tutor] Losing the expressivenessofC'sfor-statement?/RESENDwith example

2007-08-10 Thread Alan Gauld
"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

Re: [Tutor] Installation of Django on Mac Tiger

2007-08-10 Thread Kent Johnson
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 >