Re: [Tutor] How to identify clusters of similar files

2012-06-03 Thread Albert-Jan Roskam
From: Steven D'Aprano st...@pearwood.info To: Python Mailing List tutor@python.org Sent: Sunday, June 3, 2012 4:00 AM Subject: Re: [Tutor] How to identify clusters of similar files Albert-Jan Roskam wrote: Hi, I want to use difflib to compare a lot (tens of thousands) of text files. I

[Tutor] use the data None

2012-06-03 Thread Tehn Yit Chin
Hi all, I am trying to understand when it is appropriate to use None as in the following example if abc != None: print abc is not None 1) Can I use it to determine if the variable abc exists? 2) Can I use it to determine if the variable abc does not contain anything? Many thanks --

Re: [Tutor] use the data None

2012-06-03 Thread Corey Richardson
On Sun, 3 Jun 2012 23:43:30 +0200 Tehn Yit Chin tehn.yit.c...@gmail.com tehn.yit.c...@gmail.com wrote: Hi all, I am trying to understand when it is appropriate to use None as in the following example if abc != None: print abc is not None The proper idiom, for a variety of

Re: [Tutor] use the data None

2012-06-03 Thread Steven D'Aprano
Corey Richardson wrote: [snip] (I've been away from Python for a bit, one of the other tutors might correct me with better practice things, I'm rusty!) Your reply is good. -- Steven ___ Tutor maillist - Tutor@python.org To unsubscribe or change

Re: [Tutor] use the data None

2012-06-03 Thread Alan Gauld
On 03/06/12 22:43, Tehn Yit Chin wrote: I am trying to understand when it is appropriate to use None as in the following example if abc != None: print abc is not None In general I only use that idf its a defaulted parameter to a function: def foo(x=None): if x is None: do

Re: [Tutor] use the data None

2012-06-03 Thread Alan Gauld
On 04/06/12 01:39, Alan Gauld wrote: for var in (a,b,c): if not var: print var.__name__, ' is empty or false' Oops, that won't work. __name__ is not an attribute of object, which I thought it was... But hopefully the intention was clear. -- Alan G Author of the Learn to

[Tutor] [Parser/pgen] Error 1

2012-06-03 Thread Wh1t3ha7
I was trying to install Python on Ubuntu 12.04 and Im getting this error message when entering the make -j command: Parser/grammar1.o: file not recognized: File truncated collect2: ld returned 1 exit status make: *** [Parser/pgen] Error 1 make: *** Waiting for unfinished jobs I was

Re: [Tutor] [Parser/pgen] Error 1

2012-06-03 Thread Joel Goldstick
On Sun, Jun 3, 2012 at 9:41 PM, Wh1t3ha7 wh1t3...@tormail.org wrote: I was trying to install Python on Ubuntu 12.04 and Im getting this error message when entering the make -j command: Parser/grammar1.o: file not recognized: File truncated collect2: ld returned 1 exit status make: ***