scatterhist and resizing figures
i am using scatterhist to plot some data. i find that when i plot the data and matlab shows it in the figure window, stretching the figure window (with the mouse) to enlarge it actually changes the properties of the figure. for example, making it bigger sometimes reveals more tick marks - like the y limit of the y axis, which i have set but was not shown until i enlarged the window. also, more crucially enlarging can make bars that appear at 0 or not at all to show... when i save the figure window as pdf, depending on which of these is shown, i get different pdfs. here's an example: x=rand(1, 100); y=x+5; scatterhist(x,y); set(gca, 'Box' , 'off' , ... 'LineWidth' , 1); set(gca , 'FontSize' , 12); set(gca, 'FontName' , 'Helvetica'); set(gca, 'TickDir', 'out'); first question: how can i programtically save the figure as pdf in a way that shows maximal info? i don't want to lose tick marks on my axis or bars in my histogram. second: how can i plot with scatterhist but make the scatter plot points filled? with ordinary scatter, i can simply do: scatter(x, y, 'filled') but the 'filled' argument doesn't appear to work for scatterhist. thank you. -- http://mail.python.org/mailman/listinfo/python-list
Re: Newby: how to transform text into lines of text
On 26 Jan 2009 22:12:43 GMT Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Mon, 26 Jan 2009 16:10:11 +0100, Andreas Waldenburger wrote: On 26 Jan 2009 14:51:33 GMT Marc 'BlackJack' Rintsch bj_...@gmx.net wrote: On Mon, 26 Jan 2009 12:22:18 +, Sion Arrowsmith wrote: content = a.readlines() (Just because we can now write for line in file doesn't mean that readlines() is *totally* redundant.) But ``content = list(a)`` is shorter. :-) But much less clear, wouldn't you say? Okay, so let's make it clearer and even shorter: ``lines = list(a)``. :-) OK, you win. :) /W -- My real email address is constructed by swapping the domain with the recipient (local part). -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
On Jan 27, 8:38 am, Jean-Paul Calderone exar...@divmod.com wrote: On Mon, 26 Jan 2009 13:26:56 -0800 (PST), jefm jef.mangelsch...@gmail.com wrote: As Benjamin Kaplin said, Windows terminals use the old cp1252 character set, which cannot display the euro sign. You'll either have to run it in something more modern like the cygwin rxvt terminal, or output some other way, such as through a GUI. With the standard console, I get the same. But with IDLE, using the same Python build but through a different interface Scream at Microsoft or try to find or encourage a console replacement that Python could use. In the meanwhile, use IDLE. Not perfect for Unicode, but better. So, if I understand it correctly, it should work as long as you run your Python code on something that can actually print the Unicode character. Apparently, the Windows command line can not. I mainly program command line tools to be used by Windows users. So I guess I am screwed. Other than converting my tools to have a graphic interface, is there any other solution, other than give Bill Gates a call and bring his command line up to the 21st century ? cp1252 can represent the euro sign (http://en.wikipedia.org/wiki/Windows-1252). Apparently the chcp command can be used to change the code page active in the console (http://technet.microsoft.com/en-us/library/bb490874.aspx). I've never tried this myself, though. Short answer: it doesn't work. Test [Windows XP SP3, Python 2.6.1]: C:\junkchcp Active code page: 850 C:\junkchcp 1252 Active code page: 1252 C:\junkchcp Active code page: 1252 C:\junk\python26\python Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import sys; sys.stdout.encoding; sys.stderr.encoding 'cp1252' 'cp1252' # So far, so good import unicodedata as ucd for b in range(128, 256): ...c = chr(b) ...u = c.decode('cp1252', 'replace') ...name = ucd.name(u) ...print hex(b), c, repr(u), name ... 0x80 € u'\u20ac' EURO SIGN 0x81 � u'\ufffd' REPLACEMENT CHARACTER 0x82 ‚ u'\u201a' SINGLE LOW-9 QUOTATION MARK [snip] 0xfb û u'\xfb' LATIN SMALL LETTER U WITH CIRCUMFLEX 0xfc ü u'\xfc' LATIN SMALL LETTER U WITH DIAERESIS 0xfd ý u'\xfd' LATIN SMALL LETTER Y WITH ACUTE [snip] Ignore what you are seeing in the second field of each above line; it could well look OK. However what I see on the console is: capital C with cedilla small u with diaeresis (umlaut) small e with acute superscript one superscript three superscript two [yes, out of order] IOW, the bridge might think it's in cp1252 mode, but nobody told the engine room, which is still churning out cp850. -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
I was hoping to find something that allows me to print any Unicode character on the console. You will have to debug the Python interpreter to find out what's going wrong in code page 65001. Nobody has ever resolved that mystery, although it's been known for some time. If you merely want to see *something* (and not actually the glyph for the character (*)): py print(ascii('\u20ac')) '\u20ac' should work fine. Regards, Martin (*) Windows doesn't support displaying *all* unicode characters even in code page 65001, nor is it reasonable to expect it to. It can, at best, only display those characters it has glyphs for in the font that it is using. As Unicode constantly evolves, the fonts necessarily get behind. Plus, in a fixed-size font, some characters just don't render too well. -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
IOW, the bridge might think it's in cp1252 mode, but nobody told the engine room, which is still churning out cp850. I think you must use a different font in the console, too, such as Lucida Sans Unicode. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list
Re: USB in python
Sorry, by USB device, I meant a device that is powered/activated by a bunch of wires that I want to control using a computer and since I had a spare USB jack lying around, I used that instead. But so far I haven't tried it, nor will try it if it wont work properly. Yes, it is not a proper USB device, because I didnt build it to specifically interface with the USB port; but I had to start somewhere. Also, the device requires more power than the standard parallel port can give. Anyway, it looks like the easiest solution for my case is a microcontroller In which case the Arduino may be a good place to start. The recent duemilanove boards use USB to communicate with the host, and so the USB port should be available to the microcontroller. We areg etting some way away from Python now, of course ... I second that. Arduino to microcontrolers, is what Linux was to kernels back in the 90ties (now it's mainstream), or maybe what python is/was to Java. -- дамјан ( http://softver.org.mk/damjan/ ) () ASCII Ribbon Campaign /\ Keep it simple! -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
On Jan 27, 10:00 am, Martin v. Löwis mar...@v.loewis.de wrote: IOW, the bridge might think it's in cp1252 mode, but nobody told the engine room, which is still churning out cp850. I think you must use a different font in the console, too, such as Lucida Sans Unicode. True. I was just about to post that I'd stumbled across that! -- http://mail.python.org/mailman/listinfo/python-list
Iterating through a file significantly slower when file has big buffer
I'm working with very large text files and am always looking for ways to optimize the performance of our scripts. While reviewing our code, I wondered if changing the size of our file buffers to a very large buffer size might speed up our file I/O. Intuitively, I thought that bigger buffers might improve performance by reducing the number of reads. Instead I observed just the opposite - performance was 7x slower! (~500 sec vs. 70 sec) and used 3x the memory (24M vs. 8M) due to the larger buffer. The following tests were run on a Windows XP system using Python 2.6.1 SOURCE: import time # timer class class timer( object ): def __init__( self, message='' ): self.message = message def start( self ): self.starttime = time.time() print 'Start: %s' % ( self.message ) def stop( self ): print 'Finish: %s %6.2f' % ( self.message, time.time() - self.starttime ) # myFileName points to a 2G text file. myFileName = r'C:\logs\jan2009.dat' # default buffering myFile = open( myFileName ) for line in myFile: pass myFile.close() strategy1.stop() # setting the buffer size to 16M bufferSize = 2 ** 24 strategy2 = timer( 'Large buffer (%sk)' % (bufferSize/1024) ) strategy2.start() myFile = open( myFileName, 'rt', bufferSize ) for line in myFile: pass myFile.close() strategy2.stop() OUTPUT: Start: Default buffer Finish: Default buffer 69.98 Start: Large buffer (16384k) Finish: Large buffer (16384k) 493.88 --- 7x slower Any comments regarding this massive slowdown? Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list
optparse with numpy.array?
Hi all, I'm trying to use optparse to process command line parameters given to my program. It works as I expect for the types supported by optparse, i.e. int, float, string etc. but how can I pass a numpy.array or a list to my program? I have been searching for it but cannot find a good solution. By the way, I am a Python newbie so please be gentle... Best regards, Johan -- http://mail.python.org/mailman/listinfo/python-list
CORRECTION: Re: Iterating through a file significantly slower when file has big buffer
Added the following lines missing from my original post: strategy1 = timer( 'Default buffer' ) strategy1.start() Code below is now complete. Malcolm SOURCE: import time # timer class class timer( object ): def __init__( self, message='' ): self.message = message def start( self ): self.starttime = time.time() print 'Start: %s' % ( self.message ) def stop( self ): print 'Finish: %s %6.2f' % ( self.message, time.time() - self.starttime ) # myFileName points to a 2G text file. myFileName = r'C:\logs\jan2009.dat' # default buffering strategy1 = timer( 'Default buffer' ) strategy1.start() myFile = open( myFileName ) for line in myFile: pass myFile.close() strategy1.stop() # setting the buffer size to 16M bufferSize = 2 ** 24 strategy2 = timer( 'Large buffer (%sk)' % (bufferSize/1024) ) strategy2.start() myFile = open( myFileName, 'rt', bufferSize ) for line in myFile: pass myFile.close() strategy2.stop() OUTPUT: Start: Default buffer Finish: Default buffer 69.98 Start: Large buffer (16384k) Finish: Large buffer (16384k) 493.88 --- 7x slower Any comments regarding this massive slowdown? Thanks, Malcolm -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
On Jan 27, 9:42 am, Martin v. Löwis mar...@v.loewis.de wrote: I was hoping to find something that allows me to print any Unicode character on the console. You will have to debug the Python interpreter to find out what's going wrong in code page 65001. Nobody has ever resolved that mystery, although it's been known for some time. Maybe the problem is not in the Python interpreter. Running this tiny C program #include stdio.h int main(int argc, char **argv) { printf(\xc2\x80\n); } compiled with mingw32 (gcc (GCC) 3.4.5 (mingw-vista special r3)) and using Lucida Console font: After CHCP 1252, this prints A-circumflex Euro , as expected. After CHCP 65001, it prints hollow-square . Perhaps you could try that with an MS C compiler [which I don't have] ... -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse with numpy.array?
On 2009-01-26 17:44, Johan Ekh wrote: Hi all, I'm trying to use optparse to process command line parameters given to my program. It works as I expect for the types supported by optparse, i.e. int, float, string etc. but how can I pass a numpy.array or a list to my program? http://docs.python.org/library/optparse#optparse-extending-optparse Figure out the text format you want your users to type the value on the command line, write a function that will take that text and convert it to an array or list, then customize OptionParser to use that parser as given in the link above. Keep in mind that your user probably won't want to need to use whitespace or any kind of brackets. Commas are nice, though. You may also want to consider taking a filename and parsing that file instead. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: Dynamic methods and lambda functions
Steve Holden st...@holdenweb.com writes: Mark Wooding wrote: * Assignment stores a new (reference to a) value in the variable. * Binding modifies the mapping between names and variables. I realise I have omitted what was doubtless intended to be explanatory detail, but I am having trouble reconciling those sentences. Would you mind explaining in vacuuo what you see as the difference between assignment and binding? OK. This turned into something of an essay. I hope that it's of use to somebody... A name is a kind of expression. Expressions can be evaluated to yield values. Therefore, a name can be evaluated to yield a value. How does this happen? There are two distinct mappings involved. The first mapping is from names to variables. This mapping is usually called the `environment', and is acted upon by `binding'. The extent of the program text whose meaning is affected by a binding is called the `scope' of the binding[1]. In Python, the scope can be determined statically by analysing the program text (`lexical scope'). In some languages the scope can only be determined at run time (`dynamic scope'); other languages have a mixture of the two. Binding in Python is done in two ways: * /Explicit/ binding is done by `def' or `lambda': the parameters are bound, and the scope of the bindings is the entire function body (i.e., it does not include the default arguments). * /Implicit/ binding may be performed when a name as a result of an assignment operation -- either an assignment statement or one of a number of features which work by assignment, including `for' loops, list comprehensions, and `def' blocks. The scope of the binding in this case depends on the nature of the block in which the binding occurs: within `def' and `lambda'[2], the scope is the entire function body; within `class' and module toplevels, the scope is from the first-executed assignment to the end of the block. In all cases, names are bound to fresh variables when the scope of the binding begins. The environment within a binding block is formed by extending the environment of the surrounding program text. In the case of function definitions, in particular, we say that the function `closes over' the environment in which it is defined. The second mapping is from variables to values. This mapping doesn't seem to have a common name, though it's referred to as the `store' in some formal semantics (e.g., R5RS Scheme). The store is acted upon by assignment (and assignment-like operations such as `for' loops and list comprehensions). An assignment NAME = VALUE alters the store as follows: the variable bound to NAME becomes mapped to the result of evaluating VALUE. We can now consider some example programs. In [23]: def simple(x): : def inner(): : return x : return inner : When the function is invoked, say by In [24]: simple('boo!')() the name x is bound to a new variable, and the variable is assigned the value `boo!'. The body of `simple' is then executed. First, a function `inner' is defined: `def' is an assignment-like operation, which causes `inner' to be implicitly bound to a fresh variable on entry to the function. When the `def' is executed, that variable is assigned the value of a function. Finally, we return the result of evaluating `inner', i.e., the function we just constructed. The next pair of parentheses invoke the function `inner'. That function was defined within an environment in which x was bound to a variable that had been assigned the value 'boo!'. It therefore returns this value: Out[24]: 'boo!' Next example: In [26]: def mutant(x): : def inner(): : return x : x = 'changed!' : return inner : Suppose we invoke this one as In [27]: mutant('same')() The first steps are the same: x is bound to a fresh variable which is assigned the value 'same'; `inner' is bound to a fresh variable which is assigned a function value. Now the line `x = 'changed!'' is executed. This assigns the string 'changed!' to the variable bound to x. Finally, we return the function value. That function is now invoked. It was defined in an environment where x was bound to a variable whose last assigned value was 'changed!'. Therefore: Out[27]: 'changed!' The original poster's question can be illustrated by this example: In [28]: def problem(): : return [lambda: i for i in xrange(3)] : In [29]: [f() for f in problem()] This is actually the same as the mutant example in disguise. There is no parameter to bind, but `for' in a list comprehension is an assignment operation, and therefore i is implicitly bound when `problem' is invoked. The list comprehension performs three iterations. On each iteration,
print formating for matrix/table
I have a list of listsa matrix in that all sub lists are the same length. I there a nice why to prin these so that the columns and rows line up nicely? I have looked around for a good way to do this and haven't found one I am like. It seems that all involve repeating a print for each line. I would have thought I could find a prebuilt function to do this. Surly lots of people are printing matrixes and would like nice formating. So what am I missing? Vincent Davis 720-301-3003 -- http://mail.python.org/mailman/listinfo/python-list
Re: print formating for matrix/table
On 2009-01-26 18:18, Vincent Davis wrote: I have a list of listsa matrix in that all sub lists are the same length. I there a nice why to prin these so that the columns and rows line up nicely? I have looked around for a good way to do this and haven't found one I am like. It seems that all involve repeating a print for each line. I would have thought I could find a prebuilt function to do this. Surly lots of people are printing matrixes and would like nice formating. So what am I missing? Most people using matrices are also using numpy, and numpy arrays do print with columns lined up. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
On Mon, Jan 26, 2009 at 5:42 PM, Martin v. Löwis mar...@v.loewis.dewrote: I was hoping to find something that allows me to print any Unicode character on the console. You will have to debug the Python interpreter to find out what's going wrong in code page 65001. Nobody has ever resolved that mystery, although it's been known for some time. Well, the first step would be to tell Python that there is a code page 65001. On Python 2.6, I get a LookupError for an unknown encoding after doing chcp 65001. I checked the list of aliases in Python 3 and there was no entry for cp65001. Python 2.6.1 (r261:67517, Dec 4 2008, 16:51:00) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. print u'hello' Traceback (most recent call last): File stdin, line 1, in module LookupError: unknown encoding: cp65001 If you merely want to see *something* (and not actually the glyph for the character (*)): py print(ascii('\u20ac')) '\u20ac' should work fine. Regards, Martin (*) Windows doesn't support displaying *all* unicode characters even in code page 65001, nor is it reasonable to expect it to. It can, at best, only display those characters it has glyphs for in the font that it is using. As Unicode constantly evolves, the fonts necessarily get behind. Plus, in a fixed-size font, some characters just don't render too well. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
optparse question
Up until today, I never needed to pass any arguments to a Python program. I did all the requisite reading and found that I should use optparse instead of getopt. I read the documentation and since the words simple and easy often appeared in the examples and documentation, I just knew that it would be a snap to implement. Problem is that all I wanted to do was pass a one flag to the program -d, for to enable debug mode. Several hours later I gave up after optparse complained about every variation I tried. What does it take to pass single parameter to a program? http://docs.python.org/library/optparse.html stated that programs always have options. Is that so? What about dir /s? getopt resolved my immediate need, but I would like to know how one could use optparse to extract out the options from something like dir /s /b. -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse question
On Tue, Jan 27, 2009 at 11:02 AM, Pat p...@junk.net wrote: (...) What does it take to pass single parameter to a program? http://docs.python.org/library/optparse.html stated that programs always have options. Is that so? What about dir /s? Sample code: #!/usr/bin/env python optexample Example of using optparse import os import sys import os.path import optparse __version__ = 0.1 USAGE = %prog [options] arg VERSION = %prog v + __version__ def parse_options(): parse_options() - opts, args Parse and command-line options given returning both the parsed options and arguments. parser = optparse.OptionParser(usage=USAGE, version=VERSION) parser.add_option(-v, --verbose, action=store_true, default=False, dest=verbose, help=Verbose output during operation.) opts, args = parser.parse_args() if len(args) 1: parser.print_help() raise SystemExit, 1 return opts, args def main(): opts, args = parse_options() if opts.verbose: print args[0] if __name__ == __main__: main() cheers James -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse question
On 2009-01-26 19:02, Pat wrote: Up until today, I never needed to pass any arguments to a Python program. I did all the requisite reading and found that I should use optparse instead of getopt. I read the documentation and since the words simple and easy often appeared in the examples and documentation, I just knew that it would be a snap to implement. Problem is that all I wanted to do was pass a one flag to the program -d, for to enable debug mode. Several hours later I gave up after optparse complained about every variation I tried. parser = optparse.OptionParser() parser.add_option('-d', '--debug', action='store_true') options, args = parser.parse_args() if options.debug: # Do debugging stuff. else: # Do non-debugging stuff. What does it take to pass single parameter to a program? http://docs.python.org/library/optparse.html stated that programs always have options. Is that so? What about dir /s? Can you quote exactly the part that you are talking about? I don't see any such claim. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: Dynamic methods and lambda functions
Mark Wooding wrote: Steve Holden st...@holdenweb.com writes: Mark Wooding wrote: * Assignment stores a new (reference to a) value in the variable. * Binding modifies the mapping between names and variables. I realise I have omitted what was doubtless intended to be explanatory detail, but I am having trouble reconciling those sentences. Would you mind explaining in vacuuo what you see as the difference between assignment and binding? OK. This turned into something of an essay. I hope that it's of use to somebody... A name is a kind of expression. Expressions can be evaluated to yield values. Therefore, a name can be evaluated to yield a value. How does this happen? There are two distinct mappings involved. The first mapping is from names to variables. This mapping is usually called the `environment', and is acted upon by `binding'. The extent of the program text whose meaning is affected by a binding is called the `scope' of the binding[1]. In Python, the scope can be determined statically by analysing the program text (`lexical scope'). In some languages the scope can only be determined at run time (`dynamic scope'); other languages have a mixture of the two. Yes. Kay Schleur pointed out that my confusion was due to too close a mental proximity to the Python term binding value to names for assignment. Once I realised you were using bindingto refer to the scope of names it all made much more sense. [...] Chapter 3 of the Structure and Interpretation of Computer Programs, by Abelson and Sussman explains this stuff in a more discursive and approachable manner. If you're still confused by my explanation (and by nature I tend to err on the side of precision rather than clarity, a fault which I know impairs my teaching ability), you may find theirs more useful: http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-19.html#%_chap_3 Nonetheless, I hope that this description has been of some use. I found your precision most helpful, and the entire post was readable and useful. Thanks. regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: print formating for matrix/table
I do have numpy but am using lists as did not need any functions of array. Well maybe print now. I am new to python and don't really know the details about the difference between lists and arrays. I do know that there are different/additional functions available for arrays.Anyway is this the best solution, convert the list to an array before printing? Thanks Vincent Davis On Mon, Jan 26, 2009 at 5:23 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-01-26 18:18, Vincent Davis wrote: I have a list of listsa matrix in that all sub lists are the same length. I there a nice why to prin these so that the columns and rows line up nicely? I have looked around for a good way to do this and haven't found one I am like. It seems that all involve repeating a print for each line. I would have thought I could find a prebuilt function to do this. Surly lots of people are printing matrixes and would like nice formating. So what am I missing? Most people using matrices are also using numpy, and numpy arrays do print with columns lined up. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: print formating for matrix/table
Vincent Davis wrote: I have a list of listsa matrix in that all sub lists are the same length. I there a nice why to prin these so that the columns and rows line up nicely? I have looked around for a good way to do this and haven't found one I am like. It seems that all involve repeating a print for each line. I would have thought I could find a prebuilt function to do this. Surly lots of people are printing matrixes and would like nice formating. So what am I missing? Look at the pprint module: arr = [range(10)] * 10 from pprint import pprint pprint(arr) [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] regards Steve -- Steve Holden+1 571 484 6266 +1 800 494 3119 Holden Web LLC http://www.holdenweb.com/ -- http://mail.python.org/mailman/listinfo/python-list
Re: USB in python
Brian Allen Vanderburg II wrote: This is the FT245 chip which is basically USB-to-Parallel. Chips: http://www.ftdichip.com/Products/FT245R.htm Kit/Board: http://www.ftdichip.com/Products/EvaluationKits/UM245R.htm The spec sheet for the board seems quite simple. It's pin out is similar to that of a parallel port in that you have your data lines DB0-DB7, etc. It can also be connected in bus-powered configuration (~100mA) or self-powered configuration. The kit is more expensive than the chip itself, but probably easier especially if you don't have any experience with surface mount. That is a good idea. The main factor (aside from complexity) that I forgot to mention is the cost. I live very far away from the US and sometimes it is cheaper to buy a microcontroller here than have bits n pieces shipped from the US. Anyway, I'll see if I can find these parts here and maybe use that. Thanks for all the ideas! Cheers Astan -- http://mail.python.org/mailman/listinfo/python-list
Re: print formating for matrix/table
On 2009-01-26 19:55, Steve Holden wrote: Vincent Davis wrote: I have a list of listsa matrix in that all sub lists are the same length. I there a nice why to prin these so that the columns and rows line up nicely? I have looked around for a good way to do this and haven't found one I am like. It seems that all involve repeating a print for each line. I would have thought I could find a prebuilt function to do this. Surly lots of people are printing matrixes and would like nice formating. So what am I missing? Look at the pprint module: arr = [range(10)] * 10 from pprint import pprint pprint(arr) [[0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]] But this doesn't line up the columns, except by accident: [[1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5], [1, 10, 200], [300, 4000, 5]] -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: print formating for matrix/table
On 2009-01-26 19:53, Vincent Davis wrote: I do have numpy but am using lists as did not need any functions of array. Well maybe print now. I am new to python and don't really know the details about the difference between lists and arrays. I do know that there are different/additional functions available for arrays. Python lists are one-dimensional, appendable sequences of heterogeneous Python objects. numpy arrays are multi-dimensional, non-appendable containers usually of homogeneously-typed numerical data (but can also contain heterogeneous Python objects, too). numpy arrays have many conveniences over lists of lists if you need to do math on bunches of numbers. Anyway is this the best solution, convert the list to an array before printing? I wouldn't use numpy *just* for this, but I suspect that you could actually use numpy for other things if you are actually using your lists of lists as matrices. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse question
I did all the requisite reading and found that I should use optparse instead of getopt. I read the documentation and since the words simple and easy often appeared in the examples and documentation, I just knew that it would be a snap to implement. I don't know where you got that. 'getopt' works just fine. 'optparse' works fine too. I don't think anybody is going to get too worked up over which you decide to use for such a simple case. Matt -- http://mail.python.org/mailman/listinfo/python-list
Pipe stdout stderr to a TkLabel widget
I am wondering how i might pipe stdout stderr to a Tkinter Label widget. here are a few ways to set the text #-- Create a label --# label = Label(master, text='Default Text') label.pack() # -- two ways to change the text --# label['text'] = 'New Text' label.configure(text='New Text') #-- or use a control variable --# v = StringVar(master) label.config(textvariable=v) #-- Change useing variable --# v.set('NewText') So my question is -- I know hoe to set the text displayed in the label wiget, but hoow do i capture stdout and send that to the widget? -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse question
On Jan 27, 12:02 pm, Pat p...@junk.net wrote: Up until today, I never needed to pass any arguments to a Python program. I did all the requisite reading and found that I should use optparse instead of getopt. I read the documentation and since the words simple and easy often appeared in the examples and documentation, I just knew that it would be a snap to implement. Problem is that all I wanted to do was pass a one flag to the program -d, for to enable debug mode. Several hours later I gave up after optparse complained about every variation I tried. What does it take to pass single parameter to a program? I'm assuming that question 2 starts here. To help answer question 1 without just writing the code for you, it might help if you (a) showed what you regard as your best effort (b) explained what part of http://docs.python.org/library/optparse.html#handling-boolean-flag-options you had trouble with. http://docs.python.org/library/optparse.htmlstated that programs always have options. Does it? Is that so? What about dir /s? That has one option, /s. And this must be question 3: getopt resolved my immediate need, but I would like to know how one could use optparse to extract out the options from something like dir /s /b. If you mean with / as the option designator instead of -: there doesn't appear to be a documented way of doing it. You would have to do some social engineering on the users to get them used to doing dir -s -b. In any case I thought the number of Windows users who know how to fire up a Command Prompt window was diminishingly small ... you actually have users who know how to use commands like dir /s /b? Cheers, John -- http://mail.python.org/mailman/listinfo/python-list
Re: print formating for matrix/table
I called it a matrix mostly because this is how I am visualizing it. They are full of numbers but only as representatives of students and schools. It looks like pprint will work after I read the instructions. At least I know where to look now. In the end I need to figure out how to save the data a csv formated for excel but that is for later I was just trying to make it easier to debug my code. Thanks Vincent Davis 720-301-3003 On Mon, Jan 26, 2009 at 7:03 PM, Robert Kern robert.k...@gmail.com wrote: On 2009-01-26 19:53, Vincent Davis wrote: I do have numpy but am using lists as did not need any functions of array. Well maybe print now. I am new to python and don't really know the details about the difference between lists and arrays. I do know that there are different/additional functions available for arrays. Python lists are one-dimensional, appendable sequences of heterogeneous Python objects. numpy arrays are multi-dimensional, non-appendable containers usually of homogeneously-typed numerical data (but can also contain heterogeneous Python objects, too). numpy arrays have many conveniences over lists of lists if you need to do math on bunches of numbers. Anyway is this the best solution, convert the list to an array before printing? I wouldn't use numpy *just* for this, but I suspect that you could actually use numpy for other things if you are actually using your lists of lists as matrices. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: Method returning an Iterable Object
But how come a raise StopIteration in the next() method doesnt need to be caught ? It works without breaking. class twoTimes: max = 10**10 def __init__(self, n): self.__n = n def next(self): if self.__n self.max: raise StopIteration self.__n *= 2 return self.__n def __iter__(self): return self t = twoTimes(5) c = 0 print (t.next()) print (t.next()) for n in t: print n Anjanesh -- http://mail.python.org/mailman/listinfo/python-list
Re: ob_type in shared memory
Hi, Mark, Do you mind if I approach you off the group about this? Aaron On Jan 25, 9:47 pm, Mark Wooding m...@distorted.org.uk wrote: Aaron Brady castiro...@gmail.com writes: I am writing an extension using shared memory. I need a data type that is able to reassign its 'ob_type' field depending on what process is calling it. That sounds scary! snip -- http://mail.python.org/mailman/listinfo/python-list
Re: Method returning an Iterable Object
On Tue, Jan 27, 2009 at 1:16 PM, Anjanesh Lekshminarayanan m...@anjanesh.net wrote: But how come a raise StopIteration in the next() method doesnt need to be caught ? It works without breaking. Because this exception is specially dealt with when iterating over an iterator. The raise StopIteration is what causes the iteration to stop. Consider: x = EveryOther(xrange(10)) x.next() 0 x.next() 2 x.next() 4 x.next() 6 x.next() 8 x.next() Traceback (most recent call last): File stdin, line 1, in module File foo.py, line 12, in next raise StopIteration StopIteration x = EveryOther(xrange(10)) list(x) [0, 2, 4, 6, 8] cheers James -- http://mail.python.org/mailman/listinfo/python-list
shutil module (directory input)
hello folks i am trying to tweak the current codes so that later when i call it from the terminal i can provide sourcefile and the destination file rather being fixed in the code.becuase now i have to specify the sourcefile and the destinationfile in codes and not left to be specified from the terminal. i want to be able to do this. python shutil_copy.py sourcefile, destinationfile code import shutil shutil.copyfile(srcfile, dstfile) # copy data only -- View this message in context: http://www.nabble.com/shutil-module-%28directory-input%29-tp21679178p21679178.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list
Re: Method returning an Iterable Object
Anjanesh Lekshminarayanan wrote: But how come a raise StopIteration in the next() method doesnt need to be caught ? It works without breaking. The for-loop looks for and catches StopIteration. It is an essential part of what defines a finite iterator. (Note, in 3.0, next is renamed __next__ in conformance with all other special methods. In 2.6, the rename is optional, I believe.) class twoTimes: max = 10**10 def __init__(self, n): self.__n = n There is no reason to mangle the attribute name. Max should be a parameter, and self.max = max added to the init. def next(self): if self.__n self.max: raise StopIteration self.__n *= 2 return self.__n Are you sure you do not want to return once the initial value of n passed to init? def __iter__(self): return self Once you understand the above, you can rewrite it as a generator function: def two_times(num, stop): while num stop: yield num num *=2 The two last lines can be switches if desired. t = twoTimes(5) c = 0 print (t.next()) print (t.next()) for n in t: print n print(list(two_times(5,687))) [5, 10, 20, 40, 80, 160, 320, 640] Terry Jan Reedy -- http://mail.python.org/mailman/listinfo/python-list
Re: shutil module (directory input)
On Tue, Jan 27, 2009 at 1:48 PM, klia alwaseem307s...@yahoo.com wrote: i am trying to tweak the current codes so that later when i call it from the terminal i can provide sourcefile and the destination file rather being fixed in the code.becuase now i have to specify the sourcefile and the destinationfile in codes and not left to be specified from the terminal. i want to be able to do this. python shutil_copy.py sourcefile, destinationfile code import shutil shutil.copyfile(srcfile, dstfile) # copy data only Have a look at the documentation for the sys module. cheers James -- http://mail.python.org/mailman/listinfo/python-list
Re: ob_type in shared memory
On Jan 26, 9:20 pm, Aaron Brady castiro...@gmail.com wrote: Hi, Mark, snip On Jan 25, 9:47 pm, Mark Wooding m...@distorted.org.uk wrote: Aaron Brady castiro...@gmail.com writes: I am writing an extension using shared memory. I need a data type that is able to reassign its 'ob_type' field depending on what process is calling it. That sounds scary! Ha ha, whoops. -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse with numpy.array?
Thank you Robert, but what if I just want to create an array interactively, e.g. like m = array([1.0, 2.0, 3.0]), and pass it to my program? I tried extending optparse with a new type as explained in the link you gave me but I was not able to get it to work. Is it really neccessary follow that route just to pass an array? Lot's of people must have done this before! Best regards, Johan On Tue, Jan 27, 2009 at 1:00 AM, Robert Kern robert.k...@gmail.com wrote: On 2009-01-26 17:44, Johan Ekh wrote: Hi all, I'm trying to use optparse to process command line parameters given to my program. It works as I expect for the types supported by optparse, i.e. int, float, string etc. but how can I pass a numpy.array or a list to my program? http://docs.python.org/library/optparse#optparse-extending-optparse Figure out the text format you want your users to type the value on the command line, write a function that will take that text and convert it to an array or list, then customize OptionParser to use that parser as given in the link above. Keep in mind that your user probably won't want to need to use whitespace or any kind of brackets. Commas are nice, though. You may also want to consider taking a filename and parsing that file instead. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse with numpy.array?
On Tue, Jan 27, 2009 at 3:45 PM, Johan Ekh ekh.jo...@gmail.com wrote: Thank you Robert, but what if I just want to create an array interactively, e.g. like m = array([1.0, 2.0, 3.0]), and pass it to my program? I tried extending optparse with a new type as explained in the link you gave me but I was not able to get it to work. Is it really neccessary follow that route just to pass an array? Lot's of people must have done this before! Normally command line applications accept a number of arguments which are available in sys.argv cheers James -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse with numpy.array?
Thank you James, but I just can't optparse to accept an array, only integers, floats ans strings. My code looks like this from optparse import OptionParser parser = OptionParser() parser.add_option('-t', '--dt', action='store', type='float', dest='dt_i', default=0.1, help='time increment where lsoda saves results') parser.add_option('-T', '--tstop', action='store', type='float', dest='tstop_i', default=1.0, help='duration of the solution') parser.add_option('-m', '--mass_vector', action='store', type='float', dest='m_i', default=[1.0, 1.0], help='vector with lumped masses') op, args = parser.parse_args(sys.argv[1:]) I want this to work for m_i = array([1.0, 2.0, 3.0]) but the optparse complains that m_i is not a float. Best regards, Johan On Tue, Jan 27, 2009 at 6:53 AM, James Mills prolo...@shortcircuit.net.auwrote: On Tue, Jan 27, 2009 at 3:45 PM, Johan Ekh ekh.jo...@gmail.com wrote: Thank you Robert, but what if I just want to create an array interactively, e.g. like m = array([1.0, 2.0, 3.0]), and pass it to my program? I tried extending optparse with a new type as explained in the link you gave me but I was not able to get it to work. Is it really neccessary follow that route just to pass an array? Lot's of people must have done this before! Normally command line applications accept a number of arguments which are available in sys.argv cheers James -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse with numpy.array?
On Tue, Jan 27, 2009 at 4:01 PM, Johan Ekh ekh.jo...@gmail.com wrote: Thank you James, but I just can't optparse to accept an array, only integers, floats ans strings. My code looks like this from optparse import OptionParser parser = OptionParser() parser.add_option('-t', '--dt', action='store', type='float', dest='dt_i', default=0.1, help='time increment where lsoda saves results') parser.add_option('-T', '--tstop', action='store', type='float', dest='tstop_i', default=1.0, help='duration of the solution') parser.add_option('-m', '--mass_vector', action='store', type='float', dest='m_i', default=[1.0, 1.0], help='vector with lumped masses') op, args = parser.parse_args(sys.argv[1:]) I want this to work for m_i = array([1.0, 2.0, 3.0]) but the optparse complains that m_i is not a float. What you want to do is accept a string as an argument to -m/--mass_vector and parse this string into a list. For example: parser.add_option('-m', '--mass_vector', action='store',dest='m_i', default=None, help='vector with lumped masses') op, args = parser.parse_args(sys.argv[1:]) if op.m_i is None: m_i = [1.0, 1.0] else: xs = m_i.split(,) m_i = [float(x.strip()) for x in xs] Of course be aware that this code does no error checking and if you pass in rubbish, it will likely throw an exception. cheers Jaems -- http://mail.python.org/mailman/listinfo/python-list
Re: optparse with numpy.array?
On 2009-01-27 00:01, Johan Ekh wrote: Thank you James, but I just can't optparse to accept an array, only integers, floats ans strings. My code looks like this from optparse import OptionParser parser = OptionParser() parser.add_option('-t', '--dt', action='store', type='float', dest='dt_i', default=0.1, help='time increment where lsoda saves results') parser.add_option('-T', '--tstop', action='store', type='float', dest='tstop_i', default=1.0, help='duration of the solution') parser.add_option('-m', '--mass_vector', action='store', type='float', dest='m_i', default=[1.0, 1.0], help='vector with lumped masses') op, args = parser.parse_args(sys.argv[1:]) I want this to work for m_i = array([1.0, 2.0, 3.0]) but the optparse complains that m_i is not a float. Well, yes, because you declared that --mass_vector was type='float'. You will need to subclass OptionParser in order to parse something that is not one of the included types. Yes, it is a bit cumbersome; it's one of the reasons I usually use the third-party argparse library instead. You only need to supply a parsing function rather than subclass. I'm afraid I don't really understand what you want when you say that you want to create an array interactively. Can you show me an example command line that you want to parse? Keep in mind that in many shells, ()[] characters are specially handled by the shell and are not convenient for users. BTW, I am subscribed to the list. You do not need to Cc me. -- Robert Kern I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth. -- Umberto Eco -- http://mail.python.org/mailman/listinfo/python-list
Re: unable to print Unicode characters in Python 3
Well, the first step would be to tell Python that there is a code page 65001. On Python 2.6, I get a LookupError for an unknown encoding after doing chcp 65001. I checked the list of aliases in Python 3 and there was no entry for cp65001. I see. What happens if you add it to encoding/aliases.py? Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list
How do I say two classes up in the inheritance chain in python?
I have two classes that both inherit from two other classes which both inherit from a single class. The two children have two almost identical methods: class grandparent( object ): def meth( self ): # do something class parent1( grandparent ): def meth( self ): # do something p1 super( parent1, self ).meth( ) class parent2( grandparent ): def meth( self ): # do something p2 super( parent2, self ).meth( ) class child1( parent1 ): def meth( self ): # do something c super( parent1, self ).meth( ) # I want to invoke meth on grandparent class child2( parent2 ): def meth( self ): # do something c super( parent2, self ).meth( ) # I want to invoke meth on grandparent The meth methods in child1 and child2 are the same, except that in the last super call, one is referring to parent1, the other is referring to parent2. If they were exactly the same I could use a mixin where I could define this method, and both child1 and child2 would inherit from this mixin too. In this way I wouldn't have to code these methods twice. But how do I write this mixin? It needs to refer to the grandparent in such a way that it works in both child1 and child2 and bypasses both parent1 and parent2. How would I do that? Notes: (1) of course child1 and child2 have all sorts of methods which are different, only meth is almost the same. (2) I can't modify the grandfather class. Cheers, Daniel -- Psss, psss, put it down! - http://www.cafepress.com/putitdown -- http://mail.python.org/mailman/listinfo/python-list
[issue4707] round(25, 1) should return an integer, not a float
Mark Dickinson dicki...@gmail.com added the comment: Clearer title. -- title: round() shows undocumented behaviour - round(25, 1) should return an integer, not a float ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4707 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4707] round(25, 1) should return an integer, not a float
Mark Dickinson dicki...@gmail.com added the comment: Some minor modifications to the last patch: - fix round docstring: it now reads round(number[, ndigits]) - number instead of round(number[, ndigits]) - floating-point number - add Misc/NEWS entry - add extra tests for round(x, n) with n huge and positive -- stage: - commit review versions: +Python 3.1 Added file: http://bugs.python.org/file12865/round_int_int5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4707 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5068] tarfile loops forever on broken input
New submission from Maciek Fijalkowski fi...@genesilico.pl: I have troubles actually finding such a file, but I encountered it at least once (file is gone by now though). The lines in question are for bz2 compression: in _BZ2Proxy.read: try: raw = self.fileobj.read(self.blocksize) data = self.bz2obj.decompress(raw) b.append(data) except EOFError: break if it ever goes here (after finishing reading header) and data is truncated, fileobj.read() will return 0 and data will be '' and so on forever. -- components: Library (Lib) messages: 80567 nosy: fijal severity: normal status: open title: tarfile loops forever on broken input versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5057] Unicode-width dependent optimization leads to non-portable pyc file
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5057 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4676] python3 closes + home keys
Weeble clockworksa...@gmail.com added the comment: Just got a chance to test this on a Windows desktop with a proper keyboard. (My laptop does weird things with num-lock and scroll-lock.) I got it to crash once, but I have no idea what was special about that time. Otherwise I can reproduce the exception traceback printed to the console, with the following steps: 1) Start IDLE from the console, e.g.: python c:\python26\Lib\idlelib\idle.py 2) Make sure num-lock is turned OFF. 3) Enter a few characters, e.g: rhubarb 4) Press shift+left to create a selection of at least one character. 5) Press shift+home. The stack trace appears in the console: Exception in Tkinter callback Traceback (most recent call last): File C:\Python26\lib\lib-tk\Tkinter.py, line 1410, in __call__ return self.func(*args) File C:\Python26\lib\idlelib\MultiCall.py, line 150, in handler r = l[i](event) File C:\Python26\lib\idlelib\EditorWindow.py, line 333, in home_callback if self.text.compare(first,,last): File C:\Python26\lib\lib-tk\Tkinter.py, line 2858, in compare self._w, 'compare', index1, op, index2)) TclError: expected boolean value but got This is consistent with my understanding that Tk 8.5 does not use a mark named anchor to indicate the selection anchor. I have written a patch that directly calls tk::TextKeySelect instead of trying to duplicate its behaviour using the anchor mark. I'm not terribly confident with using diff and patch, so please let me know if I've done it wrong. I did use -u. Added file: http://bugs.python.org/file12866/IDLE_fix_shift_home.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4676 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5068] tarfile loops forever on broken input
Changes by Lars Gustäbel l...@gustaebel.de: -- assignee: - lars.gustaebel nosy: +lars.gustaebel ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4941] Tell GCC Py_DECREF is unlikely to call the destructor
Paolo 'Blaisorblade' Giarrusso p.giarru...@gmail.com added the comment: Probably #if the definitions of Py_LIKELY and Py_UNLIKELY instead of __builtin_expect so new compilers can easily add their own definitions. This was done in the first version, but with the currently supported compilers it's simpler to do like that, because both GCC and ICC support the same __builtin_expect syntax, so you get less code this way. Anyway, the code was inspired from the Linux kernel which only supports those two compilers, so anybody more knowledgeable is welcome to suggest how to express this with other compilers. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4941 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5067] Error msg from using wrong quotes in JSON is unhelpful
Changes by Steven D'Aprano st...@pearwood.info: -- components: +Library (Lib) type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1722344] Thread shutdown exception in Thread.notify()
Changes by Qiangning Hong hon...@gmail.com: -- nosy: +hongqn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1722344 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []
Changes by Mike Watkins pyt...@mikewatkins.ca: -- title: http.client.HTTPMessage.getallmatchingheaders() - http.client.HTTPMessage.getallmatchingheaders() always returns [] ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5053 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5069] Use sets instead of list in posixpath._resolve_link
New submission from Χρήστος Γεωργίου (Christos Georgiou) t...@users.sourceforge.net: The paths_seen object is a list; a set is more appropriate, since its main use is a lookup as in path in paths_seen -- components: Library (Lib) files: posixpath.diff keywords: patch messages: 80570 nosy: tzot severity: normal status: open title: Use sets instead of list in posixpath._resolve_link type: performance versions: Python 2.7 Added file: http://bugs.python.org/file12867/posixpath.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4753] Faster opcode dispatch on gcc
Paolo 'Blaisorblade' Giarrusso p.giarru...@gmail.com added the comment: -fno-gcse is controversial. Even if it might avoid jumps sharing, the impact of that option has to be measured, since common subexpression elimination allows omitting some recalculations, so disabling global CSE might have a negative impact on other code. It would be maybe better to disable GCSE only for the interpreter loop, but that would make some intra-file inlining impossible. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4753 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4672] Distutils SWIG support blocks use of SWIG -outdir option
Andy Buckley a...@insectnation.org added the comment: Dumb question, but why is distutils wrapping the command args in quotes anyway? I'm not even sure why lists are being used (rather than a string) for the options, except that lists are a bit more Pythony and can be used to semantically divide the options from each other. If you end up having to use separate list elements for the option flag and the value it takes, doesn't that indicate that the list isn't being used properly? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4672 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4753] Faster opcode dispatch on gcc
Changes by Kevin Watters kevinwatt...@gmail.com: -- nosy: +kevinwatters ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4753 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5070] Distutils should create install dir if needed
New submission from Andy Buckley a...@insectnation.org: If you attempt to call python setup.py install --prefix=/foo, and /foo/lib/pythonX.Y/site-packages does not exist, the installation will fail, requiring that the directory be made by hand. Since there is no easy way to know in advance (other than by running Python to build the version number string) exactly where the install will go, this can be troublesome for automated build scripts. For this reason, and also to be more consistent with existing build/install systems like autotools, I suggest that distutils builds the necessary portions of the lib directory tree (provided /foo exists). This should certainly happen (IMHO) if the --force option is given. -- components: Distutils messages: 80573 nosy: andybuckley severity: normal status: open title: Distutils should create install dir if needed type: feature request versions: Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5070] Distutils should create install dir if needed
Jean-Paul Calderone exar...@divmod.com added the comment: This isn't accurate. distutils *will* create the directory if it does not exist. Perhaps you have setuptools installed? setuptools disables this behavior of distutils and forces you to create the directory manually. -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4705] python3.0 -u: unbuffered stdout
Mark Dickinson dicki...@gmail.com added the comment: It's not about changing it, stdin has always been buffered in py3k. Sorry: I should have been clearer. It's the change from 2.x to 3.x that interests me. So 'python3.0 -u' has buffered stdin, while 'python2.6 -u' does not; I'm wondering: was this an intentional design change? Or was it just an accident/by-product of the rewritten io? Anyway, the patch looks good to me. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5071] Distutils should not fail if install dir is not in PYTHONPATH
New submission from Andy Buckley a...@insectnation.org: At present, distutils exits with an error return code if the directory that modules are being installed into is not in PYTHONPATH. Since the install path is not easily obtained (it at least requires running Python to work out the version string, plus some guesswork about lib vs. lib64, etc. etc.), it would be nice if this was not a blocking problem... at least when the --force flag is passed to setup.py (PS. It would be nice if there *is* a way to get the installation path from distutils before installing, for the reasons mentioned: that way automatic install scripts like the one I'm managing could work out the path, make it and add it to the PYTHONPATH, without worrying about getting it wrong. Am I just missing something that already exists?) -- components: Distutils messages: 80576 nosy: andybuckley severity: normal status: open title: Distutils should not fail if install dir is not in PYTHONPATH type: feature request versions: Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5071] Distutils should not fail if install dir is not in PYTHONPATH
Jean-Paul Calderone exar...@divmod.com added the comment: See my comment on issue5070. -- nosy: +exarkun ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4474] PyUnicode_FromWideChar incorrect for characters outside the BMP (unix only)
STINNER Victor victor.stin...@haypocalc.com added the comment: @marketdickinson, @lemburg: ping! I updated the patch, does it look better? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4474 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4626] compile() doesn't ignore the source encoding when a string is passed in
STINNER Victor victor.stin...@haypocalc.com added the comment: Ping! Can anyone review my patch? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4626 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4010] configure options don't trickle down to distutils
Akira Kitada akit...@gmail.com added the comment: Attached patch changes distutils to pass CPPFLAGS to compiler. -- nosy: +tarek Added file: http://bugs.python.org/file12868/issue4010.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4010 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4010] configure options don't trickle down to distutils
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- assignee: - tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4010 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1885] [distutils] - error when processing the --formats=tar option
Tarek Ziadé ziade.ta...@gmail.com added the comment: done (in r68969 for py3k branch) -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1885 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5070] Distutils should create install dir if needed
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- nosy: +tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5071] Distutils should not fail if install dir is not in PYTHONPATH
Changes by Tarek Ziadé ziade.ta...@gmail.com: -- nosy: +tarek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5071 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5070] Distutils should create install dir if needed
Andy Buckley a...@insectnation.org added the comment: Thanks for the rapid feedback: yes, I am using setuptools and didn't realise it would be responsible for this override. Is setuptools feedback done completely independently from this tracker? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1529142] Allowing multiple instances of IDLE with sub-processes
Weeble clockworksa...@gmail.com added the comment: A thought occurs to me: would this patch make it harder to cope with awkward firewalls that block the connection? Are they more or less likely to intervene when passing a port of 0 and letting it pick a port automatically? And if they do intervene, would users be able to create an exception if there is no small list of ports that might be used? Apart from that, what do I need to do to move this forward? Go hunt for more testers willing to try out the patch? Find an expert to review it? ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1529142 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5070] Distutils should create install dir if needed
Jean-Paul Calderone exar...@divmod.com added the comment: Yea. setuptools is often discussed on distutils-sig: http://www.python.org/community/sigs/current/distutils-sig/ And has an issue tracker of its own: http://bugs.python.org/setuptools/ http://bugs.python.org/setuptools/issue54 sounds like this issue. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5070 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5061] Inadequate documentation of the built-in function open
David W. Lambert lamber...@corning.com added the comment: (prospective, not perspective programmer) Spelling out the possibilities as suggested in Message80563 makes better sense to me than writing in words the logic handling the mode argument of the io.open function. (Perhaps there is a clearer implementation using a dictionary with frozenset keys, but the io module for py3k is being recast in c, per my understanding.) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5061 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Changes by Collin Winter coll...@gmail.com: -- nosy: +collinwinter ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5072] urllib.open sends full URL after GET command instead of local path
New submission from Olemis Lang ole...@gmail.com: Hello ... The first thing I have to say is that I searched the open issues and I found nothing similar to what I am going to report hereinafter. If this ticket is duplicate , I apologize ... Yesterday I was testing how to access the wiki pages in a Trac [1]_ site and I realized that something wrong was happening (a bug? ...) Initially the behavior was as follows : {{{ #!python u = urllib.urlopen('http://localhost:8000/trac-dev') u.read() 'Environment not found' u.close() }}} And tracd reported a line like this {{{ 127.0.0.1 - - [25/Jan/2009 17:32:08] GET http://localhost:8000/trac- dev HTTP/1.0 404 - }}} Which means that a 'Not found' error code was sent back to urllib client. I tried to access the same page from my browser and tracd reported {{{ 127.0.0.1 - - [25/Jan/2009 18:05:44] GET /trac-dev HTTP/1.0 200 - }}} The problem is obvious ... urllib was sending the full URL after GET and it should send only the string after the network location. I applied the following patch to urllib (yours will be better, I am sure about that ;) {{{ #!diff --- /usr/lib/python2.5/urllib.py2008-07-31 13:40:40.0 -0500 +++ /media/urllib_unix.py 2009-01-26 09:48:54.0 -0500 @@ -270,6 +270,7 @@ def open_http(self, url, data=None): Use HTTP protocol. import httplib +from urlparse import urlparse user_passwd = None proxy_passwd= None if isinstance(url, str): @@ -312,12 +313,17 @@ else: auth = None h = httplib.HTTP(host) +target = ''.join(sep + part for sep, part in \ +zip(['', ';', '?', '#'], \ +urlparse(selector)[2:]) \ +if part) +print target if data is not None: -h.putrequest('POST', selector) +h.putrequest('POST', target) h.putheader('Content-Type', 'application/x-www-form- urlencoded') h.putheader('Content-Length', '%d' % len(data)) else: -h.putrequest('GET', selector) +h.putrequest('GET', target) if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) }}} And everithing was «back» to normal ... {{{ #!python u = urllib.urlopen('http://localhost:8000/trac-dev') u.read() ... # Lots of beautiful HTML code ;) u.close() }}} ... tracd outputted ... {{{ 127.0.0.1 - - [25/Jan/2009 18:05:44] GET /trac-dev HTTP/1.0 200 - }}} The same picture is shown when using both Python 2.5.1 and 2.5.2 ... I have not installed Python 2.6.x so I am not sure about whether this issue has propagated onto newer versions of Python ... and I don't know euther if this issue is also present in urllib2 or not ... ... so further research is needed, but IMO this is a serious bug :( PD: If this is a bug ... how could it be hidden so far ? Is there any test case written to assert this kind of things ? I checked out `test.test_urllib` and `test.test_urllibnet` modules and I saw nothing at all ... .. [1] Trac (http://trac.edgewall.org) -- components: Library (Lib) messages: 80586 nosy: olemis severity: normal status: open title: urllib.open sends full URL after GET command instead of local path type: behavior versions: Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5068] tarfile loops forever on broken input
Lars Gustäbel l...@gustaebel.de added the comment: Thanks for the report. The problem is in fact easy to reproduce. _BZ2Proxy hangs if it is passed a file object with either no data or with a partial bzipped file. For example try: tarfile.open(mode=r:bz2, fileobj=StringIO.StringIO()) I will create a decent fix for that problem, but not before next week. I am too busy doing other important stuff ATM. -- versions: +Python 3.0, Python 3.1 -Python 2.4, Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5068 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5072] urllib.open sends full URL after GET command instead of local path
Olemis Lang ole...@gmail.com added the comment: Ooops ... sorry, remove the print statement. The patch is as follows : {{{ #!diff --- /usr/lib/python2.5/urllib.py2008-07-31 13:40:40.0 -0500 +++ /media/urllib_unix.py 2009-01-26 09:48:54.0 -0500 @@ -270,6 +270,7 @@ def open_http(self, url, data=None): Use HTTP protocol. import httplib +from urlparse import urlparse user_passwd = None proxy_passwd= None if isinstance(url, str): @@ -312,12 +313,17 @@ else: auth = None h = httplib.HTTP(host) +target = ''.join(sep + part for sep, part in \ +zip(['', ';', '?', '#'], \ +urlparse(selector)[2:]) \ +if part) if data is not None: -h.putrequest('POST', selector) +h.putrequest('POST', target) h.putheader('Content-Type', 'application/x-www-form- urlencoded') h.putheader('Content-Length', '%d' % len(data)) else: -h.putrequest('GET', selector) +h.putrequest('GET', target) if proxy_auth: h.putheader('Proxy-Authorization', 'Basic %s' % proxy_auth) if auth: h.putheader('Authorization', 'Basic %s' % auth) if realhost: h.putheader('Host', realhost) }}} I apologize once again ... ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5073] bsddb/test/test_lock.py sometimes fails due to floating point error
New submission from Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp: time.time() returns floating point, so sometimes folloing assertion in LockingTestCase#test03_lock_timeout fails due to floating point calculation error. self.assertTrue((end_time-start_time) = 0.1 end_time-start_time becomes 0.099046326 for instance. I ran test_lock.py 100 times after applied the attached patch, I saw no error. -- components: Tests files: test_lock.patch keywords: patch messages: 80589 nosy: ocean-city severity: normal status: open title: bsddb/test/test_lock.py sometimes fails due to floating point error versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1 Added file: http://bugs.python.org/file12869/test_lock.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4705] python3.0 -u: unbuffered stdout
Antoine Pitrou pit...@free.fr added the comment: So 'python3.0 -u' has buffered stdin, while 'python2.6 -u' does not; I'm wondering: was this an intentional design change? Or was it just an accident/by-product of the rewritten io? I'm not sure (I didn't write the new io in the first place) but I'd say it was simply overlooked. Otherwise 'python3.0 -u' would have had at least unbuffered stdout/stderr, which it didn't have. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Raymond Hettinger rhettin...@users.sourceforge.net added the comment: Reminder, make sure we can still break out of a while 1: pass. -- nosy: +rhettinger versions: +Python 2.7, Python 3.1 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5073] bsddb/test/test_lock.py sometimes fails due to floating point error
Mark Dickinson dicki...@gmail.com added the comment: Looks good to me! If it were me I'd probably just code the test directly as self.assertTrue((end_time-start_time) = 0.0999) to avoid having to look for epsilon when reading. Do you want to commit it or shall I? -- nosy: +marketdickinson resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Antoine Pitrou pit...@free.fr added the comment: Reminder, make sure we can still break out of a while 1: pass. Yes, the patch takes care of that. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4705] python3.0 -u: unbuffered stdout
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - pitrou resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5073] bsddb/test/test_lock.py sometimes fails due to floating point error
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment: Could you commit please? :-) ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5066] IDLE documentation for Unix obsolete/incorrect
Terry J. Reedy tjre...@udel.edu added the comment: LOL. That doc was apparently last revised in 2000 for the IDLE released with 1.5.2 (see screenshot). Other needed updates I see are: 'Shell' and 'Options' have been added to the menu line; we now have unicode text; screenshots look different (and nicer) on newer Tk on WinXP and could/should be redone. If it were decided to update this and add it to the doc package, I would help in some way. -- nosy: +tjreedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5066 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5073] bsddb/test/test_lock.py sometimes fails due to floating point error
Mark Dickinson dicki...@gmail.com added the comment: Fixed in r68978 (trunk) and r68979 (2.6). bsddb is no longer part of the standard Python distribution for 3.x, so the patch doesn't apply there. Thank you! -- resolution: accepted - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5073 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4705] python3.0 -u: unbuffered stdout
Antoine Pitrou pit...@free.fr added the comment: Committed and applied a small fix to the test so that it passes in debug mode (r68977, r68981, r68982). Thanks! -- resolution: accepted - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4705 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Antoine Pitrou pit...@free.fr added the comment: The patches don't apply cleanly anymore, I'll regenerate a new one. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file10147/loops8.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file9871/loops7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file9863/loops5.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file9832/loops4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2459] speedup for / while / if with better bytecode
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file9829/loops3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue2459 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4285] Use a named tuple for sys.version_info
Ross Light rlig...@gmail.com added the comment: Tests added and new patch uploaded. Anything else, anyone? Added file: http://bugs.python.org/file12870/patch-4285d.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4285 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5072] urllib.open sends full URL after GET command instead of local path
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: I could not reproduce this issue neither with Python 2.6 nor 2.5.2 If I print host and selector near line 313, I get 'localhost:8000' and '/trac-dev', the expected results. Do you have an HTTP proxy? running at the *same* port? (!) -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4673] Distutils should provide an uninstall command
philobyte peter.a.si...@gmail.com added the comment: python setup.py uninstall should do all the same processing as 'install' but whenever it gets to the point of copying a file to a system destination, it should instead unlink the destination. besides the obvious use, here is another one: when upgrading a package, and the new version no longer includes certain files, just installing the new version will leave leftovers of the previous version installed. using uninstall beforehand will clean out the cruft. -- nosy: +philobyte ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4673 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5069] Use sets instead of list in posixpath._resolve_link
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: Simple and correct. -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5069 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5053] http.client.HTTPMessage.getallmatchingheaders() always returns []
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: I think unified diffs are preferred. Isn't there an existing test for this method? -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5053 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5067] Error msg from using wrong quotes in JSON is unhelpful
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: This patch provides a better error message for this case:: json.loads({'test': test}) but still doesn't help in this one:: json.loads({test: 'test'}) 'test' looks like garbage to JSON (it *is* garbage!), exactly the same as:: json.loads({test: @?%%}) so it's hard to provide a better message when the parser expects a generic object. -- nosy: +gagenellina ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue5067] Error msg from using wrong quotes in JSON is unhelpful
Changes by Gabriel Genellina gagsl-...@yahoo.com.ar: -- keywords: +patch Added file: http://bugs.python.org/file12871/json-messages.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue5067 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com