Fastest way to tint an image with PIL

2008-11-06 Thread Dan Moskowitz
Hi, I'm using PIL to tint and composite images together. Here's how I'm currently tinting images, it's really slow and I know there's got to be a better way: def TintImage( im, tintColor ): tint = (tintColor[0]/255.0, tintColor[1]/255.0, tintColor[2]/255.0, tintColor[3]/255.0)

Newbie question

2008-11-06 Thread Joe Hays
I'm a newbie to python. Can anyone tell me why the following little program complains about incorrect dimensions? snip import pylab from pylab import * n = 10; m = 2*n; A = randn(m,n); b = A*rand(n,1) + 2*rand(m,1); /snip The actual error I receive is, snip b = A*rand(n,1) + 2*rand(m,1);

etymology of list comprehension?

2008-11-06 Thread mh
I googled and wiki'ed, but couldn't find a concise clear answer as to how python list comprehensions got their name. Who picked the name? What was the direct inspiration, another language? What language was the first to have such a construct? I get that it's based on set notation. Thanks!

Re: Finding the instance reference of an object

2008-11-06 Thread Aaron Brady
On Nov 6, 1:44 pm, Arnaud Delobelle [EMAIL PROTECTED] wrote: I know this thread has grown quite personal for some of its participants.  I am posting in a spirit of peace and understanding :) Hear, hear. You refer to docs about the *implementation* of Python in C.  This is irrelevant. Also,

Re: etymology of list comprehension?

2008-11-06 Thread Chris Rebert
On Thu, Nov 6, 2008 at 1:19 PM, [EMAIL PROTECTED] wrote: I googled and wiki'ed, but couldn't find a concise clear answer as to how python list comprehensions got their name. Who picked the name? What was the direct inspiration, another language? What language was the first to have such a

PySqlite - division of real numbers without decimal fractions

2008-11-06 Thread Astley Le Jasper
I've been getting errors recently when using pysqlite. I've declared the table columns as real numbers to 2 decimal places (I'm dealing with money), but when doing division on two numbers that happen to have no decimal fractions, the results through pysqlite are coming through as integers. The

Re: Cisco's $100,000 Developer Contest

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 7:15 AM, Guido van Rossum [EMAIL PROTECTED] wrote: This seems of interest to Python developers all over the world. Develop a Python app to run on a Cisco router and win real money! On any Cisco ISR ? Any particular product/version ? --JamesMills -- -- -- Problems are

Re: Plz help..SocketServer UDP server losing lots of packets

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 1:43 AM, Ben Sizer [EMAIL PROTECTED] wrote: On Nov 6, 12:46 am, James Mills [EMAIL PROTECTED] wrote: Try these instead: * UDPServer -http://trac.softcircuit.com.au/circuits/browser/examples/udpserver.py * UDPClient

Re: More __init__ methods

2008-11-06 Thread Ben Finney
Larry Bates [EMAIL PROTECTED] writes: Is there some reason not to use something like the following? class foo: def __init__(self, val): self.a = 0 self.b = 0 if isinstance(val, basestring): # # do something to calculate a and b

Re: Rewriting a bash script in python

2008-11-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Tim Rowe wrote: Actually, there's quite a lot wrong with rapid prototyping, but there's quite a lot wrong with all other requirements capture methodologies too, so rapid prototyping is up there with the rest of them. Sounds like what Churchill said about

Re: More __init__ methods

2008-11-06 Thread Ben Finney
Arnaud Delobelle [EMAIL PROTECTED] writes: Ben Finney [EMAIL PROTECTED] writes: [...] All you need to know to understand the above is that it will have essentially the same result as: class A(object): # ... def _from_string(cls, s): # ...

Re: Newbie question

2008-11-06 Thread Robert Kern
Joe Hays wrote: I'm a newbie to python. Can anyone tell me why the following little program complains about incorrect dimensions? snip import pylab from pylab import * n = 10; m = 2*n; A = randn(m,n); b = A*rand(n,1) + 2*rand(m,1); /snip The actual error I receive is,

Extending Logger

2008-11-06 Thread polettog
Hi, I took a look to the logging module which was quite sexy at a first sight, but then i finally realized the following : the Logger class can't be extended since a Logger is created only with getLogger (the subclass can't call/shouldn't call Logger.__init__()). So, did i miss something? or

Re: etymology of list comprehension?

2008-11-06 Thread mh
Chris Rebert [EMAIL PROTECTED] wrote: the term comprehension for the concept was first used in the NPL programming language (Wikipedia again). Ah, thanks... and does comprehension have any special computer science meaning? -- Mark Harrison Pixar Animation Studios --

Re: List to Text back to List

2008-11-06 Thread John Machin
On Nov 7, 7:04 am, SimonPalmer [EMAIL PROTECTED] wrote: Hi, I am looking for a way to convert a List of floating point numbers to and from text.  I am embedding it in an XML document and am looking for a neat way to serialise and de-serialise a list from a text node. I can easily write

Accessing POST parameters from BaseHTTPServer

2008-11-06 Thread James
Hi all, I'm writing a super simple little debugging HTTP server which simply returns the path and parameters it receives requests for. E.g. requesting /meth?a=b returns something like: Command: GET Path: /meth Params: {'a': ['b']} This is fine for GET, but I can't see how I access parameters

Re: Weird behavior with lexical scope

2008-11-06 Thread Terry Reedy
[EMAIL PROTECTED] wrote: On Nov 6, 9:57 pm, mrstevegross [EMAIL PROTECTED] wrote: I ran into a weird behavior with lexical scope in Python. I'm hoping someone on this forum can explain it to me. Here's the situation: I have an Outer class. In the Outer class, I define a nested class 'Inner'

Can read() be non-blocking?

2008-11-06 Thread Thomas Christensen
This issue has been raised a couple of times I am sure. But I have yet to find a satisfying answer. I am reading from a subprocess and this subprocess sometimes hang, in which case a call to read() call will block indefinite, keeping me from killing it. The folloing sample code illustrates the

Trouble with getdefaultlocale on Mac

2008-11-06 Thread Pierre-Alain Dorange
Hello, To internationalize a small game, i'm trying to use locale.getdefaultlocale() or locale.getlocale(). On my Mac at home, it return '(none,xxx)' difficult to determine the user language... At home : MacOS X 10.4.11 / Python 2.5.2 (user install, default was 2.3.2). I try with the original

Re: Extending Logger

2008-11-06 Thread Thomas Christensen
[EMAIL PROTECTED] writes: I took a look to the logging module which was quite sexy at a first sight, but then i finally realized the following : the Logger class can't be extended since a Logger is created only with getLogger (the subclass can't call/shouldn't call Logger.__init__()). So,

Re: Python25\Tools\checkversions.py

2008-11-06 Thread Martin v. Löwis
Colin J. Williams wrote: Is _checkversion.py used at all currently? I don't think so. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

2009 Python class schedule

2008-11-06 Thread Mark Lutz
A page describing our 2009 Python class offerings has just been posted here: http://home.earthlink.net/~python-training/2009-public-classes.htm The first class in 2009 will be held January 27-30 in Colorado, and is now open for enrollments. These are public classes, open to individuals. They

Re: 2.6, 3.0, and truly independent intepreters

2008-11-06 Thread Walter Overby
On Nov 6, 2:03 pm, sturlamolden [EMAIL PROTECTED] wrote: On Nov 6, 6:05 pm, Walter Overby [EMAIL PROTECTED] wrote: I don't understand how this would help.  If these large data structures reside only in one remote process, then the overhead of proxying the data into another process for

Re: Finding the instance reference of an object

2008-11-06 Thread Joe Strout
On Nov 5, 2008, at 2:06 PM, Lie wrote: http://www.strout.net/info/coding/valref/ I'm fed up with you. I'm sorry -- I'm really not trying to be difficult. And it's odd that you're fed up with me, yet you seem to be agreeing with me on at least most points. In Von Neumann Architecture

Re: Finding the instance reference of an object

2008-11-06 Thread Joe Strout
On Nov 6, 2008, at 12:44 PM, Arnaud Delobelle wrote: I know this thread has grown quite personal for some of its participants. I am posting in a spirit of peace and understanding :) Thanks, I'll do the same. Um, no, I've admitted that it's a reference all along. Indeed, that's pretty

Re: Finding the instance reference of an object

2008-11-06 Thread Terry Reedy
Aaron Brady wrote: and you can't have languages without implementations. This is either a claim that languages are their own implementations, or an admission that human brains are the implementation of all languages thought of by human brains, coupled with a claim that there cannot be

Re: etymology of list comprehension?

2008-11-06 Thread Terry Reedy
[EMAIL PROTECTED] wrote: I googled and wiki'ed, but couldn't find a concise clear answer as to how python list comprehensions got their name. Who picked the name? What was the direct inspiration, another language? What language was the first to have such a construct? I get that it's based on

convert to XMLRPC

2008-11-06 Thread Michel Perez
Que vola a todos: I have an object abstraction layer that allows me to comunicate and interact with my DB server without much problems -am thinking in possibles contributors. In the stdlib xmlrpclib handles this in a common way, but i use a customized GatewayHandler that give me the posibility

Re: CGI Python problem

2008-11-06 Thread Tim O'Toole
With regard to phpinfo(), its shows the mod_cgi is loaded, but neither mod_perl or mod_python is loaded (I read on the python.org site that mod_python can interfere with running python through mod_python). As for writing some perl, not too sure how to do that, but from the information in phpinfo

Re: Snippets management

2008-11-06 Thread Edwin B.
Robert Lehmann [EMAIL PROTECTED] writes: I don't think there is a one-size-fits-all solution. I definetly agree. Setting up a 'snippets' repository sounds good if you just want to be able to look back at what you've done and/or have a place to stash away quick tests. I have set up a

Re: Python25\Tools\checkversions.py

2008-11-06 Thread Colin J. Williams
Martin v. Löwis wrote: Colin J. Williams wrote: Is _checkversion.py used at all currently? I don't think so. Regards, Martin Martin, I suggest that consideration be given to dropping it and and versionchecker from the distribution. I see that it still appears in versions 2.6 and 3.0.

Re: False and 0 in the same dictionary

2008-11-06 Thread Paul Rubin
Prateek [EMAIL PROTECTED] writes: How about using (x, type(x)) as the key instead of just x? Yup. I thought of that. Although it seems kinda unpythonic to do so. Especially since the dictionary is basically a cache mostly containing strings. Adding all the memory overhead for the extra tuples

Re: Snippets management

2008-11-06 Thread expora
On Nov 6, 12:38 pm, Stef Mientki [EMAIL PROTECTED] wrote: Edwin wrote: Hi there, I've been looking for a snippet manager and found PySnippet but it requires PyGTK. Do you know any other option that doesn't need much? I'm sort of new to python and user interfaces seem a bit far for me

Re: CGI Python problem

2008-11-06 Thread Tim Chase
As for writing some perl, not too sure how to do that, but from the information in phpinfo I logged onto the webserver machine and did a whereis python - it came back blank! Of course doing a whereis perl gave a non-blank answer. So this seems to be the route cause of my trouble. Indeed! I

Re: etymology of list comprehension?

2008-11-06 Thread Paul Rubin
[EMAIL PROTECTED] writes: Ah, thanks... and does comprehension have any special computer science meaning? It is from mathematical set theory. If you write something like { p | [some logical expression indicating that p is prime] } then that denotes a set (the set of all prime numbers).

Re: CGI Python problem

2008-11-06 Thread Tim O'Toole
Alas that cgi script confirmed python is not installed on the server machine (which I had assumed it was). Looks like game over with this avenue of trouble shooting? On Fri, Nov 7, 2008 at 1:03 AM, Tim Chase [EMAIL PROTECTED] wrote: As for writing some perl, not too sure how to do that, but

Re: False and 0 in the same dictionary

2008-11-06 Thread John Machin
On Nov 7, 11:54 am, Paul Rubin http://[EMAIL PROTECTED] wrote: Prateek [EMAIL PROTECTED] writes: How about using (x, type(x)) as the key instead of just x? Yup. I thought of that. Although it seems kinda unpythonic to do so. Especially since the dictionary is basically a cache mostly

Re: CGI Python problem

2008-11-06 Thread Tim Chase
Tim O'Toole wrote: Alas that cgi script confirmed python is not installed on the server machine (which I had assumed it was). Did you also try it with the find variant in addition to just the which version? This would find Python if it wasn't on the $PATH. Looks like game over with this

Re: Finding the instance reference of an object

2008-11-06 Thread Aaron Brady
On Nov 6, 6:00 pm, Terry Reedy [EMAIL PROTECTED] wrote: Aaron Brady wrote: and you can't have languages without implementations. This is either a claim that languages are their own implementations, or an admission that human brains are the implementation of all languages thought of by human

Re: I need a simple windows form handle.

2008-11-06 Thread 一首诗
On Nov 7, 4:55 am, Aaron Brady [EMAIL PROTECTED] wrote: On Nov 6, 7:50 am, 一首诗 [EMAIL PROTECTED] wrote: Hi all, Today I was writing a simple test app for a video decoder library. I use python to parse video files and input data to the library. I got a problem here, I need a windows

Re: 2.6, 3.0, and truly independent intepreters

2008-11-06 Thread sturlamolden
On Nov 7, 12:22 am, Walter Overby [EMAIL PROTECTED] wrote: I read Andy to stipulate that the pipe needs to transmit hundreds of megs of data and/or thousands of data structure instances.  I doubt he'd be happy with memcpy either.  My instinct is that contention for a lock could be the quicker

Re: Can read() be non-blocking?

2008-11-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Thomas Christensen wrote: r = select.select([proc.stdout.fileno()], [], [], 5)[0] if r: # NOTE: This will block since it reads until EOF data = proc.stdout.read() No, it will read what data is available. --

efficient Python object count

2008-11-06 Thread darrenr
Hello, Does anyone know of an efficient way to get a count of the total number of Python objects in CPython? The best solution I've been able to find is len(gc.get_objects()) which unfortunately has to walk a C linked list *and* creates a list containing all of the objects, when all I need is an

Re: etymology of list comprehension?

2008-11-06 Thread James Harris
On 6 Nov, 22:13, [EMAIL PROTECTED] wrote: Chris Rebert [EMAIL PROTECTED] wrote: the term comprehension for the concept was first used in the NPL programming language (Wikipedia again). Ah, thanks... and does comprehension have any special computer science meaning? Good question. It

Re: Can read() be non-blocking?

2008-11-06 Thread James Mills
On Fri, Nov 7, 2008 at 8:54 AM, Thomas Christensen [EMAIL PROTECTED] wrote: Is there a way to read non-blocking? Or maybe event a better way in generel to handle this situation? Check out circuits [1]. It has a Component called Stdin [2] which allows you to have non-blocking Standard Input

Re: How to build the pysqlite? Where to find the sqlite3.h?

2008-11-06 Thread Kurda Yon
But I read your statement and understood that I do not need to install neither pysqlite no sqlite. In my Python session I tried to type from sqlite import connect and it does not compaline. It meand that Python see the database!!! I hope. I don't think so. There is no sqlite module in

Re: efficient Python object count

2008-11-06 Thread Christian Heimes
darrenr wrote: Hello, Does anyone know of an efficient way to get a count of the total number of Python objects in CPython? The best solution I've been able to find is len(gc.get_objects()) which unfortunately has to walk a C linked list *and* creates a list containing all of the objects, when

Re: I need a simple windows form handle.

2008-11-06 Thread Aaron Brady
On Nov 6, 7:58 pm, 一首诗 [EMAIL PROTECTED] wrote: On Nov 7, 4:55 am, Aaron Brady [EMAIL PROTECTED] wrote: On Nov 6, 7:50 am, 一首诗 [EMAIL PROTECTED] wrote: Hi all, Today I was writing a simple test app for a video decoder library. I use python to parse video files and input data to

Re: Finding the instance reference of an object

2008-11-06 Thread Steven D'Aprano
On Thu, 06 Nov 2008 09:59:37 -0700, Joe Strout wrote: that's pretty much the whole point: that variables in Python don't contain objects, but merely contain references to objects that are actually stored somewhere else (i.e. on the heap). You're wrong, Python variables don't contain

RELEASED Python 3.0rc2

2008-11-06 Thread Barry Warsaw
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On behalf of the Python development team and the Python community, I am happy to announce the second release candidate for Python 3.0. This is a release candidate, so while it is not suitable for production environments, we strongly encourage

Re: I need a simple windows form handle.

2008-11-06 Thread sturlamolden
On Nov 7, 2:58 am, 一首诗 [EMAIL PROTECTED] wrote: Hi, that's because I guess wxpython does not use native windows forms and could not provide a handle property. Huh? I will make more study. Take a look at wxFormBuilder. I have a wxPython tutorial in my blog.

Re: Accessing POST parameters from BaseHTTPServer

2008-11-06 Thread Steve Holden
James wrote: Hi all, I'm writing a super simple little debugging HTTP server which simply returns the path and parameters it receives requests for. E.g. requesting /meth?a=b returns something like: Command: GET Path: /meth Params: {'a': ['b']} This is fine for GET, but I can't see how

Re: False and 0 in the same dictionary

2008-11-06 Thread Paul Rubin
John Machin [EMAIL PROTECTED] writes: You could use a second dict for the other type:   def lookup(x):     if x in dict1: return dict1[x]     return dict2[x] dict1 would have the 4 special keys and dict2 would have the regular keys. Ummm how do you get the 4 special keys in

Re: convert to XMLRPC

2008-11-06 Thread 一首诗
On Nov 7, 8:22 am, Michel Perez [EMAIL PROTECTED] wrote: Que vola a todos:  I have an object abstraction layer that allows me to comunicate and interact with my DB server without much problems -am thinking in possibles contributors.  In the stdlib xmlrpclib handles this in a common way, but

Re: Can read() be non-blocking?

2008-11-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Thomas Christensen wrote: r = select.select([proc.stdout.fileno()], [], [], 5)[0] if r: # NOTE: This will block since it reads until EOF data = proc.stdout.read() No,

Re: Can read() be non-blocking?

2008-11-06 Thread 一首诗
On Nov 7, 6:54 am, Thomas Christensen [EMAIL PROTECTED] wrote: This issue has been raised a couple of times I am sure.  But I have yet to find a satisfying answer. I am reading from a subprocess and this subprocess sometimes hang, in which case a call to read() call will block indefinite,

Re: Finding the instance reference of an object

2008-11-06 Thread Joe Strout
First, I want to thank everyone for your patience -- I think we're making progress towards a consensus. On Nov 6, 2008, at 8:48 PM, Steven D'Aprano wrote: that's pretty much the whole point: that variables in Python don't contain objects, but merely contain references to objects that are

Re: Can read() be non-blocking?

2008-11-06 Thread Karthik Gurusamy
On Nov 6, 2:54 pm, Thomas Christensen [EMAIL PROTECTED] wrote: This issue has been raised a couple of times I am sure.  But I have yet to find a satisfying answer. I am reading from a subprocess and this subprocess sometimes hang, in which case a call to read() call will block indefinite,

Re: efficient Python object count

2008-11-06 Thread darrenr
On Nov 6, 7:28 pm, Christian Heimes [EMAIL PROTECTED] wrote: darrenr wrote: Hello, Does anyone know of an efficient way to get a count of the total number of Python objects in CPython? The best solution I've been able to find is len(gc.get_objects()) which unfortunately has to walk a C

Re: Can read() be non-blocking?

2008-11-06 Thread [EMAIL PROTECTED]
On Nov 7, 9:09 am, Lawrence D'Oliveiro [EMAIL PROTECTED] central.gen.new_zealand wrote: In message [EMAIL PROTECTED], Lawrence D'Oliveiro wrote: In message [EMAIL PROTECTED], Thomas Christensen wrote:       r = select.select([proc.stdout.fileno()], [], [], 5)[0]       if r:          

Re: Finding the instance reference of an object [long and probably boring]

2008-11-06 Thread Steve Holden
Joe Strout wrote: On Nov 6, 2008, at 12:44 PM, Arnaud Delobelle wrote: I know this thread has grown quite personal for some of its participants. I am posting in a spirit of peace and understanding :) Thanks, I'll do the same. That's good to hear. Your arguments are sometimes pretty

Re: Finding the instance reference of an object

2008-11-06 Thread Terry Reedy
Aaron Brady wrote: On Nov 6, 6:00 pm, Terry Reedy [EMAIL PROTECTED] wrote: 'Associating' is a primitive operation for Python interpreters. Interesting. If I may be so bold as to ask, is it for C code, C compilers, and/or C programs? Sorry, I should have specified for the abstract

Re: PySqlite - division of real numbers without decimal fractions

2008-11-06 Thread Dan Bishop
On Nov 6, 3:46 pm, Astley Le Jasper [EMAIL PROTECTED] wrote: I've been getting errors recently when using pysqlite. I've declared the table columns as real numbers to 2 decimal places (I'm dealing with money), but when doing division on two numbers that happen to have no decimal fractions, the

Re: Finding the instance reference of an object

2008-11-06 Thread Steve Holden
Steven D'Aprano wrote: On Thu, 06 Nov 2008 09:59:37 -0700, Joe Strout wrote: [...] And by definition, call by value means that the parameter is a copy. So if you pass a ten megabyte data structure to a function using call-by- value semantics, the entire ten megabyte structure is copied.

Re: etymology of list comprehension?

2008-11-06 Thread Terry Reedy
Paul Rubin wrote: [EMAIL PROTECTED] writes: Ah, thanks... and does comprehension have any special computer science meaning? It is from mathematical set theory. If you write something like { p | [some logical expression indicating that p is prime] } then that denotes a set (the set of

Re: Finding the instance reference of an object

2008-11-06 Thread Steve Holden
Joe Strout wrote: First, I want to thank everyone for your patience -- I think we're making progress towards a consensus. Phew. But putting that aside, consider the Python code x = 1. Which statement would you agree with? (A) The value of x is 1. Only speaking loosely (which we can

Re: Finding the instance reference of an object [long and probably boring]

2008-11-06 Thread Ben Finney
Steve Holden [EMAIL PROTECTED] writes: One of the reasons for Python's continue march towards world domination (allow me my fantasies) is its consistent simplicity. Those last two words would be my candidate for the definition of Pythonicity. +1 QOTW -- \ Eccles: “I'll get [the

Re: False and 0 in the same dictionary

2008-11-06 Thread John Machin
On Nov 7, 3:05 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: John Machin [EMAIL PROTECTED] writes: You could use a second dict for the other type: def lookup(x): if x in dict1: return dict1[x] return dict2[x] dict1 would have the 4 special keys and dict2 would have the regular

Re: Python25\Tools\checkversions.py

2008-11-06 Thread Martin v. Löwis
I suggest that consideration be given to dropping it and and versionchecker from the distribution. I see that it still appears in versions 2.6 and 3.0. Please submit a bug report to bugs.python.org to this effect. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: etymology of list comprehension?

2008-11-06 Thread Martin v. Löwis
[EMAIL PROTECTED] wrote: Chris Rebert [EMAIL PROTECTED] wrote: the term comprehension for the concept was first used in the NPL programming language (Wikipedia again). Ah, thanks... and does comprehension have any special computer science meaning? Paul already explained the maths, but I

creating a block file for file-like object

2008-11-06 Thread Iain
Hi, I have a function that only accepts filenames, rather than file-like objects (because its a wrapper around a C++ function, I think). I want to feed some potentially large files into this function, but they are coming in as streams (eg from a url) and so are only represented in my code as

Re: creating a block file for file-like object

2008-11-06 Thread Lawrence D'Oliveiro
In message [EMAIL PROTECTED], Iain wrote: Can someone give me some pointers as to how I might create some sort of blocking device file or named pipe ... mkfifo /path/to/named/pipe -- http://mail.python.org/mailman/listinfo/python-list

Re: convert to XMLRPC

2008-11-06 Thread Stefan Behnel
Michel Perez wrote: [db connection] In the stdlib xmlrpclib handles this in a common way, but i use a customized GatewayHandler that give me the posibility to serialize my objects and send them to my clients Doesn't XML-RPC do that for you already? What's the protocol you use for client

Re: need money for comp. shit?

2008-11-06 Thread Stefan Behnel
bslobodi wrote: [spam stripped] Sorry, I didn't find comp.shit on Gmane. Did you mean comp.shell or something in that line? Stefan -- http://mail.python.org/mailman/listinfo/python-list

problem with regex, how to conclude more than one character

2008-11-06 Thread tecspring
I always have no idea about how to express conclude the entire word with regexp, while using python, I encountered this problem again... for example, if I want to match the string in test a string, re.findall(r[^a]* (\w+),test a string) will work, but what if there is not a but an(test a

Re: problem with regex, how to conclude more than one character

2008-11-06 Thread tecspring
On Nov 7, 3:06 pm, [EMAIL PROTECTED] wrote: I always have no idea about how to express conclude the entire word with regexp,  while using python, I encountered this problem again... for example, if I want to match the string in test a string, re.findall(r[^a]* (\w+),test a string) will work,

Re: problem with regex, how to conclude more than one character

2008-11-06 Thread Chris Rebert
On Thu, Nov 6, 2008 at 11:06 PM, [EMAIL PROTECTED] wrote: I always have no idea about how to express conclude the entire word with regexp, while using python, I encountered this problem again... for example, if I want to match the string in test a string, re.findall(r[^a]* (\w+),test a

Re: problem with regex, how to conclude more than one character

2008-11-06 Thread Charles Yan
Really thanks for quickly reply Chris! Actually I tried BeautifulSoup and it's great. But I'm not very familiar with it and it need more codes to parse the html and get the right text. I think regexp is more convenient if there is a way to filter out the list just in one line:) I did this all the

[issue4266] Python 3.0 docs are broken.

2008-11-06 Thread Winfried Plappert
Winfried Plappert [EMAIL PROTECTED] added the comment: In other words, the various *Tex packages cannot agree on a common syntax? MiKTeX-pdfTeX 2.7.3147 (1.40.9) (MiKTeX 2.7) also complains about the double \fi. ___ Python tracker [EMAIL PROTECTED]

[issue4266] Python 3.0 docs are broken.

2008-11-06 Thread Winfried Plappert
Winfried Plappert [EMAIL PROTECTED] added the comment: And Ubuntu Linux pdflatex complains as well: /usr/bin/pdflatex from package texlive-latex-base. ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4266

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Yes, it uses base 2**15 but it's not the correct conversion to base 2**15. You convert each PyLong digit to base 2**15 but not the whole number. I don't understand: yes, each base 2**30 digit is converted to a pair of base 2**15 digits,

[issue4266] Python 3.0 docs are broken.

2008-11-06 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: In other words, the various *Tex packages cannot agree on a common syntax? No, syntax has nothing to do with it. It was a mistake of some sort on my part. It depends on whether the ifxetex latex package is present, because that already defines

[issue4266] Python 3.0 docs are broken.

2008-11-06 Thread Georg Brandl
Changes by Georg Brandl [EMAIL PROTECTED]: -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4266 ___ ___

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Other responses... It was an argument for changing the base used by the mashal :-) Ah. I think I'm with you now. You're saying that ideally, marshal shouldn't have to care about how Python stores its longs: it should just ask some

[issue4268] functions in email package listed under wrong module

2008-11-06 Thread Gabriel Genellina
New submission from Gabriel Genellina [EMAIL PROTECTED]: Functions message_from_string and message_from_file are documented as belonging to the email.parser module, but in fact they live at the top of the email package. The .rst source looks fine, but the rendered html says

[issue4268] functions in email package listed under wrong module

2008-11-06 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Thanks, fixed in r67117. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4268 ___

[issue4267] sqlite3 documentation

2008-11-06 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: Thanks, applied in r67118. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4267 ___

[issue4245] threading documentation: reorder sections

2008-11-06 Thread Georg Brandl
Georg Brandl [EMAIL PROTECTED] added the comment: I agree -- fixed in r67119. -- resolution: - fixed status: open - closed ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4245 ___

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread Mark Dickinson
Changes by Mark Dickinson [EMAIL PROTECTED]: Added file: http://bugs.python.org/file11950/pybench_results.txt ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue4258 ___

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: And now the stat of Python patched with 30bit_longdigit3.patch. min/avg/max are now the number of bits which gives better informations. bigger is the number of arguments which are bigger than 1 digit (not in range [-2^30; 2^30]). make

[issue4263] BufferedWriter non-blocking overage

2008-11-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: The patch is good. I was first surprised by the fact that e.characters_written is not used in the write() method; but _flush_unlocked() already adjusts the _write_buf according to the original e.characters_written raised by the

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: I'll investigate the slowdowns The problem may comes from int64_t on 32 bits CPU. 32x32 - 64 may be emulated on your CPU and so it's slower. I improved your patch to make it faster, but I lost all my work because of a misuse of GIT... As I

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread STINNER Victor
STINNER Victor [EMAIL PROTECTED] added the comment: I wrote a patch to compute stat about PyLong function calls. make (use setup.py): PyLong_FromLong: 168572 calls, min=( 0, ), avg=(1.4,), max=( 3,) long_bool:48682 calls, min=( 0, ), avg=(0.2,), max=( 2,) long_add:

[issue4258] Use 30-bit digits instead of 15-bit digits for Python integers.

2008-11-06 Thread Mark Dickinson
Mark Dickinson [EMAIL PROTECTED] added the comment: Here's a pybench comparison, on OS X 10.5/Core 2 Duo/gcc 4.0.1 (32-bit non-debug build of the py3k branch). I got this by doing: [create clean build of py3k branch] dickinsm$ ./python.exe Tools/pybench/pybench.py -f bench_unpatched [apply

[issue4269] Spaces not showing correctly in split() documentation on http://www.python.org/doc/2.5.2/lib/string-methods.html

2008-11-06 Thread Berend-Jan Wever
New submission from Berend-Jan Wever [EMAIL PROTECTED]: Part of the text of the online documentation for the string.split() method: snip If sep is not specified or is None, a different splitting algorithm is applied. First, whitespace characters (spaces, tabs, newlines, returns, and formfeeds)

[issue4263] BufferedWriter non-blocking overage

2008-11-06 Thread Banesiu Sever
Banesiu Sever [EMAIL PROTECTED] added the comment: Thanks for your review, here's a new patch. I've added a new test for the pre-flush condition and made the comments less cryptic. Added file: http://bugs.python.org/file11953/bw_overage2.diff ___ Python

[issue4263] BufferedWriter non-blocking overage

2008-11-06 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: We have discussed this bug in the python developer chat yesterday. I decided to wait until after the 3.0.0 release. The problem is not critical enough for 3.0.0. I like to keep the amount of changes during the RC phase to a minimum.

[issue4263] BufferedWriter non-blocking overage

2008-11-06 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment: I do concur with the desire to restrict changes during RC phase. Do this also mean that merges from trunk will be reduced to the strict minimum? No global merge, only on a revision basis after review. In this case we could apply the

[issue4120] Do not embed manifest files in *.pyd when compiling with MSVC

2008-11-06 Thread Christian Heimes
Christian Heimes [EMAIL PROTECTED] added the comment: Should this patch be applied to 3.0 before the next RC lands? Barry hasn't released RC2 yet. -- nosy: +christian.heimes type: - compile error versions: +Python 2.7, Python 3.0 ___ Python tracker

[issue3166] Make conversions from long to float correctly rounded.

2008-11-06 Thread Alexander Belopolsky
Alexander Belopolsky [EMAIL PROTECTED] added the comment: Mark, I noticed that you replaced a call to _PyLong_AsScaledDouble with your round to nearest algorithm. I wonder if _PyLong_AsScaledDouble itself would benefit from your change. Currently it is used in PyLong_AsDouble and

<    1   2   3   >