Re: Killing threads (was Re: Cancel or timeout a long running regular expression)

2011-09-20 Thread Martin v. Loewis
> Is it just that nobody's implemented it, or is there a good reason for > avoiding offering this sort of thing? I've been considering to implement killing threads several times for the last 15 years (I think about it once every year), and every time I give up because it's too complex and just not

Re: About MAKE_FUNCTION opcode in Python 3

2011-09-20 Thread Terry Reedy
On 9/20/2011 5:56 PM, Eric Snow wrote: On Tue, Sep 20, 2011 at 1:59 PM, Arnaud Delobelle wrote: Since Python 3.0 we have keyword only arguments in functions (see PEP 3102). Looking at the documentation for the dis module (where opcodes are documented), I see the following for MAKE_FUNCTION [1]

Re: Operator commutativity

2011-09-20 Thread Chris Angelico
On Wed, Sep 21, 2011 at 11:07 AM, Steven D'Aprano wrote: > If the right-hand argument is a subclass of the left-hand argument, AND also > defines __radd__ directly rather than inheriting it, then its __radd__ > method is called before the left-hand argument's __add__ method. > > which strikes me a

Re: Operator commutativity

2011-09-20 Thread Steven D'Aprano
Ethan Furman wrote: > Peter Pearson wrote: >> On Mon, 19 Sep 2011 05:48:07 -0700, Ethan Furman >> wrote: >> [snip] >>> Also, if the right-hand operand is a subclass of the left-hand operand >>> then Python will try right-hand_operand.__radd__ first. >> >> I don't think it works that way for me:

Re: About MAKE_FUNCTION opcode in Python 3

2011-09-20 Thread Eric Snow
On Tue, Sep 20, 2011 at 1:59 PM, Arnaud Delobelle wrote: > Since Python 3.0 we have keyword only arguments in functions (see PEP > 3102).  Looking at the documentation for the dis module (where opcodes > are documented), I see the following for MAKE_FUNCTION [1] > > """ > MAKE_FUNCTION(argc) > Pus

Re: HTMLParser and non-ascii html pages

2011-09-20 Thread Peter Otten
Yaşar Arabacı wrote: > I am using a simple sublclass of HTMLParser like this: > > class LinkCollector(HTMLParser): > > def reset(self): > self.links = [] > HTMLParser.reset(self) > > def handle_starttag(self,tag,attr): > if tag in ("a","link"): > key

About MAKE_FUNCTION opcode in Python 3

2011-09-20 Thread Arnaud Delobelle
Since Python 3.0 we have keyword only arguments in functions (see PEP 3102). Looking at the documentation for the dis module (where opcodes are documented), I see the following for MAKE_FUNCTION [1] """ MAKE_FUNCTION(argc) Pushes a new function object on the stack. TOS is the code associated with

Re: Why are my queues empty even though there are items in it?

2011-09-20 Thread Kayode Odeyemi
On Tue, Sep 20, 2011 at 7:42 PM, MRAB wrote: > On 20/09/2011 19:13, Kayode Odeyemi wrote: > > def transaction_queue(queue, item, timeout, block=False): >> queue = multiprocessing.Queue() >> > > This line creates a new empty queue, hiding the one which was passed in. Removed. > > > if

Re: Why are my queues empty even though there are items in it?

2011-09-20 Thread MRAB
On 20/09/2011 20:09, Zero Piraeus wrote: : On 20 September 2011 14:42, MRAB wrote: On 20/09/2011 19:13, Kayode Odeyemi wrote: if item is not {} and timeout is not 0: `not {}` has the value True, so `item is not {}` means `item is True`. The `is` checks for identity, not equality, so t

Re: Operator commutativity

2011-09-20 Thread Ethan Furman
Peter Pearson wrote: On Mon, 19 Sep 2011 05:48:07 -0700, Ethan Furman wrote: [snip] Also, if the right-hand operand is a subclass of the left-hand operand then Python will try right-hand_operand.__radd__ first. I don't think it works that way for me: Python 2.6.5 (r265:79063, Apr 16 2010, 13

Re: Why are my queues empty even though there are items in it?

2011-09-20 Thread Zero Piraeus
: On 20 September 2011 14:42, MRAB wrote: > On 20/09/2011 19:13, Kayode Odeyemi wrote: >> >>     if item is not {} and timeout is not 0: > > `not {}` has the value True, so `item is not {}` means `item is True`. > The `is` checks for identity, not equality, so this is true only if `item` > actual

Re: Dynamically Cause A Function To Return

2011-09-20 Thread Arnaud Delobelle
On 20 September 2011 00:13, Jordan Evans wrote: > I want dynamically place the 'return' statement in a function via user input > or achieve the same through some other means.  If some other means, the user > must be able initiate this at runtime during a raw_input().  This is what I > have so far,

Re: Why are my queues empty even though there are items in it?

2011-09-20 Thread MRAB
On 20/09/2011 19:13, Kayode Odeyemi wrote: Hello friends, I'm writing some Python app that makes use of the multiprocessing and Queue api to perform transaction jobs. My problem is that, the queue always report empty even though I can confirm that there are items in it. Below is the code I'm w

Re: Dynamically Cause A Function To Return

2011-09-20 Thread Kayode Odeyemi
On Tue, Sep 20, 2011 at 12:13 AM, Jordan Evans wrote: > I want dynamically place the 'return' statement in a function via user > input or achieve the same through some other means. If some other means, > the user must be able initiate this at runtime during a raw_input(). This > is what I have s

Re: Dynamically Cause A Function To Return

2011-09-20 Thread Chris Angelico
On Tue, Sep 20, 2011 at 9:13 AM, Jordan Evans wrote: > I want dynamically place the 'return' statement in a function via user input > or achieve the same through some other means.  If some other means, the user > must be able initiate this at runtime during a raw_input().  This is what I > have so

Re: Dynamically Cause A Function To Return

2011-09-20 Thread Kayode Odeyemi
On Tue, Sep 20, 2011 at 12:13 AM, Jordan Evans wrote: > I want dynamically place the 'return' statement in a function via user > input or achieve the same through some other means. If some other means, > the user must be able initiate this at runtime during a raw_input(). This > is what I have s

Why are my queues empty even though there are items in it?

2011-09-20 Thread Kayode Odeyemi
Hello friends, I'm writing some Python app that makes use of the multiprocessing and Queue api to perform transaction jobs. My problem is that, the queue always report empty even though I can confirm that there are items in it. Below is the code I'm working with: import multiprocessing from mul

Re: Operator commutativity

2011-09-20 Thread Peter Pearson
On Mon, 19 Sep 2011 05:48:07 -0700, Ethan Furman wrote: [snip] > Also, if the right-hand operand is a subclass of the left-hand operand > then Python will try right-hand_operand.__radd__ first. I don't think it works that way for me: Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56) >>> class C

HTMLParser and non-ascii html pages

2011-09-20 Thread Yaşar Arabacı
Hi, I am using a simple sublclass of HTMLParser like this: class LinkCollector(HTMLParser): def reset(self): self.links = [] HTMLParser.reset(self) def handle_starttag(self,tag,attr): if tag in ("a","link"): key = "href" elif tag in ("img","sc

techology

2011-09-20 Thread jasmine jasmine
http://123maza.com/48/doll789/ -- http://mail.python.org/mailman/listinfo/python-list

Re: PyEval_EvalCodeEx return value

2011-09-20 Thread John Pinner
On Sep 20, 11:34 am, Mateusz Loskot wrote: > Hi, > > I'm trying to dig out details about what exactly is the return > value the of PyEval_EvalCodeEx function in Python 3.x > The documentation is sparse, unfortunately. > > Perhaps I'm looking at wrong function. > My aim is simple, I need to execute

Re: Python bug in Windows 8--report now, or later?

2011-09-20 Thread Kevin Walzer
On 9/20/11 8:32 AM, Alec Taylor wrote: I can confirm that os.mkdir('C:\\h') and os.path.exists('C:\\h') work on Windows 8 Dev x64. OK--looks like I will need to do a bit more digging into my own code. Thanks for clarifying. -- Kevin Walzer Code by Kevin http://www.codebykevin.com -- http://m

Re: Python bug in Windows 8--report now, or later?

2011-09-20 Thread Alec Taylor
I can confirm that os.mkdir('C:\\h') and os.path.exists('C:\\h') work on Windows 8 Dev x64. On Tue, Sep 20, 2011 at 6:40 AM, Andrew Berg wrote: > On 2011.09.19 09:00 AM, Brian Curtin wrote: >> You said "the application does not create an app folder in the user's >> 'application data' directory" -

PyEval_EvalCodeEx return value

2011-09-20 Thread Mateusz Loskot
Hi, I'm trying to dig out details about what exactly is the return value the of PyEval_EvalCodeEx function in Python 3.x The documentation is sparse, unfortunately. Perhaps I'm looking at wrong function. My aim is simple, I need to execute Python code using Python interpreter embedded in my C++

red bull hats of http:www.discounthats.net

2011-09-20 Thread Bertha Jonanna
Welcome to the http:www.discounthats.net.The http:www.discounthats.net is a promotional shop from the red bull hats, monster energy hats, snapback hats.red bull hats: http:www.discounthats.net red bull hats: http://www.discounthats.net/category-2-b0-Red-Bull-Hats.html monster energy hats: http

red bull hats of http:www.discounthats.net

2011-09-20 Thread Bertha Jonanna
Welcome to the http:www.discounthats.net.The http:www.discounthats.net is a promotional shop from the red bull hats, monster energy hats, snapback hats.red bull hats: http:www.discounthats.net red bull hats: http://www.discounthats.net/category-2-b0-Red-Bull-Hats.html monster energy hats: http