ANN: Python Tools for Visual Studio 1.1 Beta 1

2011-12-08 Thread Dino Viehland
We're pleased to announce the release of Python Tools for Visual Studio 1.1 Beta ( http://pytools.codeplex.com/releases/view/76089 ). Python Tools for Visual Studio (PTVS) is an open-source plug-in for Visual Studio which supports programming with the Python programming language. This release

Cornice 0.4 released

2011-12-08 Thread Tarek Ziadé
Hey, We've released Cornice 0.4. Cornice provides helpers to build document REST-ish Web Services with Pyramid This version has multiple new features like a request validation system and a nice errors handling system. The later let your web services return a JSON on all 400s with a structured

Re: Insert trusted timestamp to PDF

2011-12-08 Thread Hegedüs , Ervin
hello, On Wed, Dec 07, 2011 at 11:39:20PM -0800, marco.ru...@gmail.com wrote: Hi, take a look at this online tool: http://easytimestamping.com I need to create the PDF on my server - it could be any online service, but it must to have any kind of API. It is able to apply RFC3161 compliant

Re: I love the decorator in Python!!!

2011-12-08 Thread Chris Rebert
On Wed, Dec 7, 2011 at 11:18 PM, 8 Dihedral dihedral88...@googlemail.com wrote: I use the @ decorator to behave exactly like a c macro that does have fewer side effects. I am wondering is there other interesting methods to do the jobs in Python? * Class decorators

Re: Dynamic variable creation from string

2011-12-08 Thread Jussi Piitulainen
Terry Reedy writes: On 12/7/2011 7:03 PM, Steven D'Aprano wrote: On Wed, 07 Dec 2011 09:09:16 -0800, Massi wrote: Is there a way to create three variables dynamically inside Sum in order to re write the function like this? I should have mentioned in my earlier response that 'variable'

Re: I love the decorator in Python!!!

2011-12-08 Thread Thomas Rachel
Am 08.12.2011 08:18 schrieb 8 Dihedral: I use the @ decorator to behave exactly like a c macro that does have fewer side effects. I am wondering is there other interesting methods to do the jobs in Python? In combination with a generator, you can do many funny things. For example, you

Re: order independent hash?

2011-12-08 Thread Hrvoje Niksic
Tim Chase python.l...@tim.thechases.com writes: From an interface perspective, I suppose it would work. However one of the main computer-science reasons for addressing by a hash is to get O(1) access to items (modulo pessimal hash structures/algorithms which can approach O(N) if everything

how to test attribute existence of feedparser objects

2011-12-08 Thread HansPeter
Hi, While using the feedparser library for downloading RSS feeds some of the blog entries seem to have no title. File build\bdist.win32\egg\feedparser.py, line 382, in __getattr__ AttributeError: object has no attribute 'title' Is there a way to test the existence of an attribute? I can use

Re: I love the decorator in Python!!!

2011-12-08 Thread Chris Angelico
On Thu, Dec 8, 2011 at 7:59 PM, Thomas Rachel nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa...@spamschutz.glglgl.de wrote: Many other things are thinkable... And many more are unthinkable. Can we start an International Obfuscated Python Code Contest? It's the only place such... abhorrences can

mrjob v0.3.0 released

2011-12-08 Thread Jimmy Retzlaff
What is mrjob? --- mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster.

Re: how to test attribute existence of feedparser objects

2011-12-08 Thread Chris Rebert
On Thu, Dec 8, 2011 at 1:34 AM, HansPeter hanspeter.sl...@gmail.com wrote: Hi, While using the feedparser library for downloading RSS feeds some of the blog entries seem to have no title.  File build\bdist.win32\egg\feedparser.py, line 382, in __getattr__ AttributeError: object has no

Re: Insert trusted timestamp to PDF

2011-12-08 Thread marco . rucci
On Thursday, December 8, 2011 8:59:31 AM UTC+1, Hegedüs, Ervin wrote: The timestamp is applied to the pdf in detached mode (i.e. as a separate .tsr file) I'm afraid that's not good for us - we need to propagate PDF files in enbedded mode. I'll do some research and let you know if it is

Re: Questions about LISP and Python.

2011-12-08 Thread Andrea Crotti
On 12/08/2011 04:10 AM, Rick Johnson wrote: ... Why has GvR not admonished the atrocious behavior of some people in this community? Why has GvR not admitted publicly the hideous state of IDLE and Tkinter? Where is the rally call? Where is the community spirit? The future of Pythin is in your

Re: Questions about LISP and Python.

2011-12-08 Thread Chris Angelico
On Thu, Dec 8, 2011 at 10:10 PM, Andrea Crotti andrea.crott...@gmail.com wrote: Supposing even that Guido resigns, why do you think that the power should go to you? Power is not something that you can claim for, you have to earn the right, and ranting doesn't normally buy anything ;) Power

Re: I love the decorator in Python!!!

2011-12-08 Thread K . -Michael Aye
On 2011-12-08 08:59:26 +, Thomas Rachel said: Am 08.12.2011 08:18 schrieb 8 Dihedral: I use the @ decorator to behave exactly like a c macro that does have fewer side effects. I am wondering is there other interesting methods to do the jobs in Python? In combination with a

Re: Questions about LISP and Python.

2011-12-08 Thread Matt Joiner
Guido is too busy secretly pouring his cruelty and malice into a master ring to answer trolls. Help yourself to a lesser ring on your way out. On Dec 8, 2011 10:14 PM, Andrea Crotti andrea.crott...@gmail.com wrote: On 12/08/2011 04:10 AM, Rick Johnson wrote: ... Why has GvR not admonished

sending a variable to an imported module

2011-12-08 Thread Bastien Semene
Hi list, I'm trying to pass a variable to an imported module without singletons. I've seen in the doc, and tested that I can't use global to do it : === module.py === def testf(): print test === main.py === global test test = 1 imported_module = __import__(module, globals(), locals(), [],

Re: I love the decorator in Python!!!

2011-12-08 Thread Chris Angelico
On Thu, Dec 8, 2011 at 10:22 PM, K.-Michael Aye kmichael@gmail.com wrote: I am still perplexed about decorators though, am happily using Python for many years without them, but maybe i am missing something? For example in the above case, if I want the names attached to each other with a

Re: sending a variable to an imported module

2011-12-08 Thread Arnaud Delobelle
On 8 December 2011 11:28, Bastien Semene bsem...@cyanide-studio.com wrote: Hi list, I'm trying to pass a variable to an imported module without singletons. I've seen in the doc, and tested that I can't use global to do it : === module.py === def testf():  print test === main.py ===

Re: sending a variable to an imported module

2011-12-08 Thread Dave Angel
On 12/08/2011 06:28 AM, Bastien Semene wrote: Hi list, I'm trying to pass a variable to an imported module without singletons. I've seen in the doc, and tested that I can't use global to do it : === module.py === def testf(): print test === main.py === global test test = 1 imported_module

Re: sending a variable to an imported module

2011-12-08 Thread Bastien Semene
Thanks both, Putting the variable inside a module works well. As the content is an object created inside another module I'm using this trick : module.CONFIG = module.load() So the variable is handled by the module that creates/use it, easy to use and pretty native to understand. Le

Documentation using Sphinx

2011-12-08 Thread sajuptpm
Hi, I am trying source code documentation using Sphinx. Here i have to copy paste all modules in to *.rst file, that is painful. Have any way to create documentation (doc for all modules, classes and methods in the project directory) from project folder quickly. I also plannig to add a code

Misleading error message of the day

2011-12-08 Thread Roy Smith
I just spent a while beating my head against this one. # Python 2.6 a, b = 'foo' Traceback (most recent call last): File stdin, line 1, in module ValueError: too many values to unpack The real problem is that there's too *few* values to unpack! It should have been a, b = 'foo', 'bar' I

Re: Misleading error message of the day

2011-12-08 Thread Andrea Crotti
On 12/08/2011 02:23 PM, Roy Smith wrote: I just spent a while beating my head against this one. # Python 2.6 a, b = 'foo' Traceback (most recent call last): File stdin, line 1, inmodule ValueError: too many values to unpack The real problem is that there's too *few* values to unpack! It

Re: Misleading error message of the day

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 1:23 AM, Roy Smith r...@panix.com wrote: I just spent a while beating my head against this one. # Python 2.6 a, b = 'foo' Traceback (most recent call last):  File stdin, line 1, in module ValueError: too many values to unpack Definitely weird! I smell a job for a

Re: Misleading error message of the day

2011-12-08 Thread Robert Kern
On 12/8/11 2:23 PM, Roy Smith wrote: I just spent a while beating my head against this one. # Python 2.6 a, b = 'foo' Traceback (most recent call last): File stdin, line 1, inmodule ValueError: too many values to unpack The real problem is that there's too *few* values to unpack! It

Re: Misleading error message of the day

2011-12-08 Thread Jean-Michel Pichavant
Roy Smith wrote: I just spent a while beating my head against this one. # Python 2.6 a, b = 'foo' Traceback (most recent call last): File stdin, line 1, in module ValueError: too many values to unpack The real problem is that there's too *few* values to unpack! It should have

Re: Documentation using Sphinx

2011-12-08 Thread Andrea Crotti
On 12/08/2011 02:09 PM, sajuptpm wrote: Hi, I am trying source code documentation using Sphinx. Here i have to copy paste all modules in to *.rst file, that is painful. Have any way to create documentation (doc for all modules, classes and methods in the project directory) from project folder

Re: Misleading error message of the day

2011-12-08 Thread Heiko Wundram
Am 08.12.2011 15:47, schrieb Robert Kern: Would including the respective numbers help your thought processes? ValueError: too many values to unpack (expected 2, got 3) Not possible in the general case (as the right-hand side might be an arbitrary iterable/iterator...). -- --- Heiko. --

Re: Misleading error message of the day

2011-12-08 Thread Roy Smith
On Thursday, December 8, 2011 9:47:02 AM UTC-5, Robert Kern wrote: Would including the respective numbers help your thought processes? ValueError: too many values to unpack (expected 2, got 3) I don't know if that would have done the trick for me on this particular one. On the other hand,

Re: Misleading error message of the day

2011-12-08 Thread Roy Smith
On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: string are iterable, considering this, the error is correct. Yes, I understand that the exception is correct. I'm not saying the exception should be changed, just that we have the opportunity to produce a more useful

Re: Misleading error message of the day

2011-12-08 Thread Roy Smith
On Thursday, December 8, 2011 10:16:56 AM UTC-5, Heiko Wundram wrote: Am 08.12.2011 15:47, schrieb Robert Kern: Would including the respective numbers help your thought processes? ValueError: too many values to unpack (expected 2, got 3) Not possible in the general case (as the right-hand

Re: Misleading error message of the day

2011-12-08 Thread Heiko Wundram
Am 08.12.2011 16:42, schrieb Roy Smith: The exception was raised when i() returned it's third value, so saying expected 2, got 3 is exactly correct. Yes, it is true that it might have gotten more if it kept going, but that's immaterial; the fact that it got to 3 is what caused the Holy Hand

Re: Misleading error message of the day

2011-12-08 Thread Andrea Crotti
On 12/08/2011 03:42 PM, Roy Smith wrote: Why not? Take this example: def i(): i = 0 while True: print returning:, i yield i i += 1 a, b = i() ./iter.py returning: 0 returning: 1 returning: 2 Traceback (most recent call last): File ./iter.py, line 10,

Re: Misleading error message of the day

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 2:55 AM, Andrea Crotti andrea.crott...@gmail.com wrote: Yes but how do you know how many values you generated when it quits? I mean I don't know how it work internally, but it should keep a temporary list of the yielded values to be able to find out how many values are

Re: Need some IPC pointers

2011-12-08 Thread Lie Ryan
On 12/01/2011 08:03 AM, Andrew Berg wrote: I've done some research, but I'm not sure what's most appropriate for my situation. What I want to do is have a long running process that spawns processes (that aren't necessarily written in Python) and communicates with them. The children can be

Re: I love the decorator in Python!!!

2011-12-08 Thread K . -Michael Aye
On 2011-12-08 11:43:12 +, Chris Angelico said: On Thu, Dec 8, 2011 at 10:22 PM, K.-Michael Aye kmichael@gmail.com wrote: I am still perplexed about decorators though, am happily using Python for many years without them, but maybe i am missing something? For example in the above case,

adding elements to set

2011-12-08 Thread Andrea Crotti
I've wasted way too much time for this, which is surely not a Python bug, not something that surprised me a lot. I stupidly gave for granted that adding an object to a set would first check if there are equal elements inside, and then add it. As shown below this is not clearly the case.. Is it

Re: I love the decorator in Python!!!

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 3:24 AM, K.-Michael Aye kmichael@gmail.com wrote: I understand this one, it seems really useful. And maybe i start to sense some more applicability. Like this, with extra flags that could be set at run time, I could influence the way a function is executed without

Re: adding elements to set

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 3:34 AM, Andrea Crotti andrea.crott...@gmail.com wrote: I've wasted way too much time for this, which is surely not a Python bug, not something that surprised me a lot. I stupidly gave for granted that adding an object to a set would first check if there are equal

Re: adding elements to set

2011-12-08 Thread Peter Otten
Andrea Crotti wrote: I've wasted way too much time for this, which is surely not a Python bug, not something that surprised me a lot. I stupidly gave for granted that adding an object to a set would first check if there are equal elements inside, and then add it. As shown below this is

Re: I love the decorator in Python!!!

2011-12-08 Thread Andrew Berg
On 12/8/2011 10:38 AM, Chris Angelico wrote: One piece of sophistication that I would rather like to see, but don't know how to do. Instead of *args,**kwargs, is it possible to somehow copy in the function's actual signature? I remember seeing this in a PEP that is planned to be implemented in

Re: I love the decorator in Python!!!

2011-12-08 Thread Andrew Berg
Decorators are great for adding common functionality to several functions without duplicating code. For example, I have one for my IRC bot that checks that the person sending the command is authorized to use the command. It's only if mask in owner list then execute function else say access denied,

Re: adding elements to set

2011-12-08 Thread Peter Otten
Chris Angelico wrote: It checks for equality using hashes. By default, in Python 2, objects' hashes are their ids - meaning that no two of them hash alike, and you'll get duplicates in your set. (In Python 3, the default appears to be that they're unhashable and hence can't go into the set at

Re: adding elements to set

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 4:32 AM, Peter Otten __pete...@web.de wrote: The only thing that has changed (in 2.7) is the algorithm to calculate the hash value. The bits are rotated to turn the four least significant bits into the most signicant ones. According to a comment in Objects/objects.c the

Re: I love the decorator in Python!!!

2011-12-08 Thread Ian Kelly
One piece of sophistication that I would rather like to see, but don't know how to do. Instead of *args,**kwargs, is it possible to somehow copy in the function's actual signature? I was testing this out in IDLE, and the fly help for the function no longer gave useful info about its argument

Re: Misleading error message of the day

2011-12-08 Thread Tim Chase
On 12/08/11 09:30, Roy Smith wrote: On Thursday, December 8, 2011 9:47:02 AM UTC-5, Robert Kern wrote: Would including the respective numbers help your thought processes? ValueError: too many values to unpack (expected 2, got 3) I don't know if that would have done the trick for me on this

Re: Questions about LISP and Python.

2011-12-08 Thread MRAB
On 08/12/2011 04:10, Rick Johnson wrote: [snip] I believe this community has a cancer. A cancer that is rotting us from the inside. A cancer that has metastasis and is spreading like wild fire. pedanticThe problem with a cancer is not that it rots, but that it grows uncontrollably./pedantic

Re: Misleading error message of the day

2011-12-08 Thread Grant Edwards
On 2011-12-08, Roy Smith r...@panix.com wrote: On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: string are iterable, considering this, the error is correct. Yes, I understand that the exception is correct. I'm not saying the exception should be changed, just

Re: Misleading error message of the day

2011-12-08 Thread Roy Smith
(some, very, long, list, of, variable, names, to, get, the, stuff, unpacked, into) = function_that_should_return_a_14_tuple() raises ValueError: too many values to unpack Quick, what's the bug? Did I forget a variable on the LHS, or is my function returning more things than it

Re: adding elements to set

2011-12-08 Thread Peter Otten
Chris Angelico wrote: On Fri, Dec 9, 2011 at 4:32 AM, Peter Otten __pete...@web.de wrote: The only thing that has changed (in 2.7) is the algorithm to calculate the hash value. The bits are rotated to turn the four least significant bits into the most signicant ones. According to a comment in

Re: adding elements to set

2011-12-08 Thread Duncan Booth
Chris Angelico ros...@gmail.com wrote: On Fri, Dec 9, 2011 at 4:32 AM, Peter Otten __pete...@web.de wrote: The only thing that has changed (in 2.7) is the algorithm to calculate the hash value. The bits are rotated to turn the four least significant bits into the most signicant ones.

Re: Misleading error message of the day

2011-12-08 Thread Benjamin Kaplan
On Thu, Dec 8, 2011 at 1:42 PM, Roy Smith r...@panix.com wrote: (some,  very,  long,  list,  of,  variable,  names,  to,  get,  the,  stuff,  unpacked,  into) = function_that_should_return_a_14_tuple() raises ValueError: too many values to unpack Quick, what's the bug?  Did I

Re: Misleading error message of the day

2011-12-08 Thread Ethan Furman
Benjamin Kaplan wrote: On Thu, Dec 8, 2011 at 1:42 PM, Roy Smith r...@panix.com wrote: (some, very, long, list, of, variable, names, to, get, the, stuff, unpacked, into) = function_that_should_return_a_14_tuple() raises ValueError: too many values to unpack Quick, what's the bug?

Re: Misleading error message of the day

2011-12-08 Thread Benjamin Kaplan
On Thu, Dec 8, 2011 at 2:09 PM, Ethan Furman et...@stoneleaf.us wrote: Benjamin Kaplan wrote: On Thu, Dec 8, 2011 at 1:42 PM, Roy Smith r...@panix.com wrote: (some,  very,  long,  list,  of,  variable,  names,  to,  get,  the,  stuff,  unpacked,  into) =

Re: Misleading error message of the day

2011-12-08 Thread Jean-Michel Pichavant
Roy Smith wrote: On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: string are iterable, considering this, the error is correct. Yes, I understand that the exception is correct. I'm not saying the exception should be changed, just that we have the

Sybase module 0.40pre2 released

2011-12-08 Thread Robert Boehne
WHAT IS IT: The Sybase module provides a Python interface to the Sybase relational database system. It supports all of the Python Database API, version 2.0 with extensions. Please downolad, test and report any problems with the pre-release. ** This version is a pre-release not intended for

Re: Misleading error message of the day

2011-12-08 Thread Robert Kern
On 12/8/11 4:21 PM, Chris Angelico wrote: On Fri, Dec 9, 2011 at 2:55 AM, Andrea Crottiandrea.crott...@gmail.com wrote: Yes but how do you know how many values you generated when it quits? I mean I don't know how it work internally, but it should keep a temporary list of the yielded values to

Numpy ndarray to C array

2011-12-08 Thread Enrico
I am trying to pass a multi-dimensional ndarray to C as a multi- dimensional C array for the purposes of passing it to mathematica. They already have a wrapper for a 1-D Python list. where the list is copied to list. Shown below: static PyObject * mathlink_PutIntegerList(mathlink_Link *self,

Re: Misleading error message of the day

2011-12-08 Thread Ethan Furman
Jean-Michel Pichavant wrote: You have to opportunity to not use unpacking anymore :o) There is a recent thread were the dark side of unpacking was exposed. Unpacking is a cool feautre for very small applications but should be avoided whenever possible otherwise. Which thread was that?

Python horks on WinXP path names

2011-12-08 Thread Eric
I'm running Python 2.7 on WinXP (ActiveState community version) and when I try to do this: if __name__ == '__main__': root = Tkinter.Tk() root.withdraw() fileNames = tkFileDialog.askopenfilenames() root.destroy() print fileNames # windows filename gets for fileName in

Re: Questions about LISP and Python.

2011-12-08 Thread Ben Finney
MRAB pyt...@mrabarnett.plus.com writes: GvR isn't our leader, we are his followers. There's a difference. :-) +1 QotW -- \ “Guaranteed to work throughout its useful life.” —packaging for | `\ clockwork toy, Hong Kong | _o__)

Re: Misleading error message of the day

2011-12-08 Thread Ethan Furman
Benjamin Kaplan wrote: On Thu, Dec 8, 2011 at 2:09 PM, Ethan Furman et...@stoneleaf.us wrote: Benjamin Kaplan wrote: If the RHS was a tuple or a list, yes you could know immediately. But unpacking works with any iterable, so it probably doesn't special-case lists and tuples. Iterables don't

Re: Python horks on WinXP path names

2011-12-08 Thread Ian Kelly
On Thu, Dec 8, 2011 at 1:16 PM, Eric einazaki...@yahoo.com wrote: I'm running Python 2.7 on WinXP (ActiveState community version) and when I try to do this: if __name__ == '__main__':    root = Tkinter.Tk()    root.withdraw()    fileNames = tkFileDialog.askopenfilenames()    root.destroy()

Re: Python horks on WinXP path names

2011-12-08 Thread Jerry Hill
On Thu, Dec 8, 2011 at 3:16 PM, Eric einazaki...@yahoo.com wrote: I'm running Python 2.7 on WinXP (ActiveState community version) and when I try to do this: if __name__ == '__main__': root = Tkinter.Tk() root.withdraw() fileNames = tkFileDialog.askopenfilenames()

Re: Misleading error message of the day

2011-12-08 Thread alister
On Thu, 08 Dec 2011 18:10:17 +, Grant Edwards wrote: On 2011-12-08, Roy Smith r...@panix.com wrote: On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: string are iterable, considering this, the error is correct. Yes, I understand that the exception is correct.

tracking variable value changes

2011-12-08 Thread Catherine Moroney
Hello, Is there a way to create a C-style pointer in (pure) Python so the following code will reflect the changes to the variable a in the dictionary x? For example: a = 1.0 b = 2.0 x = {a:a, b:b} x {'a': 1.0, 'b': 2.0} a = 100.0 x {'a': 1.0, 'b': 2.0} ## at this point, I would like

Re: Python horks on WinXP path names

2011-12-08 Thread Eric
On Dec 8, 2:43 pm, Ian Kelly ian.g.ke...@gmail.com wrote: On Thu, Dec 8, 2011 at 1:16 PM, Eric einazaki...@yahoo.com wrote: I'm running Python 2.7 on WinXP (ActiveState community version) and when I try to do this: if __name__ == '__main__':    root = Tkinter.Tk()    root.withdraw()  

Re: tracking variable value changes

2011-12-08 Thread Jerry Hill
On Thu, Dec 8, 2011 at 3:17 PM, Catherine Moroney catherine.m.moro...@jpl.nasa.gov wrote: Is there some way to rewrite the code above so the change of a from 1.0 to 100.0 is reflected in the dictionary. I would like to use simple datatypes such as floats, rather than numpy arrays or classes.

Re: Misleading error message of the day

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 7:58 AM, alister alister.w...@ntlworld.com wrote: not as useless as Keyboard Error press F1 to continue If it said press F1 to ignore then I would agree. This, however, is more akin to replace user and strike any key to continue, but more implicit. ChrisA --

Re: Numpy ndarray to C array

2011-12-08 Thread Robert Kern
On 12/8/11 7:56 PM, Enrico wrote: I am trying to pass a multi-dimensional ndarray to C as a multi- dimensional C array for the purposes of passing it to mathematica. They already have a wrapper for a 1-D Python list. where the list is copied to list. Shown below: I would like to create a

Re: tp_new, tp_alloc, tp_init

2011-12-08 Thread Gregory Ewing
Michael Hennebry wrote: I've been reading about writing extension types in C and am rather fuzzy about the relationship between tp_new, tp_alloc and tp_init. Most especially, why tp_new? It seems to me that tp_alloc and tp_init would be sufficient. tp_new and tp_init correspond to the Python

Re: How to get a correct entry in the menu for a Python application on Mac OS X

2011-12-08 Thread Gregory Ewing
Detlev Offenbach wrote: I am fairly new to Mac OS X and would like to know, what I have to do to make my Python application show the correct name in the menu bar. What did I do so far. I created an application package containing the .plist file with correct entries and a shell script, that

Re: tracking variable value changes

2011-12-08 Thread Ian Kelly
On Thu, Dec 8, 2011 at 1:17 PM, Catherine Moroney catherine.m.moro...@jpl.nasa.gov wrote: Hello, Is there a way to create a C-style pointer in (pure) Python so the following code will reflect the changes to the variable a in the dictionary x? For example: a = 1.0 b = 2.0 x = {a:a, b:b}

Re: tracking variable value changes

2011-12-08 Thread Ben Finney
Catherine Moroney catherine.m.moro...@jpl.nasa.gov writes: Is there a way to create a C-style pointer in (pure) Python so the following code will reflect the changes to the variable a in the dictionary x? No, Python doesn't do pointers. Rather, objects have references and that's how the

Re: tracking variable value changes

2011-12-08 Thread Arnaud Delobelle
On 8 December 2011 21:50, Ian Kelly ian.g.ke...@gmail.com wrote: You can get the same effect with a float by putting it in a container object and binding both variables to the same container objects rather than to the float directly.  Then, to change the value, change the contents of the

subprocess.Popen under windows 7

2011-12-08 Thread Frank van den Boom
Hello, i have something like this under windows 7: print(try command...) arglist = [PATH_TO_7ZIP,a, -sfx, archive_name, *, -r, -p,PASSWORD] p = subprocess.Popen(args=arglist, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=srcdir) output, error =

Re: I love the decorator in Python!!!

2011-12-08 Thread Ethan Furman
Chris Angelico wrote: One piece of sophistication that I would rather like to see, but don't know how to do. Instead of *args,**kwargs, is it possible to somehow copy in the function's actual signature? I was testing this out in IDLE, and the fly help for the function no longer gave useful info

Re: I love the decorator in Python!!!

2011-12-08 Thread Ethan Furman
Chris Angelico wrote: One piece of sophistication that I would rather like to see, but don't know how to do. Instead of *args,**kwargs, is it possible to somehow copy in the function's actual signature? I was testing this out in IDLE, and the fly help for the function no longer gave useful info

Re: Misleading error message of the day

2011-12-08 Thread Roy Smith
In article jbqui9$33c$1...@reader1.panix.com, Grant Edwards invalid@invalid.invalid wrote: On 2011-12-08, Roy Smith r...@panix.com wrote: On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: string are iterable, considering this, the error is correct. Yes, I

Re: Misleading error message of the day

2011-12-08 Thread Lie Ryan
On 12/09/2011 07:13 AM, Ethan Furman wrote: Jean-Michel Pichavant wrote: You have to opportunity to not use unpacking anymore :o) There is a recent thread were the dark side of unpacking was exposed. Unpacking is a cool feautre for very small applications but should be avoided whenever possible

ANN: Speedometer 2.4 - bandwidth and download monitor

2011-12-08 Thread Ian Ward
Announcing Speedometer 2.8 -- Speedometer home page: http://excess.org/speedometer/ Download: http://excess.org/speedometer/speedometer-2.8.tar.gz New in this release: - Added a linear scale option: -l. Best used in combination with -m

Re: Misleading error message of the day

2011-12-08 Thread Steven D'Aprano
On Thu, 08 Dec 2011 18:10:17 +, Grant Edwards wrote: On 2011-12-08, Roy Smith r...@panix.com wrote: On Thursday, December 8, 2011 10:03:38 AM UTC-5, Jean-Michel Pichavant wrote: string are iterable, considering this, the error is correct. Yes, I understand that the exception is correct.

Re: subprocess.Popen under windows 7

2011-12-08 Thread Lie Ryan
On 12/09/2011 09:41 AM, Frank van den Boom wrote: What can I do, to prevent pressing the return key? I didn't have Windows 7 right now, but that shouldn't happen with the code you've given; when trimming code for posting, you should check that the trimmed code still have the exact same

Re: adding elements to set

2011-12-08 Thread Terry Reedy
On 12/8/2011 1:54 PM, Duncan Booth wrote: Yes, the documentation describes this although I don't think anything highlights that it is a change from Python 2.x: [http://docs.python.org/py3k/reference/datamodel.html] The Python 3 docs are 're-based' on 3.0, with change notes going forward

[OT] Book authoring

2011-12-08 Thread Miki Tebeka
Greetings, Any recommendations for a book authoring system that supports the following: 1. Code examples (with syntax highlighting and line numbers) 2. Output HTML, PDF, ePub ... 3. Automatic TOC and index 4. Search (in HTML) - this is a nice to have Can I somehow use Sphinx? Thanks, -- Miki --

Re: Misleading error message of the day

2011-12-08 Thread Chris Angelico
On Fri, Dec 9, 2011 at 1:07 PM, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: I forget where I saw this, but somebody took a screen shot of an error message from a GUI application that said something like: A fatal error occurred: no error and then aborted the app. An errant

Re: Misleading error message of the day

2011-12-08 Thread Roy Smith
In article mailman.3464.1323402417.27778.python-l...@python.org, Chris Angelico ros...@gmail.com wrote: http://thedailywtf.com/Series/Error_0x27_d.aspx This is getting quite off-topic though. Getting off-topic, perhaps, but your comment really does bring some closure. When I was pondering

Re: I love the decorator in Python!!!

2011-12-08 Thread alex23
On Dec 9, 2:38 am, Chris Angelico ros...@gmail.com wrote: One piece of sophistication that I would rather like to see, but don't know how to do. Instead of *args,**kwargs, is it possible to somehow copy in the function's actual signature? I was testing this out in IDLE, and the fly help for

[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2011-12-08 Thread Stefan Krah
Changes by Stefan Krah stefan-use...@bytereef.org: -- nosy: +skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13441 ___ ___ Python-bugs-list

[issue5689] Support xz compression in tarfile module

2011-12-08 Thread Lars Gustäbel
Lars Gustäbel l...@gustaebel.de added the comment: For those who want to test it first, I post the current state of the patch here. It is ready for commit, there are no failing tests. If nobody objects, I will apply it this weekend. -- Added file:

[issue5689] Support xz compression in tarfile module

2011-12-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Some comments about 2011-12-08-tarfile-lzma.diff: elif self.buf.startswith(b\x5d\x00\x00\x80) or self.buf.startswith(b... Micro-optimization: you can use self.buf.startswith((b\x5d\x00\x00\x80, b\xfd7zXZ)) here. raise

[issue13441] TestEnUSCollation.test_strxfrm() fails on Solaris

2011-12-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: See also the issue #7442. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13441 ___

[issue7136] Idle File Menu Option Improvement

2011-12-08 Thread maniram maniram
maniram maniram maniandra...@gmail.com added the comment: +1 on renaming New Window to New File -- nosy: +maniram.maniram ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7136 ___

[issue5905] strptime fails in non-UTF locale

2011-12-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh! I think that I understood the problem: if HAVE_WCSFTIME is not defined, timemodule.c uses strftime(), instead of wcsftime(), encode input format and decode the format. It uses UTF-8 to encode/decode, whereas the right encoding

[issue1062] nice to have a way to tell if a socket is bound

2011-12-08 Thread maniram maniram
maniram maniram maniandra...@gmail.com added the comment: perhaps you can subclass socket.socket and make a function wrapper around bind and connect that sets a variable if called like: class sock(socket.socket): def bind(self,*args): self.is_bound = True -- nosy:

[issue1062] nice to have a way to tell if a socket is bound

2011-12-08 Thread maniram maniram
maniram maniram maniandra...@gmail.com added the comment: oops should be class sock(socket.socket): _bind = socket.socket.bind def bind(self,*args): self.is_bound = True self._bind(self,*args) -- ___ Python tracker

[issue13555] cPickle MemoryError when loading large file (while pickle works)

2011-12-08 Thread Phillies
New submission from Phillies p...@bethgelab.org: When I try to load a large file (1GB) cPickle crashes with a MemoryError: $python test.py Traceback (most recent call last): File /tmp/test.py, line 8, in module A2 = cPickle.load(f2) MemoryError test.py contains following code: import

[issue13555] cPickle MemoryError when loading large file (while pickle works)

2011-12-08 Thread maniram maniram
maniram maniram maniandra...@gmail.com added the comment: Maybe Ubuntu doesn't think it is safe to allocate the memory. -- nosy: +maniram.maniram ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13555

[issue13555] cPickle MemoryError when loading large file (while pickle works)

2011-12-08 Thread Philipp Lies
Philipp Lies p...@bethgelab.org added the comment: Well, replace cPickle by pickle and it works. So if there is a memory allocation problem cPickle should be able to handle it, especially since it should be completely compatible to pickle. -- ___

  1   2   >