Re: Puzzled by list-appending behavior

2011-05-26 Thread Tim Roberts
MRAB wrote: > >I'd just like to point out that it's a convention, not a rigid rule. Reminds me of the catch-phrase from the first Pirates of the Caribbean movie: "It's more of a guideline than a rule." -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. -- http://mail.python.org/mailm

Re: The worth of comments

2011-05-26 Thread Chris Angelico
On Fri, May 27, 2011 at 12:08 PM, Roy Smith wrote: >  Sometimes > I'll drop in suggestions to future maintainers like, "consider > refactoring with with perform_frobnitz_action()" Usually, I address future-me with comments like that (on the assumption that there's nobody in the world sadistic eno

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread Stefan Behnel
Roy Smith, 27.05.2011 03:13: Ethan Furman wrote: --> 'this is a test'.startswith('this') True --> 'this is a test'.startswith('this', None, None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method [...]

Re: Puzzled by list-appending behavior

2011-05-26 Thread Chris Angelico
On Fri, May 27, 2011 at 1:52 PM, Steven D'Aprano wrote: > Because "lst" is not a real word. To native readers of languages derived > from Latin or Germany, such as English, it is quite a strange "word" > because it has no vowel. In addition, it looks like 1st (first). Contrived examples are alway

Re: Puzzled by list-appending behavior

2011-05-26 Thread Steven D'Aprano
On Fri, 27 May 2011 13:24:24 +1000, Chris Angelico wrote: > On Fri, May 27, 2011 at 11:59 AM, Steven D'Aprano > wrote: >> def get(list, object): >>    """Append object to a copy of list and return it.""" return list + >>    [object] >> >> For one or two line functions, I think that's perfectly re

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Gregory Ewing
John Bokma wrote: A Perl programmer will call this line noise: double_word_re = re.compile(r"\b(?P\w+)\s+(?P=word)(?!\w)", re.IGNORECASE) for match in double_word_re.finditer(text): print ("{0} is duplicated".format(match.group("word")) Actually, Python program

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread Steven D'Aprano
On Thu, 26 May 2011 23:00:32 -0400, Terry Reedy wrote: [...] > To me, that says pretty clearly that start and end have to be > 'positions', ie, ints or other index types. So I would say that the > error message is a bug. I see so reason why one would want to use None > rather that 0 for start or

Re: Puzzled by list-appending behavior

2011-05-26 Thread Chris Angelico
On Fri, May 27, 2011 at 11:59 AM, Steven D'Aprano wrote: > def get(list, object): >    """Append object to a copy of list and return it.""" >    return list + [object] > > For one or two line functions, I think that's perfectly reasonable. > Anything more than that, I'd be getting nervous. But ev

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Steven D'Aprano
On Thu, 26 May 2011 16:03:58 -0400, Terry Reedy wrote: > On 5/26/2011 11:36 AM, John Bokma wrote: >> Ben Finney writes: > > [impolite comment not quoted] Get a life. Or better, just fuck off and die. It will improve both the world and the Python community, of which you are nothin

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread Terry Reedy
On 5/26/2011 7:27 PM, Ethan Furman wrote: I've tried this in 2.5 - 3.2: --> 'this is a test'.startswith('this') True --> 'this is a test'.startswith('this', None, None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__

Re: Link errors embedding Python 3.2

2011-05-26 Thread Ned Deily
In article , Chris Angelico wrote: > Still trying to sort this out, trying various things. If I configure > --enable-shared, I get a different ImportError: 'libpython3.3m.so.1.0: > cannot open shared object file: No such file or directory'. That file > exists in ~/cpython, but sudo make install d

Re: The worth of comments

2011-05-26 Thread Roy Smith
In article , Richard Parker wrote: > On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: > > > My experience is that comments in Python are of relatively low > > usefulness. (For avoidance of doubt: not *zero* usefulness, merely low.) > > I can name variables, functions and cla

Re: Puzzled by list-appending behavior

2011-05-26 Thread Steven D'Aprano
On Thu, 26 May 2011 11:27:35 -0700, John Ladasky wrote: > On May 25, 9:46 pm, Uncle Ben wrote: > >> list = [1,2,3] > > Somewhat unrelated, but... is it a good idea to name your list "list"? > Isn't that the name of Python's built-in list constructor method? > > Shadowing a built-in has contri

Re: The worth of comments

2011-05-26 Thread Ben Finney
Richard Parker writes: > On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: > > > My experience is that comments in Python are of relatively low > > usefulness. (For avoidance of doubt: not *zero* usefulness, merely > > low.) I can name variables, functions and classes with sensib

Re: Python's super() considered super!

2011-05-26 Thread Ben Finney
Raymond Hettinger writes: > I just posted a tutorial and how-to guide for making effective use of > super(). Thanks very much! We need articles like this. Raymond Hettinger writes: > Here's a link to the super() how-to-guide and commentary: bit.ly/ > iFm8g3 We also, though, need *real* URLs

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread Roy Smith
In article , Ethan Furman wrote: > --> 'this is a test'.startswith('this') > True > --> 'this is a test'.startswith('this', None, None) > Traceback (most recent call last): >File "", line 1, in > TypeError: slice indices must be integers or None or have an __index__ > method [...] > Any re

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread Mel
Ethan Furman wrote: > I've tried this in 2.5 - 3.2: > > --> 'this is a test'.startswith('this') > True > --> 'this is a test'.startswith('this', None, None) > Traceback (most recent call last): >File "", line 1, in > TypeError: slice indices must be integers or None or have an __index__ > me

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread Carl Banks
On Thursday, May 26, 2011 4:27:22 PM UTC-7, MRAB wrote: > On 27/05/2011 00:27, Ethan Furman wrote: > > I've tried this in 2.5 - 3.2: > > > > --> 'this is a test'.startswith('this') > > True > > --> 'this is a test'.startswith('this', None, None) > > Traceback (most recent call last): > > File "", l

Re: Link errors embedding Python 3.2

2011-05-26 Thread Chris Angelico
Still trying to sort this out, trying various things. If I configure --enable-shared, I get a different ImportError: 'libpython3.3m.so.1.0: cannot open shared object file: No such file or directory'. That file exists in ~/cpython, but sudo make install doesn't put it anywhere else. Pointing LD_LIBR

Re: Why did Quora choose Python for its development?

2011-05-26 Thread RainyDay
On May 26, 5:33 pm, Daniel Kluev wrote: > On Wed, May 25, 2011 at 3:10 AM, Octavian Rasnita wrote: > >> Once again. Suppose we have array of key-value pairs (two-dimensional > >> array), > > > This is a forced example to fit the way Python can do it with a clean > > syntax, but I don't think the

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* sal migondis (Thu, 26 May 2011 17:50:32 -0400) > On Thu, May 26, 2011 at 12:28 PM, sal migondis > wrote: > > From: Thorsten Kampe > > It's unnecessary bullshit buzzword bingo from nerds which adds or > > helps or explains nothing. It's just that simple. > > This has nothing to do with buzzword

Re: bug in str.startswith() and str.endswith()

2011-05-26 Thread MRAB
On 27/05/2011 00:27, Ethan Furman wrote: I've tried this in 2.5 - 3.2: --> 'this is a test'.startswith('this') True --> 'this is a test'.startswith('this', None, None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ m

bug in str.startswith() and str.endswith()

2011-05-26 Thread Ethan Furman
I've tried this in 2.5 - 3.2: --> 'this is a test'.startswith('this') True --> 'this is a test'.startswith('this', None, None) Traceback (most recent call last): File "", line 1, in TypeError: slice indices must be integers or None or have an __index__ method The 3.2 docs say this: str.sta

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Xah Lee
On May 26, 4:20 am, Thorsten Kampe wrote: > Did your mom tell you to "recursively clean up your room"?. that had me L O L! i think i'll quote in my unix hating blogs sometimes, if you don't mind. ☺ Xah -- http://mail.python.org/mailman/listinfo/python-list

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread sal migondis
On Thu, May 26, 2011 at 12:28 PM, sal migondis wrote: > From: Thorsten Kampe > Subject: Re: English Idiom in Unix: Directory Recursively > Date: Thu, 26 May 2011 12:46:58 +0200 > To: python-list@python.org > > * Steven D'Aprano (26 May 2011 10:06:44 GMT) >> >> On Thu, 26 May 2011 10:48:07 +0200,

Re: Puzzled by list-appending behavior

2011-05-26 Thread Terry Reedy
On 5/26/2011 11:58 AM, MRAB wrote: On 26/05/2011 06:17, Chris Rebert wrote: list.remove(), list.sort(), and list.extend() similarly return None rather than the now-modified list. I'd just like to point out that it's a convention, not a rigid rule. Sometimes it's not followed, for example, dic

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Daniel Kluev
On Wed, May 25, 2011 at 3:10 AM, Octavian Rasnita wrote: >> Once again. Suppose we have array of key-value pairs (two-dimensional >> array), > > This is a forced example to fit the way Python can do it with a clean syntax, > but I don't think there are cases in which somebody wants to create > h

Re: The worth of comments

2011-05-26 Thread Patty
- Original Message - From: "Richard Parker" To: Sent: Thursday, May 26, 2011 11:50 AM Subject: The worth of comments On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: My experience is that comments in Python are of relatively low usefulness. (For avoidance of dou

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Karim
On 05/26/2011 10:03 PM, Terry Reedy wrote: On 5/26/2011 11:36 AM, John Bokma wrote: Ben Finney writes: [impolite comment not quoted] Get a life. Or better, just fuck off and die. It will improve both the world and the Python community, of which you are nothing but a little, smelly shits

Re: Python's super() considered super!

2011-05-26 Thread Terry Reedy
On 5/26/2011 2:13 PM, Dotan Cohen wrote: On Thu, May 26, 2011 at 19:39, Raymond Hettinger wrote: It would also be great if some of you would upvote it on HackerNews. Here's a link to the super() how-to-guide and commentary: bit.ly/ iFm8g3 Is that the same link as in the OP? I don't click

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Terry Reedy
On 5/26/2011 11:36 AM, John Bokma wrote: Ben Finney writes: [impolite comment not quoted] Get a life. Or better, just fuck off and die. It will improve both the world and the Python community, of which you are nothing but a little, smelly shitstain. That abuse is entirely unwelcome in

RE: Puzzled by list-appending behavior

2011-05-26 Thread Prasad, Ramit
>> And why do you insist on calling an instance of list, "list"? Even a >> human reader will confuse which is which. What you are showing is an >> example how confusing things become when a keyword (list) is >> over-written (with list instance). > (Minor note: 'list' is not a keyword (if it were,

python urllib2 data post over https

2011-05-26 Thread miamia
hello, I am using this code to send data over https with post method: params='tieto data idu na sevrer\n' kamodoslat = "https://domena.tld/script.php"; req = urllib2.Request(kamodoslat) req.add_header('User-Agent', 'agent') resp = urllib2.urlopen(req, params) how can I make sure that data were re

Re: Python's super() considered super!

2011-05-26 Thread Dotan Cohen
On Thu, May 26, 2011 at 21:38, Ian Kelly wrote: > It's a link to ycombinator: > > http://news.ycombinator.com/item?id=2588262 > Thanks. -- Dotan Cohen http://gibberish.co.il http://what-is-what.com -- http://mail.python.org/mailman/listinfo/python-list

The worth of comments

2011-05-26 Thread Richard Parker
On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote: > My experience is that comments in Python are of relatively low > usefulness. (For avoidance of doubt: not *zero* usefulness, merely low.) > I can name variables, functions and classes with sensible, self- > documenting names. W

Re: Puzzled by list-appending behavior

2011-05-26 Thread Terry Reedy
On 5/26/2011 3:18 AM, Algis Kabaila wrote: And why do you insist on calling an instance of list, "list"? Even a human reader will confuse which is which. What you are showing is an example how confusing things become when a keyword (list) is over-written (with list instance). (Minor note: 'lis

Re: Python's super() considered super!

2011-05-26 Thread Ian Kelly
On Thu, May 26, 2011 at 12:13 PM, Dotan Cohen wrote: > On Thu, May 26, 2011 at 19:39, Raymond Hettinger wrote: >>> It would also be great if some of you would upvote it on HackerNews. >> >> >> Here's a link to the super() how-to-guide and commentary:  bit.ly/ >> iFm8g3 >> > > Is that the same lin

Re: Puzzled by list-appending behavior

2011-05-26 Thread John Ladasky
On May 25, 9:46 pm, Uncle Ben wrote: > list = [1,2,3] Somewhat unrelated, but... is it a good idea to name your list "list"? Isn't that the name of Python's built-in list constructor method? Shadowing a built-in has contributed to more than one subtle bug in my code, and I've learned to avoid

Re: Python's super() considered super!

2011-05-26 Thread Dotan Cohen
On Thu, May 26, 2011 at 19:39, Raymond Hettinger wrote: >> It would also be great if some of you would upvote it on HackerNews. > > > Here's a link to the super() how-to-guide and commentary:  bit.ly/ > iFm8g3 > Is that the same link as in the OP? I don't click on blind links, so if it isn't then

Re: pyGTK identify a button

2011-05-26 Thread Alister Ware
On Wed, 25 May 2011 10:18:48 +0200, Tracubik wrote: > Hi all, > i'm trying to write a simple windows with two button in GTK, i need a > way to identify wich button is pressed. Consider that: > > the two button are connected (when clicked) to infoButton(self, widget, > data=None) > > infoButton()

Re: Python's super() considered super!

2011-05-26 Thread Raymond Hettinger
> It would also be great if some of you would upvote it on HackerNews. Here's a link to the super() how-to-guide and commentary: bit.ly/ iFm8g3 Raymod -- http://mail.python.org/mailman/listinfo/python-list

Python's super() considered super!

2011-05-26 Thread Raymond Hettinger
I just posted a tutorial and how-to guide for making effective use of super(). One of the reviewers, David Beazley, said, "Wow, that's really great!I see this becoming the definitive post on the subject" The direct link is: http://rhettinger.wordpress.com/2011/05/26/super-considered-super

Re: Newbie question about SQLite + Python and twitter

2011-05-26 Thread John Nagle
On 5/25/2011 6:08 PM, Philip Semanchuk wrote: On May 25, 2011, at 2:17 PM, Jayme Proni Filho wrote: Helo guys, I'm building a local application for twitter for my brother's store. I'm in the beginning and I have some newbie problems, so: I create a table called tb_messages with int auto incr

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Ethan Furman
John, You say English is not your first language. Let me assure you that the words you chose to use in reply to Stephen were vulgar as well as rude, and did more to lesson the overall friendliness of this forum than Stephen's adversarial style. You usually have interesting and informative p

Re: Puzzled by list-appending behavior

2011-05-26 Thread Chris Angelico
On Fri, May 27, 2011 at 1:58 AM, MRAB wrote: > I'd just like to point out that it's a convention, not a rigid rule. > Sometimes it's not followed, for example, dict.setdefault. dict.setdefault is more like dict.get but it also stores the result. It's probably more a name issue than a protocol iss

Re: Puzzled by list-appending behavior

2011-05-26 Thread MRAB
On 26/05/2011 06:17, Chris Rebert wrote: On Wed, May 25, 2011 at 9:46 PM, Uncle Ben wrote: In playing with lists of lists, I found the following: (In 3.1, but the same happens also in 2.7) list = [1,2,3] list.append ( [4,5,6] ) Note the lack of output after this line. This indicates that li

Re: Why did Quora choose Python for its development?

2011-05-26 Thread theg...@nospam.net
So when quora.com fails we can all say it is Python's fault? Maybe they should have focused more on content instead of the bits under the hood? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why did Quora choose Python for its development?

2011-05-26 Thread John Bokma
Ben Finney writes: >> Get a life. Or better, just fuck off and die. It will improve both the >> world and the Python community, of which you are nothing but a little, >> smelly shitstain. > > That abuse is entirely unwelcome in this community, against any person. > Please desist. You should have

Re: Why did Quora choose Python for its development?

2011-05-26 Thread theg...@nospam.net
On 5/25/2011 7:52 PM, Steven D'Aprano wrote: On Wed, 25 May 2011 17:30:48 -0400, theg...@nospam.net wrote: On 5/24/2011 1:39 PM, D'Arcy J.M. Cain wrote: [snip] One of my favorite quotes (not sure if it was about Perl or APL) is "I refuse to use a programming language where the proponents of it

Re: List of WindowsError error codes and meanings

2011-05-26 Thread Thomas Heller
Am 20.05.2011 19:56, schrieb Andrew Berg: This is probably somewhat off-topic, but where would I find a list of what each error code in WindowsError means? WindowsError is so broad that it could be difficult to decide what to do in an except clause. Fortunately, sys.exc_info()[1][0] holds the spe

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Steven D'Aprano
On Thu, 26 May 2011 12:44:47 +, Neil Cerutti wrote: > On 2011-05-25, Matty Sarro wrote: >> General readability is a farce. If it was true we would only have one >> section to the library. Different people enjoy reading, and can >> comprehend better in different ways. THat's why some people ar

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Ben Finney
Roy Smith writes: > Also, the purpose of source code is to transmit information (to both > the compiler and to human readers). And the relative importance of readability for those two purposes is often misunderstood. Composing source code so that the *machine* will understand it is one thing, a

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Roy Smith
In article <94709uf99...@mid.individual.net>, Neil Cerutti wrote: > On 2011-05-25, Matty Sarro wrote: > > General readability is a farce. If it was true we would only > > have one section to the library. Different people enjoy > > reading, and can comprehend better in different ways. THat's > >

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Neil Cerutti
On 2011-05-25, Matty Sarro wrote: > General readability is a farce. If it was true we would only > have one section to the library. Different people enjoy > reading, and can comprehend better in different ways. THat's > why some people are super verbose - hell, just look at this > here post! :) D

Question about isodate

2011-05-26 Thread truongxuan quang
Hello list, I am installing and testing istSOS wrote base on Python with its extension like gdal, isodate, easy istall, setuptool, psycopg. I have already installed all these stuff when I was using method POST the error appear is "No module named mx.DateTime.ISO" , could you please give me your

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Chris Angelico
On Thu, May 26, 2011 at 9:20 PM, Thorsten Kampe wrote: > Did your mom tell you to "recursively clean up your room"?. > Considering that I don't have a wardrobe with a portal to Narnia, no, she has never had to tell me to clean up the room inside my room. Anyway, my room's full. There's no room i

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Charles (Thu, 26 May 2011 20:58:35 +1000) > "Thorsten Kampe" wrote in message > news:mpg.284834d227e3acd1989...@news.individual.de... > > > > If someone has learned what a directory or folder is, you don't have > > to explain what "include sub-folders" means. Instead of creating a > > new myste

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Chris Angelico
I just conducted a rapid poll of a non-technical userbase. (Okay, I just asked my sister who happens to be sitting here. But she's nontechnical.) She explained "recursive" as "it repeats until it can't go any further". I think that's a fair, if not perfectly accurate, explanation. Actually... if

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Charles
"Thorsten Kampe" wrote in message news:mpg.284834d227e3acd1989...@news.individual.de... > > If someone has learned what a directory or folder is, you don't have to > explain what "include sub-folders" means. Instead of creating a new > mysterious term ("recursively delete"), you simply explain s

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Steven D'Aprano (26 May 2011 10:06:44 GMT) > > On Thu, 26 May 2011 10:48:07 +0200, Thorsten Kampe wrote: > > > But not to digress, the /real/ problem with commands or idioms like "rm > > -r" is /not/ their choice of option names but that they explain these > > options in the exact same terms. N

Python-URL! - weekly Python news and links (May 26)

2011-05-26 Thread Cameron Laird
[This edition drafted by Gabriel Genellina.] QOTW: "They did a study once to determine the best tool for development. Turns out that the most productive tool was generally the one that the user believed was the most productive. In hindsight I think that that was rather obvious." - D'Arcy J.M. C

Re: Python-list Digest, Vol 92, Issue 221

2011-05-26 Thread Chris Angelico
On Thu, May 26, 2011 at 8:07 PM, Steven D'Aprano wrote: > Another use for comments is to explain *why* rather than *what*. No > matter how readable your code is, if you don't understand why it is done, > you can't effectively maintain it. If the why is obvious, you don't need > a comment. That's

Re: Python-list Digest, Vol 92, Issue 221

2011-05-26 Thread Steven D'Aprano
On Thu, 26 May 2011 14:06:56 +1000, Chris Angelico wrote: > On Thu, May 26, 2011 at 10:58 AM, Richard Parker > wrote: >> It's time to stop having flame wars about languages and embrace >> programmers who care enough about possible future readers of their code >> to thoroughly comment it. Comments

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Steven D'Aprano
On Thu, 26 May 2011 10:48:07 +0200, Thorsten Kampe wrote: > But not to digress, the /real/ problem with commands or idioms like "rm > -r" is /not/ their choice of option names but that they explain these > options in the exact same terms. No one would have a problem with "-r, > --recursive -- remo

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Steven D'Aprano (25 May 2011 22:58:21 GMT) > > On Wed, 25 May 2011 00:06:06 +0200, Rikishi42 wrote: > > > What I mean is: I'm certain that over the years I've had more than one > > person come to me and ask what 'Do you wish to delete this directory > > recursively?' meant. BAut never have I b

Re: English Idiom in Unix: Directory Recursively

2011-05-26 Thread Thorsten Kampe
* Steven D'Aprano (25 May 2011 21:59:58 GMT) > On Wed, 25 May 2011 09:26:11 +0200, Thorsten Kampe wrote: > > > Naming something in the terms of its implementation details (in this > > case recursion) is a classical WTF. > > *If* that's true, it certainly doesn't seem to apply to real-world > obj

Re: Why did Quora choose Python for its development?

2011-05-26 Thread Thorsten Kampe
* John Bokma (Wed, 25 May 2011 07:01:07 -0500) > Thorsten Kampe writes: > > * Chris Angelico (Wed, 25 May 2011 08:01:38 +1000) > >> > >> On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain wrote: > >> > One of my favorite quotes (not sure if it was about Perl or APL) is > > "I > >> > refuse to us

Re: Puzzled by list-appending behavior

2011-05-26 Thread Chris Rebert
On Thu, May 26, 2011 at 12:23 AM, Chris Angelico wrote: > On Thu, May 26, 2011 at 5:20 PM, Chris Angelico wrote: >> >> Ben Finney has already answered the main question > > Giving credit where credit's due, it was more Chris Rebert's post that > answered the question. Sorry Chris! Eh, one can't

Re: Hotshoting recursive function

2011-05-26 Thread Selvam
On Wed, May 25, 2011 at 2:20 PM, Gabriel Genellina wrote: > En Sun, 22 May 2011 10:42:08 -0300, Selvam > escribió: > > > I am using hotshot module to profile my python function. >> >> I used the details from ( >> >> http://code.activestate.com/recipes/576656-quick-python-profiling-with-hotshot/

Re: Puzzled by list-appending behavior

2011-05-26 Thread Uncle Ben
On May 26, 12:46 am, Uncle Ben wrote: > In playing with lists of lists, I found the following: > > (In 3.1, but the same happens also in 2.7) > > list = [1,2,3] > list.append ( [4,5,6] ) > x = list > x   -> >     [1,2,3,[4,5,6]] > as expected. > > But the shortcut fails: > > list=[1,2,3] > x = lis

Re: Puzzled by list-appending behavior

2011-05-26 Thread Chris Angelico
On Thu, May 26, 2011 at 5:20 PM, Chris Angelico wrote: > > Ben Finney has already answered the main question Giving credit where credit's due, it was more Chris Rebert's post that answered the question. Sorry Chris! Chris Angelico -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzled by list-appending behavior

2011-05-26 Thread Chris Angelico
On Thu, May 26, 2011 at 2:46 PM, Uncle Ben wrote: > In playing with lists of lists, I found the following: > > (In 3.1, but the same happens also in 2.7) > > list = [1,2,3] Ben Finney has already answered the main question, but as a side point, I would generally avoid creating a variable called '

Re: Puzzled by list-appending behavior

2011-05-26 Thread Algis Kabaila
On Thursday 26 May 2011 14:46:45 Uncle Ben wrote: > In playing with lists of lists, I found the following: > > (In 3.1, but the same happens also in 2.7) > > list = [1,2,3] > list.append ( [4,5,6] ) > x = list > x -> > [1,2,3,[4,5,6]] > as expected. > > But the shortcut fails: > > list=[1