Re: Obnoxious postings from Google Groups

2012-11-07 Thread Steven D'Aprano
On Wed, 07 Nov 2012 18:52:16 +1300, Gregory Ewing wrote: Steven D'Aprano wrote: The downside is that if spaces are not argument separators, then you need something else to be an argument separator. Or you need argument delimiters. Or strings need to be quoted. Programming languages do these

chocolate moonpies

2012-11-07 Thread Constantine
chocolate moonpies http://www.google.com/search?hl=enq=chocolate+moonpies+site:vandaydiigkij.blogspot.combtnI=I%27m+Feeling+Lucky -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi-dimensional list initialization

2012-11-07 Thread Jussi Piitulainen
Steven D'Aprano writes: On Wed, 07 Nov 2012 00:23:44 +, MRAB wrote: I prefer the term reference semantics. Oh good, because what the world needs is yet another name for the same behaviour. - call by sharing - call by object sharing - call by object reference - call by object -

Re: Multi-dimensional list initialization

2012-11-07 Thread wxjmfauth
Le mercredi 7 novembre 2012 02:55:10 UTC+1, Steven D'Aprano a écrit : Two-dimensional arrays in Python using lists are quite rare. Anyone who is doing serious numeric work where they need 2D arrays is using numpy, not lists. There are millions of people using Python, so it's

RE: Obnoxious postings from Google Groups

2012-11-07 Thread Kushal Kumaran
Prasad, Ramit ramit.pra...@jpmorgan.com writes: Steven D'Aprano wrote: On Tue, 06 Nov 2012 17:16:44 +, Prasad, Ramit wrote: To enter the newline, I typed Ctrl-Q to tell bash to treat the next character as a literal, and then typed Ctrl-J to get a newline. That sounds

Re: Multi-dimensional list initialization

2012-11-07 Thread Oscar Benjamin
On Nov 7, 2012 5:41 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: If anything is to be done in this area, it would be better as an extension of list comprehensions, e.g. [[None times 5] times 10] which would be equivalent to [[None for _i in xrange(5)] for _j in xrange(10)] I

how-to use readline.set_completion_display_matches_hook()?

2012-11-07 Thread Jean-Pierre Miceli
Hi all, I'm working on a tool which enable support of tab completion using the readline modul. And I have a problem with set_completion_display_matches_hook function I've created a display hook function and registered it. It is called and it prints the desire messages. But once it has completed,

Re: multiprocessing help (Terry Reedy)

2012-11-07 Thread Apprentice3D
Sent from my iPad On 2012-11-07, at 12:15 AM, python-list-requ...@python.org wrote: Re: multiprocessing help (Terry Reedy) -- http://mail.python.org/mailman/listinfo/python-list

Re: clicking on turtle

2012-11-07 Thread Peter Otten
Nicolas Graner wrote: I have a problem with the standard turtle module. When a turtle has a custom shape of type compound, it doesn't seem to respond to click events. No problem with polygon shapes. Running python 3.2.3, turtle version 1.1b on Windows XP. Here is my test file:

Re: how-to use readline.set_completion_display_matches_hook()?

2012-11-07 Thread Stefan H. Holek
On 07.11.2012, at 11:36, Jean-Pierre Miceli wrote: Hi all, I'm working on a tool which enable support of tab completion using the readline modul. And I have a problem with set_completion_display_matches_hook function I've created a display hook function and registered it. It is called

Re: Multi-dimensional list initialization

2012-11-07 Thread Joshua Landau
On 7 November 2012 11:11, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On Nov 7, 2012 5:41 AM, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: If anything is to be done in this area, it would be better as an extension of list comprehensions, e.g. [[None times 5] times 10]

Re: Multi-dimensional list initialization

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 13:39, Joshua Landau joshua.landau...@gmail.com wrote: On 7 November 2012 11:11, Oscar Benjamin oscar.j.benja...@gmail.com wrote: A more modest addition for the limited case described in this thread could be to use exponentiation: [0] ** (2, 3) [[0, 0, 0], [0, 0, 0]]

Re: Obnoxious postings from Google Groups

2012-11-07 Thread Grant Edwards
On 2012-11-06, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 06 Nov 2012 11:51:03 -0500, GangGreene wrote: I have just finished a 251 line bash shell script that builds my linux distro from scratch. From scratch? So if you run it on bare metal with no OS, it works? :-P

Re: Multi-dimensional list initialization

2012-11-07 Thread Ethan Furman
After this post the only credibility you have left (with me, anyway) is that you seem to be willing to learn. So learn the way Python works before you try to reimplement it. ~Ethan~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Multi-dimensional list initialization

2012-11-07 Thread Ethan Furman
Oscar Benjamin wrote: On Nov 7, 2012 5:41 AM, Gregory Ewing greg.ew...@canterbury.ac.nz mailto:greg.ew...@canterbury.ac.nz wrote: If anything is to be done in this area, it would be better as an extension of list comprehensions, e.g. [[None times 5] times 10] which would be

RE: Multi-dimensional list initialization

2012-11-07 Thread Prasad, Ramit
Gregory Ewing wrote: Roy Smith wrote: Call by social network? The called function likes the object. Depending on how it feels, it can also comment on some of the object's attributes. And then finds that it has inadvertently shared all its private data with other functions accessing

Pickling a dictionary

2012-11-07 Thread Devashish Tyagi
So I want to store the current state of a InteractiveInterpreter Object in database. In order to achieve this I tried this obj = InteractiveInterpreter() local = obj.locals() pickle.dump(local, open('obj.dump','rw')) But I received an error say TypeError: can't pickle ellipsis objects From

Re: Multi-dimensional list initialization

2012-11-07 Thread Oscar Benjamin
On Nov 7, 2012 3:55 PM, Ethan Furman et...@stoneleaf.us wrote: Oscar Benjamin wrote: A more modest addition for the limited case described in this thread could be to use exponentiation: [0] ** (2, 3) [[0, 0, 0], [0, 0, 0]] What would happen with -- [{}] ** (2, 3) The list being

Re: Pickling a dictionary

2012-11-07 Thread Ian Kelly
On Wed, Nov 7, 2012 at 9:07 AM, Devashish Tyagi devashishroc...@gmail.com wrote: So I want to store the current state of a InteractiveInterpreter Object in database. In order to achieve this I tried this obj = InteractiveInterpreter() local = obj.locals() pickle.dump(local,

Re: Pickling a dictionary

2012-11-07 Thread Peter Otten
Devashish Tyagi wrote: So I want to store the current state of a InteractiveInterpreter Object in database. In order to achieve this I tried this obj = InteractiveInterpreter() local = obj.locals() pickle.dump(local, open('obj.dump','rw')) Assuming InteractiveInterpreter is imported from

Re: Pickling a dictionary

2012-11-07 Thread Ian Kelly
On Wed, Nov 7, 2012 at 9:16 AM, Ian Kelly ian.g.ke...@gmail.com wrote: On Wed, Nov 7, 2012 at 9:07 AM, Devashish Tyagi devashishroc...@gmail.com wrote: So I want to store the current state of a InteractiveInterpreter Object in database. In order to achieve this I tried this obj =

Printing a text over an image

2012-11-07 Thread Martha Morrigan
Hi guys, Using python, wxpython and sqlite in a windows system, Im trying to print some certificates/diplomas/cards with a image at background with the name of person/text over it. I know the basic steps to print the text using win32print from Pywin32 but...: 1) I dont know how to add an image

Re: Multi-dimensional list initialization

2012-11-07 Thread MRAB
On 2012-11-07 05:05, Steven D'Aprano wrote: On Wed, 07 Nov 2012 00:23:44 +, MRAB wrote: Incorrect. Python uses what is commonly known as call-by-object, not call-by-value or call-by-reference. Passing the list by value would imply that the list is copied, and that appends or removes to

Re: Pickling a dictionary

2012-11-07 Thread Devashish Tyagi
On Wednesday, 7 November 2012 21:57:05 UTC+5:30, Peter Otten wrote: Devashish Tyagi wrote: So I want to store the current state of a InteractiveInterpreter Object in database. In order to achieve this I tried this obj = InteractiveInterpreter() local = obj.locals()

Re: Pickling a dictionary

2012-11-07 Thread Ian Kelly
On Wed, Nov 7, 2012 at 10:40 AM, Devashish Tyagi devashishroc...@gmail.com wrote: Here is the code from code import InteractiveInterpreter import StringIO import pickle src = StringIO.StringIO() inter = InteractiveInterpreter() inter.runcode('a = 5') local = inter.locals

Re: Printing a text over an image

2012-11-07 Thread Laurent Pointal
Martha Morrigan wrote: 3) Any more simple approach or module to deals with printers (paper and/or pdf) will be welcome. For pdf, you can take a look at ReportLab's Toolkit. I used it to build a trombinoscope (ie an employee directory with each member's photo on top of his name and room

Re: creating size-limited tar files

2012-11-07 Thread Neil Cerutti
On 2012-11-07, andrea crotti andrea.crott...@gmail.com wrote: Simple problem, given a lot of data in many files/directories, I should create a tar file splitted in chunks = a given size. The simplest way would be to compress the whole thing and then split. At the moment the actual script

Re: creating size-limited tar files

2012-11-07 Thread Alexander Blinne
I don't know the best way to find the current size, I only have a general remark. This solution is not so good if you have to impose a hard limit on the resulting file size. You could end up having a tar file of size limit + size of biggest file - 1 + overhead in the worst case if the tar is at

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
Hi IAN! On 11/06/2012 03:52 PM, Ian Kelly wrote: On Tue, Nov 6, 2012 at 3:41 PM, Andrew Robinson The objection is not nonsense; you've merely misconstrued it. If [[1,2,3]] * 4 is expected to create a mutable matrix of 1s, 2s, and 3s, then one would expect [[{}]] * 4 to create a mutable matrix

Re: creating size-limited tar files

2012-11-07 Thread Roy Smith
In article 509ab0fa$0$6636$9b4e6...@newsspool2.arcor-online.net, Alexander Blinne n...@blinne.net wrote: I don't know the best way to find the current size, I only have a general remark. This solution is not so good if you have to impose a hard limit on the resulting file size. You could end

Re: Multi-dimensional list initialization

2012-11-07 Thread Ian Kelly
On Wed, Nov 7, 2012 at 12:51 PM, Andrew Robinson andr...@r3dsolutions.com wrote: Interesting, you avoided the main point lists are copied with list multiplication. It seems that each post is longer than the last. If we each responded to every point made, this thread would fill a book. Anyway,

Re: creating size-limited tar files

2012-11-07 Thread Andrea Crotti
On 11/07/2012 08:32 PM, Roy Smith wrote: In article 509ab0fa$0$6636$9b4e6...@newsspool2.arcor-online.net, Alexander Blinne n...@blinne.net wrote: I don't know the best way to find the current size, I only have a general remark. This solution is not so good if you have to impose a hard limit

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
On 11/06/2012 05:55 PM, Steven D'Aprano wrote: On Tue, 06 Nov 2012 14:41:24 -0800, Andrew Robinson wrote: Yes. But this isn't going to cost any more time than figuring out whether or not the list multiplication is going to cause quirks, itself. Human psychology *tends* (it's a FAQ!) to

Read number of CSV files

2012-11-07 Thread Smaran Harihar
Hi Guys, I am able to read through a CSV File and fetch the data inside the CSV file but I have a really big list of CSV files and I wish to do the same particular code in all the CSV files. Is there some way that I can loops through all these files, which are in a single folder, and get my code

Re: Multi-dimensional list initialization

2012-11-07 Thread Joshua Landau
*Spoiler:* You've convinced me. On 7 November 2012 14:00, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 7 November 2012 13:39, Joshua Landau joshua.landau...@gmail.com wrote: On 7 November 2012 11:11, Oscar Benjamin oscar.j.benja...@gmail.com wrote: A more modest addition for the

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
On 11/06/2012 10:56 PM, Demian Brecht wrote: My question was *not* based on what I perceive to be intuitive (although most of this thread has now seemed to devolve into that and become more of a philosophical debate), but was based on what I thought may have been inconsistent behaviour (which

Right solution to unicode error?

2012-11-07 Thread Anders
I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them as a list of objects without a hitch. But when I try to print the

Re: Multi-dimensional list initialization

2012-11-07 Thread Mark Lawrence
On 07/11/2012 22:02, Andrew Robinson wrote: You're doing extremely well, you've overtaken Xah Lee as the biggest waste of space on this list. -- Cheers. Mark Lawrence. -- http://mail.python.org/mailman/listinfo/python-list

Re: Read number of CSV files

2012-11-07 Thread Adnan Sadzak
Maybe os.listdir() can help You, and then go through files and do whatever You want. On Wed, Nov 7, 2012 at 11:11 PM, Smaran Harihar smaran.hari...@gmail.comwrote: Hi Guys, I am able to read through a CSV File and fetch the data inside the CSV file but I have a really big list of CSV files

Re: Multi-dimensional list initialization

2012-11-07 Thread Steven D'Aprano
On Wed, 07 Nov 2012 17:17:02 +, MRAB wrote: The disadvantage of calling it call by ... is that it suggests that you're just talking about calling functions. *shrug* There are already two synonyms for this, call by ... and pass by They are old, venerable terms dating back to Algol

Re: Multi-dimensional list initialization

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 22:16, Joshua Landau joshua.landau...@gmail.com wrote: On 7 November 2012 14:00, Oscar Benjamin oscar.j.benja...@gmail.com wrote: On 7 November 2012 13:39, Joshua Landau joshua.landau...@gmail.com wrote: On 7 November 2012 11:11, Oscar Benjamin oscar.j.benja...@gmail.com

RE: Right solution to unicode error?

2012-11-07 Thread Prasad, Ramit
Anders wrote: I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them as a list of objects without a hitch. But when I

Re: [Python-ideas] sys.py3k

2012-11-07 Thread Chris Angelico
On Thu, Nov 8, 2012 at 5:35 AM, anatoly techtonik techto...@gmail.com wrote: I thought of sys.py3k check as an explicit way to guard the code that should be maintained extra carefully for Python 3 compatibility, so that you can grep the source for this constant and remove all the hacks (such as

Invalid syntax

2012-11-07 Thread Smaran Harihar
Hi guys, I am stuck in one of those non identifiable error location in the code. The code keeps giving invalid syntax. This is my codehttp://dpaste.com/826792/ . I am using the same code for another code and not sure why this is not working. This is the traceback http://dpaste.com/826793/ that I

Re: creating size-limited tar files

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 21:52, Andrea Crotti andrea.crott...@gmail.com wrote: On 11/07/2012 08:32 PM, Roy Smith wrote: In article 509ab0fa$0$6636$9b4e6...@newsspool2.arcor-online.net, Alexander Blinne n...@blinne.net wrote: I don't know the best way to find the current size, I only have a

Re: Invalid syntax

2012-11-07 Thread Demian Brecht
On 2012-11-07, at 3:17 PM, Smaran Harihar smaran.hari...@gmail.com wrote: Any idea where am I going wrong? Looks like you're missing a closing parenthesis: w.record(collection[i][0], MAT[0], TSD[0], AnnTMin[0], ANNPREC[0], float(collection[i][2]), float(collection[i][1]) should be

Re: Invalid syntax

2012-11-07 Thread R. Michael Weylandt
On Wed, Nov 7, 2012 at 11:17 PM, Smaran Harihar smaran.hari...@gmail.com wrote: Hi guys, I am stuck in one of those non identifiable error location in the code. The code keeps giving invalid syntax. This is my code. I am using the same code for another code and not sure why this is not

Re: Right solution to unicode error?

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 22:17, Anders aschneider...@asha.org wrote: Traceback (most recent call last): File outlook_tasks.py, line 66, in module my_tasks.dump_today_tasks() File C:\Users\Anders\code\Task List\tasks.py, line 29, in dump_today_tasks print task.subject

Re: Invalid syntax

2012-11-07 Thread Roy Smith
In article mailman.3404.1352330555.27098.python-l...@python.org, Demian Brecht demianbre...@gmail.com wrote: On 2012-11-07, at 3:17 PM, Smaran Harihar smaran.hari...@gmail.com wrote: Any idea where am I going wrong? Looks like you're missing a closing parenthesis: What I find is useful in

Re: Multi-dimensional list initialization

2012-11-07 Thread Ian Kelly
On Wed, Nov 7, 2012 at 3:02 PM, Andrew Robinson andr...@r3dsolutions.com wrote: Draw up some use cases for the multiplication operator (I'm calling on your experience, let's not trust mine, right?); What are all the Typical ways people *Do* to use it now? If those use cases do not

Re: Right solution to unicode error?

2012-11-07 Thread Andrew Berg
On 2012.11.07 17:27, Oscar Benjamin wrote: Are you using cmd.exe (standard Windows terminal)? If so, it does not support unicode Actually, it does. Code page 65001 is UTF-8. I know that doesn't help the OP since Python versions below 3.3 don't support cp65001, but I think it's important to point

Re: Right solution to unicode error?

2012-11-07 Thread Steven D'Aprano
On Wed, 07 Nov 2012 14:17:42 -0800, Anders wrote: I've run into a Unicode error, and despite doing some googling, I can't figure out the right way to fix it. I have a Python 2.6 script that reads my Outlook 2010 task list. I'm able to read the tasks from Outlook and store them as a list of

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
On 11/07/2012 05:39 AM, Joshua Landau wrote: On 7 November 2012 11:11, Oscar Benjamin wrote: On Nov 7, 2012 5:41 AM, Gregory Ewing wrote: If anything is to be done in this area, it would be better as an extension of list comprehensions, e.g. [[None times 5]

Re: [Python-ideas] sys.py3k

2012-11-07 Thread Steven D'Aprano
On Thu, 08 Nov 2012 10:14:35 +1100, Chris Angelico wrote: On Thu, Nov 8, 2012 at 5:35 AM, anatoly techtonik techto...@gmail.com wrote: I thought of sys.py3k check ... Chris, you regularly reply to the wrong mailing list, and you've just done it again. This is not python-ideas. -- Steven

Re: [Python-ideas] sys.py3k

2012-11-07 Thread Chris Angelico
On Thu, Nov 8, 2012 at 10:56 AM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Thu, 08 Nov 2012 10:14:35 +1100, Chris Angelico wrote: On Thu, Nov 8, 2012 at 5:35 AM, anatoly techtonik techto...@gmail.com wrote: I thought of sys.py3k check ... Chris, you regularly reply to

Re: Invalid syntax

2012-11-07 Thread Smaran Harihar
Thanks a lot guys. Seriously when u get stuck on such issues it really drives u nuts and that is when this awesome comes to the rescue. This python mailing list rocks. On Wed, Nov 7, 2012 at 4:31 PM, Roy Smith r...@panix.com wrote: In article

Re: Multi-dimensional list initialization

2012-11-07 Thread Steven D'Aprano
Andrew, it appears that your posts are being eaten or rejected by my ISP's news server, because they aren't showing up for me. Possibly a side- effect of your dates being in the distant past? So if you have replied to any of my posts, I haven't seen them. In any case, I wanted to ask a

Issues with python/libtcod

2012-11-07 Thread Graham Fielding
Hey, all. I'm trying to program a roguelike, using the wonderful tutorials written by João F. Henriques (a.k.a. Jotaf), but I've stumbled onto a bit of a problem setting up the game's inventory system, and I was hoping someone could help me out. Here's a code snippet, including the affected

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
On 11/07/2012 01:01 PM, Ian Kelly wrote: On Wed, Nov 7, 2012 at 12:51 PM, Andrew Robinson andr...@r3dsolutions.com wrote: Interesting, you avoided the main point lists are copied with list multiplication. It seems that each post is longer than the last. If we each responded to every point

Re: Multi-dimensional list initialization

2012-11-07 Thread Oscar Benjamin
On 8 November 2012 00:00, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Andrew, it appears that your posts are being eaten or rejected by my ISP's news server, because they aren't showing up for me. Possibly a side- effect of your dates being in the distant past? So if you have

Re: Right solution to unicode error?

2012-11-07 Thread Oscar Benjamin
On 7 November 2012 23:51, Andrew Berg bahamutzero8...@gmail.com wrote: On 2012.11.07 17:27, Oscar Benjamin wrote: Are you using cmd.exe (standard Windows terminal)? If so, it does not support unicode Actually, it does. Code page 65001 is UTF-8. I know that doesn't help the OP since Python

Re: Multi-dimensional list initialization

2012-11-07 Thread Joshua Landau
On 7 November 2012 23:55, Andrew Robinson andr...@r3dsolutions.com wrote: On 11/07/2012 05:39 AM, Joshua Landau wrote: A more modest addition for the limited case described in this thread could be to use exponentiation: [0] ** (2, 3) [[0, 0, 0], [0, 0, 0]] I'm against over using the

Re: Multi-dimensional list initialization

2012-11-07 Thread Greg Ewing
On 08/11/12 12:06, Oscar Benjamin wrote: On 7 November 2012 22:16, Joshua Landaujoshua.landau...@gmail.com wrote: That said, losing: [0] * (2, 3) == [0] * [2, 3] would mean losing duck-typing in general. There are precedents for this kind of thing; the string % operator treats tuples

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
On 11/07/2012 03:39 PM, Ian Kelly wrote: Why? Just to get rid of an FAQ? :-) Here's one of the more interesting uses from my own code: OK, and is this a main use case? (I'm not saying it isn't I'm asking.) Replacing the list multiplication in that function with a list comprehension would

Re: Multi-dimensional list initialization

2012-11-07 Thread Steven D'Aprano
On Thu, 08 Nov 2012 00:30:53 +, Oscar Benjamin wrote: Every now and again I come across somebody who tries to distinguish between call by foo and pass by foo, but nobody has been able to explain the difference (if any) to me. When you CALL a function, you PASS values to it. Hence the two

Re: Multi-dimensional list initialization

2012-11-07 Thread Steven D'Aprano
On Wed, 07 Nov 2012 16:24:22 -0800, Andrew Robinson wrote: On 11/07/2012 01:01 PM, Ian Kelly wrote: [...] Anyway, your point was to suggest that people would not be confused by having list multiplication copy lists but not other objects, because passing lists into functions as parameters

Re: Multi-dimensional list initialization

2012-11-07 Thread Andrew Robinson
On 11/07/2012 04:00 PM, Steven D'Aprano wrote: Andrew, it appears that your posts are being eaten or rejected by my ISP's news server, because they aren't showing up for me. Possibly a side- effect of your dates being in the distant past? Date has been corrected since two days ago. It will

Re: how-to use readline.set_completion_display_matches_hook()?

2012-11-07 Thread Jean-Pierre Miceli
Thanks, I will try rl. Have a nice day J-P Le 7 nov. 2012 à 14:14, Stefan H. Holek a écrit : On 07.11.2012, at 11:36, Jean-Pierre Miceli wrote: Hi all, I'm working on a tool which enable support of tab completion using the readline modul. And I have a problem with

Re: Multi-dimensional list initialization

2012-11-07 Thread Ian Kelly
On Wed, Nov 7, 2012 at 8:13 PM, Andrew Robinson andr...@r3dsolutions.com wrote: OK, and is this a main use case? (I'm not saying it isn't I'm asking.) I have no idea what is a main use case. There is a special keyword which signals the new type of comprehension; A normal comprehension would

Re: get weekday as week number in a month

2012-11-07 Thread Ian Kelly
On Thu, Nov 8, 2012 at 12:09 AM, Nikhil Verma varma.nikhi...@gmail.com wrote: What i want to know is if i convert it to date_object = datetime.strptime(' Friday November 9 2012 11:30PM', '%u %B %d %Y %I:%M%p' ) It is giving me ValueError saying u is unsupported directive ! Use '%A' to match

Re: Immutability and Python

2012-11-07 Thread Thomas Rachel
Am 29.10.2012 16:20 schrieb andrea crotti: Now on one hand I would love to use only immutable data in my code, but on the other hand I wonder if it makes so much sense in Python. You can have both. Many mutable types distinguish between them with their operators. To pick up your example,

[issue15001] segmentation fault with del sys.module['__main__']

2012-11-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset b256d054f229 by Hynek Schlawack in branch '3.2': Issue #15001: fix segfault on del sys.module['__main__'] http://hg.python.org/cpython/rev/b256d054f229 New changeset 215297665098 by Hynek Schlawack in branch '3.3': Issue #15001: fix segfault on del

[issue15001] segmentation fault with del sys.modules['__main__']

2012-11-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- title: segmentation fault with del sys.module['__main__'] - segmentation fault with del sys.modules['__main__'] ___ Python tracker rep...@bugs.python.org

[issue14621] Hash function is not randomized properly

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Here's a demo patch (against Python 2.7) which counts hash value collisions and slot collisions. I had posted that in the original ticket where we discussed the hash problem (http://bugs.python.org/issue14621). This avoids issues like attack 1 mentioned

[issue16413] Non cross-platform behavior of os.path.split

2012-11-07 Thread anatoly techtonik
anatoly techtonik added the comment: I don't know about the differences. An expert is required. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16413 ___

[issue14621] Hash function is not randomized properly

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 09:34, Marc-Andre Lemburg wrote: Here's a demo patch (against Python 2.7) which counts hash value collisions and slot collisions. I had posted that in the original ticket where we discussed the hash problem

[issue14621] Hash function is not randomized properly

2012-11-07 Thread Giovanni Bajo
Giovanni Bajo added the comment: Until it's broken with a yet-unknown attack, SipHash is a pseudo-random function and as such it does uniformly distribute values across the output space, and never leak any information on the key (the randomized seed). Being designed by cryptographers, it is

[issue16420] PEP 249 (DB-API 2.0) converted to reStructuredText

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: For some reason, the roundup bot didn't pick up the check in, so here's the reference by hand: http://hg.python.org/peps/rev/95a73d5a3af7 changeset: 4578:95a73d5a3af7 user:Marc-Andre Lemburg m...@egenix.com date:Wed Nov 07 09:42:07 2012

[issue16420] PEP 249 (DB-API 2.0) converted to reStructuredText

2012-11-07 Thread Marc-Andre Lemburg
Changes by Marc-Andre Lemburg m...@egenix.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16420 ___ ___

[issue15001] segmentation fault with del sys.modules['__main__']

2012-11-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4ebe1ede981e by Hynek Schlawack in branch '2.7': Issue #15001: fix segfault on del sys.modules['__main__'] http://hg.python.org/cpython/rev/4ebe1ede981e -- ___ Python tracker rep...@bugs.python.org

[issue15001] segmentation fault with del sys.modules['__main__']

2012-11-07 Thread Hynek Schlawack
Hynek Schlawack added the comment: This should be fixed now, thanks to all who helped! -- resolution: - fixed stage: commit review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15001

[issue16425] minidom replaceChild(new_child, old_child) removes new_child even if in another document

2012-11-07 Thread Martin Kugler
New submission from Martin Kugler: Calling doc.replaceChild(new_child, old_child) with new_child and old_child being similar nodes in two different documents results in new_child to be removed from its document instead of old_child being removed from doc. Example: new_child =

[issue16422] Decimal constants should be the same for py c module versions

2012-11-07 Thread Stefan Krah
Stefan Krah added the comment: It would be possible to translate strings to integers; the infrastructure is already there for pickling. The decision not to do that was actually deliberate: Up to now no one has requested string constants for rounding modes and I *suspect* that there's a

[issue16421] importlib.machinery.ExtensionFileLoader cannot load several modules from the same shared object

2012-11-07 Thread Václav Šmilauer
Václav Šmilauer added the comment: Attaching patch based on Andrew's review, agains latest hg (80291:859ef54bdce). For the MSVC files, I copied what was there for _testcapimodule in PC/VS9.0 and PCbuild, and created two new UUIDs: one for _testimportmultiple itself

[issue16424] regression: os.path.split('//hostname/foo/bar.txt')

2012-11-07 Thread anatoly techtonik
anatoly techtonik added the comment: Does that mean that Py3's split() uses splitunc() instead of splitdrive()? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16424 ___

[issue16424] regression: os.path.split('//hostname/foo/bar.txt')

2012-11-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: No. splitunc() is deprecated. http://docs.python.org/3/library/os.path.html#os.path.splitdrive http://docs.python.org/3/library/os.path.html#os.path.splitunc -- ___ Python tracker rep...@bugs.python.org

[issue16424] regression: os.path.split('//hostname/foo/bar.txt')

2012-11-07 Thread anatoly techtonik
anatoly techtonik added the comment: Ok, so how to fix the regression? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16424 ___ ___

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
New submission from Marc-Andre Lemburg: As discussed on http://psf.upfronthosting.co.za/roundup/meta/issue491, I'm creating this ticket to test the roundup email interface. -- assignee: lemburg components: None messages: 175063 nosy: lemburg priority: normal severity: normal status:

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:33, Marc-Andre Lemburg wrote: New submission from Marc-Andre Lemburg: As discussed on http://psf.upfronthosting.co.za/roundup/meta/issue491, I'm creating this ticket to test the roundup email interface. Email reply 1. --

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:34, M.-A. Lemburg wrote: On 07.11.2012 11:33, Marc-Andre Lemburg wrote: New submission from Marc-Andre Lemburg: As discussed on http://psf.upfronthosting.co.za/roundup/meta/issue491, I'm creating this ticket to test the roundup email

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:34, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:34, M.-A. Lemburg wrote: On 07.11.2012 11:33, Marc-Andre Lemburg wrote: New submission from Marc-Andre Lemburg: As discussed on

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, M.-A. Lemburg wrote: On 07.11.2012 11:34, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:34, M.-A. Lemburg wrote: On 07.11.2012 11:33, Marc-Andre Lemburg wrote: New submission from Marc-Andre

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, M.-A. Lemburg wrote: On 07.11.2012 11:34, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:34, M.-A. Lemburg

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:36, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, M.-A. Lemburg wrote: On 07.11.2012 11:34, Marc-Andre

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:37, M.-A. Lemburg wrote: On 07.11.2012 11:36, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, M.-A. Lemburg

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:38, M.-A. Lemburg wrote: On 07.11.2012 11:37, M.-A. Lemburg wrote: On 07.11.2012 11:36, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:35, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:39, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:38, M.-A. Lemburg wrote: On 07.11.2012 11:37, M.-A. Lemburg wrote: On 07.11.2012 11:36, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:41, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:39, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:38, M.-A. Lemburg wrote: On 07.11.2012 11:37, M.-A. Lemburg

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:42, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:41, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:39, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the

[issue16426] RoundUp signature removal test (please ignore)

2012-11-07 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 07.11.2012 11:43, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:42, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the comment: On 07.11.2012 11:41, Marc-Andre Lemburg wrote: Marc-Andre Lemburg added the

  1   2   >