Re: Flattening lists

2009-02-08 Thread Rhamphoryncus
On Feb 7, 3:07 pm, wrote: > On Sat, 7 Feb 2009 12:50:22 -0800 (PST) > Rhamphoryncus wrote: > > Can you explain this in a little more detail? > > In the application, there is one main numpy array of type "O". > Each element of the array corresponds to one cell in

Re: Flattening lists

2009-02-07 Thread Rhamphoryncus
On Feb 7, 1:39 pm, wrote: > On Sat, 7 Feb 2009 01:06:06 -0800 (PST) > Rhamphoryncus wrote: > > > What usecase do you have for such inconsistently structured data? > > I have a similar use case in pyspread, which is a Python spreadsheet > that employs numpy object arrays.

Re: Flattening lists

2009-02-07 Thread Rhamphoryncus
On Feb 6, 10:21 pm, rdmur...@bitdance.com wrote: > Quoth Mensanator : > > def flatten(listOfLists): > >     return list(chain.from_iterable(listOfLists)) > >     Python 2.6.1 (r261:67515, Jan  7 2009, 17:09:13) >     [GCC 4.3.2] on linux2 >     Type "help", "copyright", "credits" or "license" for m

Re: Flattening lists

2009-02-06 Thread Rhamphoryncus
On Feb 5, 1:16 pm, Michele Simionato wrote: > On Feb 5, 7:24 pm, a...@pythoncraft.com (Aahz) wrote: > > > In article > > , > > Michele Simionato   wrote: > > > >Looks fine to me. In some situations you may also use hasattr(el, > > >'__iter__') instead of isinstance(el, list) (it depends if you wa

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-27 Thread Rhamphoryncus
On Jan 27, 12:47 pm, Steve Holden wrote: > Paul Rubin wrote: > > GIL-less Python (i.e. Jython) already exists and beats CPython in > > performance a lot of the time, including on single processors. > > Whether the GIL can be eliminated from CPython without massive rework > > to every extension mod

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-27 Thread Rhamphoryncus
On Jan 27, 12:13 pm, "Russ P." wrote: > On Jan 26, 6:09 am, Steve Holden wrote: > > > Quite. Python is a language "for consenting adults". It has perceived > > deficiencies for certain software engineering environments. Can we drop > > the subject now? This horse was flogged to death long ago, an

Re: Pythonic list/tuple/dict layout?

2009-01-25 Thread Rhamphoryncus
d1 -- http://mail.python.org/mailman/listinfo/python-list

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-23 Thread Rhamphoryncus
On Jan 22, 11:09 pm, Carl Banks wrote: > On Jan 22, 9:38 pm, Rhamphoryncus wrote: > > > > > On Jan 22, 9:38 pm, Carl Banks wrote: > > > > On Jan 22, 6:00 am, a...@pythoncraft.com (Aahz) wrote: > > > > > In article <7xd4ele060@rucku

Re: Why GIL? (was Re: what's the point of rpython?)

2009-01-22 Thread Rhamphoryncus
On Jan 22, 9:38 pm, Carl Banks wrote: > On Jan 22, 6:00 am, a...@pythoncraft.com (Aahz) wrote: > > > > > In article <7xd4ele060@ruckus.brouhaha.com>, > > Paul Rubin   wrote: > > > >alex23 writes: > > > >> Here's an article by Guido talking about the last attempt

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-22 Thread Rhamphoryncus
On Jan 22, 7:48 pm, Terry Reedy wrote: > Steven D'Aprano wrote: > > > Here's a thought experiment for you. You've suggested that the values > > returned by cmp() are allowed to change "at whim". Okay, let's do it: > > make a patch that changes cmp() to return -17, 0 or 53, and promise to > > suppo

Re: what's the point of rpython?

2009-01-21 Thread Rhamphoryncus
On Jan 21, 9:46 pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > Rhamphoryncus writes: > > a) The contended case is the issue, not the uncontended case.  An > > uncontended lock is just constant overhead, not a barrier to > > scalability > > a1) Really what

Re: what's the point of rpython?

2009-01-21 Thread Rhamphoryncus
On Jan 21, 12:57 pm, MRAB wrote: > I'm not sure whether multicore processors share a cache or, if not, have > some other on-chip mechanism. Multiprocessor machines, however, are a > different matter... They share some, but also have some exclusive. How much of which depends entirely on which CPU

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 20, 2:39 pm, Paul Rubin <http://phr...@nospam.invalid> wrote: > Rhamphoryncus writes: > > "lock free" is largely meaningless.  What it really means is "we use > > small hardware locks rather than big software locks, thereby reducing > > (but not e

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 19, 9:00 pm, "Brendan Miller" wrote: > Maybe I'm missing something here but a lock free algorithm for > reference counting seems pretty trivial. As long as you can atomically > increment and decrement an integer without locking you are pretty much > done. "lock free" is largely meaningless

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 16, 5:37 pm, "Brendan Miller" wrote: > So I kind of wanted to ask this question on the pypy mailing list.. > but there's only a pypy-dev list, and I don't want to put noise on the > dev list. > > What's the point of RPython? By this, I don't mean "What is RPython"? > I get that. I mean, why

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Rhamphoryncus
On Jan 20, 12:04 pm, "Russ P." wrote: Hey, if pylint can reliably detect private data access violations, > that's good news to me. I haven't used it, so I don't know. (I used > pychecker a while back, but I haven't used that for a while either.) > > If pylint can check access violations, then it

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-19 Thread Rhamphoryncus
On Jan 18, 12:51 pm, "Russ P." wrote: > And even if all your developers were excellent, data hiding would > still be a convenient mechanism to simplify their jobs so they can > focus on higher level problems -- and not have to rely on an ugly > naming convention. That's just it — the cost of main

Re: Python 3 isinstance

2009-01-15 Thread Rhamphoryncus
On Jan 14, 3:14 pm, "Lambert, David W (S&T)" wrote: > Please, why isn't a set permitted as the second argument to isinstance? The real problem is it would be misleading. isinstance(a, myset) suggests implementation like type(a) in myset, but it's really any (isinstance(a, t) for t in myset). If

Re: Implementing file reading in C/Python

2009-01-09 Thread Rhamphoryncus
On Jan 9, 2:14 pm, Marc 'BlackJack' Rintsch wrote: > On Fri, 09 Jan 2009 15:34:17 +, MRAB wrote: > > Marc 'BlackJack' Rintsch wrote: > > >> def iter_max_values(blocks, block_count): > >>     for i, block in enumerate(blocks): > >>         histogram = defaultdict(int) > >>         for byte in b

Re: Are python objects thread-safe?

2008-12-22 Thread Rhamphoryncus
On Dec 21, 11:51 am, RajNewbie wrote: > Say, I have two threads, updating the same dictionary object - but for > different parameters: > Please find an example below: > a = {file1Data : '', >        file2Data : ''} > > Now, I send it to two different threads, both of which are looping > infinitely

Re: __future__ and compile: unrecognised flags

2008-12-14 Thread Rhamphoryncus
On Dec 13, 6:03 am, Steve Holden wrote: > Poor Yorick wrote: > > I have a future statement in a script which is intended to work in 2.6 and > > 3. > > Shouldn't compile flags in __future__ objects essentially be noops for > > versions > > that already support the feature? doctest is complaining

Re: Rich Comparisons Gotcha

2008-12-10 Thread Rhamphoryncus
On Dec 10, 7:49 am, Rasmus Fogh <[EMAIL PROTECTED]> wrote: > Rhamphoryncus wrote: > > You grossly overvalue using the "in" operator on lists. > > Maybe. But there is more to it than just 'in'. If you do:>>> c = > numpy.zeros((2,)) > >>

Re: Rich Comparisons Gotcha

2008-12-09 Thread Rhamphoryncus
You grossly overvalue using the "in" operator on lists. It's far more common to use a dict or set for containment tests, due to O(1) performance rather than O(n). I doubt the numpy array supports hashing, so an error for misuse is all you should expect. In the rare case that you want to test for

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rhamphoryncus
On Dec 8, 7:44 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 08 Dec 2008 10:20:56 -0800, Rhamphoryncus wrote: > > On Dec 7, 4:20 pm, Steven D'Aprano <[EMAIL PROTECTED] > > cybersource.com.au> wrote: > >> On Sun, 07 Dec 2008 15:32:53 -060

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rhamphoryncus
On Dec 8, 2:51 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Rhamphoryncus wrote: > > "We've always done it that way" is NOT a use case!  Certainly, it's a > > factor, but it seems quite weak compared to the sort use case. > > I didn't say it was

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rhamphoryncus
On Dec 8, 1:04 pm, Robert Kern <[EMAIL PROTECTED]> wrote: > Rhamphoryncus wrote: > > On Dec 8, 11:54 am, Robert Kern <[EMAIL PROTECTED]> wrote: > >> Rhamphoryncus wrote: > >>> On Dec 7, 4:20 pm, Steven D'Aprano <[EMAIL PROTECTED] > >>>

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rhamphoryncus
On Dec 8, 11:54 am, Robert Kern <[EMAIL PROTECTED]> wrote: > Rhamphoryncus wrote: > > On Dec 7, 4:20 pm, Steven D'Aprano <[EMAIL PROTECTED] > > cybersource.com.au> wrote: > >> On Sun, 07 Dec 2008 15:32:53 -0600, Robert Kern wrote: > >>>

Re: Rich Comparisons Gotcha

2008-12-08 Thread Rhamphoryncus
On Dec 7, 4:20 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 07 Dec 2008 15:32:53 -0600, Robert Kern wrote: > > Rasmus Fogh wrote: > > >> Current behaviour is both inconsistent and counterintuitive, as these > >> examples show. > > > x = float('NaN') > > x == x

Re: can the sequence of entries in a dictionary be depended on?

2008-11-24 Thread Rhamphoryncus
On Nov 23, 6:43 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Nov 24, 11:59 am, Carsten Haese <[EMAIL PROTECTED]> wrote: > > > Diez B. Roggisch wrote: > > > AFAIK the order is deterministic as long as you don't alter the dict > > > between > > > iterations. However, this is an implementation det

Re: Python 3.0 - is this true?

2008-11-10 Thread Rhamphoryncus
On Nov 10, 9:31 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > On Nov 10, 6:25 pm, Steven D'Aprano > > > > <[EMAIL PROTECTED]> wrote: > > On Mon, 10 Nov 2008 11:43:59 -0800, Rhamphoryncus wrote: > > > You might as well comment out the sort and call it

Re: Python 3.0 - is this true?

2008-11-10 Thread Rhamphoryncus
On Nov 10, 6:25 pm, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Mon, 10 Nov 2008 11:43:59 -0800, Rhamphoryncus wrote: > > You might as well comment out the sort and call it good.  That's what > > you really had in 2.x.  It was close enough most of the time to *l

Re: Python 3.0 - is this true?

2008-11-10 Thread Rhamphoryncus
On Nov 10, 8:16 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > Duncan Grisby wrote: > > In article <[EMAIL PROTECTED]>, > >  Terry Reedy  <[EMAIL PROTECTED]> wrote: > > >> Have you written any Python code where you really wanted the old, > >> unpredictable behavior? > > > I have an object database wr

Re: Python 3.0 - is this true?

2008-11-09 Thread Rhamphoryncus
On Nov 8, 10:14 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > I guess building a multiset is a little more expensive than just O(n). > It is rather like building a dict from a list which is O(k*n) with a > constant but small factor k. The comparison is of the same order. To > enable the same behavi

Re: 2.6, 3.0, and truly independent intepreters

2008-10-30 Thread Rhamphoryncus
On Oct 30, 8:23 pm, "Patrick Stinson" <[EMAIL PROTECTED]> wrote: > Speaking of the big picture, is this how it normally works when > someone says "Here's some code and a problem and I'm willing to pay > for a solution?" I've never really walked that path with a project of > this complexity (I guess

Re: 2.6, 3.0, and truly independent intepreters

2008-10-29 Thread Rhamphoryncus
On Oct 29, 7:20 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 28 Okt, 21:03, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > * get a short-term bodge that works, like hacking the 3rd party > > library to use your shared-memory allocator.  Should be far less work &

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Rhamphoryncus
On Oct 28, 9:30 am, "Andy O'Meara" <[EMAIL PROTECTED]> wrote: > On Oct 25, 9:46 am, "M.-A. Lemburg" <[EMAIL PROTECTED]> wrote: > > > These discussion pop up every year or so and I think that most of them > > are not really all that necessary, since the GIL isn't all that bad. > > Thing is, if the t

Re: 2.6, 3.0, and truly independent intepreters

2008-10-28 Thread Rhamphoryncus
On Oct 26, 6:57 pm, "Andy O'Meara" <[EMAIL PROTECTED]> wrote: > Grrr... I posted a ton of lengthy replies to you and other recent > posts here using Google and none of them made it, argh. Poof. There's > nothing that fires more up more than lost work,  so I'll have to > revert short and simple answ

Re: 2.6, 3.0, and truly independent intepreters

2008-10-25 Thread Rhamphoryncus
On Oct 25, 12:29 am, greg <[EMAIL PROTECTED]> wrote: > Rhamphoryncus wrote: > > A list > > is not shareable, so it can only be used within the monitor it's > > created within, but the list type object is shareable. > > Type objects contain dicts, which allow a

Re: 2.6, 3.0, and truly independent intepreters

2008-10-24 Thread Rhamphoryncus
On Oct 24, 3:02 pm, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 10/23/2008 2:24 PM, came the following characters from the > keyboard of Rhamphoryncus: >> >> On Oct 23, 11:30 am, Glenn Linderman <[EMAIL PROTECTED]> wrote: >> >>> >&

Re: 2.6, 3.0, and truly independent intepreters

2008-10-24 Thread Rhamphoryncus
On Oct 24, 2:59 pm, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 10/24/2008 1:09 PM, came the following characters from > the keyboard of Rhamphoryncus: > > PyE: objects are reclassified as shareable or non-shareable, many > > types are now only allowed to

Re: 2.6, 3.0, and truly independent intepreters

2008-10-24 Thread Rhamphoryncus
On Oct 24, 1:02 pm, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 10/24/2008 8:42 AM, came the following characters from > the keyboard of Andy O'Meara: > > > Glenn, great post and points! > > Thanks. I need to admit here that while I've got a fair bit of > professional programming

Re: 2.6, 3.0, and truly independent intepreters

2008-10-23 Thread Rhamphoryncus
On Oct 23, 11:30 am, Glenn Linderman <[EMAIL PROTECTED]> wrote: > On approximately 10/23/2008 12:24 AM, came the following characters from > the keyboard of Christian Heimes: > > > Andy wrote: > >> 2) Barriers to "free threading".  As Jesse describes, this is simply > >> just the GIL being in place

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Rhamphoryncus
On Oct 22, 10:31 pm, Andy <[EMAIL PROTECTED]> wrote: > > You seem confused.  PEP 3121 is for isolated interpreters (ie emulated > > processes), not threading. > > Please reread my points--inherently isolated interpreters (ie. the top > level object) are indirectly linked to thread independence.  I

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Rhamphoryncus
On Oct 22, 7:04 pm, Andy <[EMAIL PROTECTED]> wrote: > > What you describe, truly independent interpreters, is not threading at > > all: it is processes, emulated at the application level, with all the > > memory cost and none of the OS protections.  True threading would > > involve sharing most obj

Re: 2.6, 3.0, and truly independent intepreters

2008-10-22 Thread Rhamphoryncus
On Oct 22, 10:32 am, Andy <[EMAIL PROTECTED]> wrote: > Dear Python dev community, > > I'm CTO at a small software company that makes music visualization > software (you can check us out atwww.soundspectrum.com).  About two > years ago we went with decision to use embedded python in a couple of > ou

Re: Why no tailcall-optimization?

2008-09-23 Thread Rhamphoryncus
On Sep 22, 7:13 pm, process <[EMAIL PROTECTED]> wrote: > Why doesn't Python optimize tailcalls? Are there plans for it? > > I know GvR dislikes some of the functional additions like reduce and > Python is supposedly about "one preferrable way of doing things" but > not being able to use recursion p

Re: What do you call a class not intended to be instantiated

2008-09-22 Thread Rhamphoryncus
On Sep 21, 4:39 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > I have a class which is not intended to be instantiated. Instead of using > the class to creating an instance and then operate on it, I use the class > directly, with classmethods. Essentially, the class is used as

Re: threading

2008-08-14 Thread Rhamphoryncus
On Aug 14, 3:30 am, "Mathieu Prevot" <[EMAIL PROTECTED]> wrote: > 2008/8/13 Parimala <[EMAIL PROTECTED]>: > > > > > Hello, > > >        I am using python2.5.1 version to run my test scripts. I want to use > > 'threading' module in my tests. As a startup program, I had run the > > following one. > >

Re: Why nested scope rules do not apply to inner Class?

2008-08-13 Thread Rhamphoryncus
On Aug 13, 11:13 am, "Cousson, Benoit" <[EMAIL PROTECTED]> wrote: > > There is no point of nested classes because nested classes _are not_ > > supported by python. They are simply an artifact of not actively > > denying the syntax non-globally. I would fully support a change to the > > language to

Re: __new__

2008-08-04 Thread Rhamphoryncus
On Aug 4, 11:46 am, Ethan Furman <[EMAIL PROTECTED]> wrote: > Mel wrote: > > Ethan Furman wrote: > > >>Emile van Sebille wrote: > > >>>Ethan Furman wrote: > >    --> d25._int = (1, 5) > > >>>Python considers names that start with a leading underscore as internal > >>>or private, and that abuse

Re: Using two pythons in an application

2008-08-04 Thread Rhamphoryncus
On Aug 3, 5:43 pm, Allen <[EMAIL PROTECTED]> wrote: > Larry Bates wrote: > > Allen wrote: > >> I'm in the process of developing an application that will use Python > >> for a scripting support.  In light of the upcoming changes to Python, > >> I was wondering if it is possible to link to and use tw

Re: when does the GIL really block?

2008-08-01 Thread Rhamphoryncus
On Jul 31, 7:27 pm, Craig Allen <[EMAIL PROTECTED]> wrote: > I have followed the GIL debate in python for some time.  I don't want > to get into the regular debate about if it should be gotten rid of > (though I am curious about the status of that for Python 3)... > personally I think I can do mult

Re: proxy class and __add__ method

2008-07-30 Thread Rhamphoryncus
On Jul 29, 10:23 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 29 Jul 2008 13:13:51 -0300, Magnus Schuster   > <[EMAIL PROTECTED]> escribi : > > > > > Hello, > > I have written the following small proxy class which I expect to pass all > > function calls to the 'original' object: > >

Re: static variables in Python?

2008-07-30 Thread Rhamphoryncus
On Jul 29, 2:40 pm, kj <[EMAIL PROTECTED]> wrote: > Yet another noob question... > > Is there a way to mimic C's static variables in Python?  Or something > like it?  The idea is to equip a given function with a set of > constants that belong only to it, so as not to clutter the global > namespace

Re: How do i : Python Threads + KeyboardInterrupt exception

2008-06-20 Thread Rhamphoryncus
On Jun 19, 11:09 pm, Brendon Costa <[EMAIL PROTECTED]> wrote: > > If only the main thread can receive KeyboardInterrupt, is there any > > reason why you couldn't move the functionality of the Read thread into > > the main thread? It looks like it's not doing any work, just waiting > > for the Proc

Re: Automatically restarting system calls?

2008-06-15 Thread Rhamphoryncus
On Jun 15, 1:06 pm, Dan Stromberg <[EMAIL PROTECTED]> wrote: > On Sat, 14 Jun 2008 10:04:15 -0700, Rhamphoryncus wrote: > > On Jun 13, 10:41 am, Dan Stromberg <[EMAIL PROTECTED]> wrote: > >> I wrote a script(1) replacement in python > >> (http://stromberg.dn

Re: best way to create a timer

2008-06-14 Thread Rhamphoryncus
On Jun 12, 11:42 pm, Alexnb <[EMAIL PROTECTED]> wrote: > I am wondering what is the best way to create a timer, like an alarm, once it > reaches a time, it triggers an event. I have a way of doing this but it > seems like it isn't good at all. If it helps at all I am using a Tkinter, > but that pro

Re: Automatically restarting system calls?

2008-06-14 Thread Rhamphoryncus
On Jun 13, 10:41 am, Dan Stromberg <[EMAIL PROTECTED]> wrote: > I wrote a script(1) replacement in python (http://stromberg.dnsalias.org/ > ~dstromberg/pypty/), but I'm encountering a problem in it. > > I think I know the solution to the problem, but I'd've thought python was > high level enough th

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread Rhamphoryncus
On Jun 11, 2:15 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 11, 2:01 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 11, 10:43 am, George Sakkis <[EMAIL PROTECTED]> wrote: > > > > On Jun 11, 1:40 am, Rhamphoryncus <[EMAI

Re: How to kill a thread?

2008-06-11 Thread Rhamphoryncus
On Jun 11, 1:17 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 11, 6:49 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > On Jun 11, 6:56 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > >

Re: Confusion with weakref, __del__ and threading

2008-06-11 Thread Rhamphoryncus
On Jun 11, 10:43 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 11, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > The trick here is that calling proxy.sleep(0.01) first gets a strong > > reference to the Mystery instance, then holds that strong reference &

Re: Producer-consumer threading problem

2008-06-11 Thread Rhamphoryncus
On Jun 11, 6:00 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jun 11, 1:59 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > Why not use a normal Queue, put a dummy value (such as None) in when > > you're producer has finished, and have the main thread use

Re: How to kill a thread?

2008-06-11 Thread Rhamphoryncus
On Jun 11, 7:56 am, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 11, 6:56 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 10, 3:41 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > > > > On Jun 10, 2:03 am, Rhamphoryncus <[EMAIL PROTECTED]

Re: Producer-consumer threading problem

2008-06-10 Thread Rhamphoryncus
Why not use a normal Queue, put a dummy value (such as None) in when you're producer has finished, and have the main thread use the normal Thread.join() method on all your child threads? -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill a thread?

2008-06-10 Thread Rhamphoryncus
On Jun 10, 3:41 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 10, 2:03 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > So how does .NET deal with the sys.stdout corruption? Does it? > > That has never been an issue for us. Of course. It's far more likely t

Re: Confusion with weakref, __del__ and threading

2008-06-10 Thread Rhamphoryncus
On Jun 10, 8:15 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm baffled with a situation that involves: > 1) an instance of some class that defines __del__, > 2) a thread which is created, started and referenced by that instance, > and > 3) a weakref proxy to the instance that is passed to the t

Re: How to kill a thread?

2008-06-10 Thread Rhamphoryncus
On Jun 10, 1:55 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-09, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]>

Re: How to kill a thread?

2008-06-09 Thread Rhamphoryncus
On Jun 9, 2:52 pm, Fuzzyman <[EMAIL PROTECTED]> wrote: > On Jun 9, 9:20 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > > > > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]&g

Re: How to kill a thread?

2008-06-09 Thread Rhamphoryncus
On Jun 9, 5:33 am, Antoon Pardon <[EMAIL PROTECTED]> wrote: > On 2008-06-07, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > >> It's always been my understanding that you can't forcibl

Re: Trying out safethread patch

2008-06-09 Thread Rhamphoryncus
On Jun 8, 9:55 am, [EMAIL PROTECTED] wrote: > I'd like to take the python-safethread code out for a spin, but I'm not sure > where to start. I downloaded the latest diff: > >http://python-safethread.googlecode.com/files/safethread-bzr-36020.diff > > checked out Python 3.0 from the bzr mirror,

Re: How to kill a thread?

2008-06-06 Thread Rhamphoryncus
On Jun 6, 12:44 pm, The Pythonista <[EMAIL PROTECTED]> wrote: > It's always been my understanding that you can't forcibly kill a thread > in Python (at least not in a portable way). The best you can do is > politely ask it to die, IIRC. Inherently, the best you can do in most languages is ask the

Re: ThreadPoolingMixIn

2008-05-31 Thread Rhamphoryncus
On May 31, 1:40 pm, "Giampaolo Rodola'" <[EMAIL PROTECTED]> wrote: > On 30 Mag, 22:40, [EMAIL PROTECTED] wrote: > > > > > Hi, everybody! > > > I wrote a useful class ThreadPoolingMixIn which can be used to create > > fast thread-based servers. This mix-in works much faster than > > ThreadingMixIn b

Re: ThreadPoolingMixIn

2008-05-31 Thread Rhamphoryncus
On May 30, 2:40 pm, [EMAIL PROTECTED] wrote: > Hi, everybody! > > I wrote a useful class ThreadPoolingMixIn which can be used to create > fast thread-based servers. This mix-in works much faster than > ThreadingMixIn because it doesn't create a new thread on each request. Do you have any benchmark

Re: Threads and import

2008-05-29 Thread Rhamphoryncus
On May 28, 1:14 pm, [EMAIL PROTECTED] wrote: > Hi, > > I'm trying to work out some strange (to me) behaviour that I see when > running a python script in two different ways (I've inherited some > code that needs to be maintained and integrated with another lump of > code). The sample script is: > >

Re: conventions/requirements for 'is' vs '==', 'not vs '!=', etc

2008-05-20 Thread Rhamphoryncus
On May 20, 12:09 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > Intern() is gone in 3.0 But not gone far: >>> import sys >>> sys.intern -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread killing - I know I know!

2008-05-19 Thread Rhamphoryncus
On May 19, 11:31 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On Mon, May 19, 2008 at 11:36 AM, Roger Heathcote > > Fair point, but for sub processes that need to be in close contact with the > > original app, or very small functions that you'd like 100s or 1000s of it > > seems like a kludge ha

Re: waiting on an event blocks all signals

2008-05-18 Thread Rhamphoryncus
On May 18, 9:05 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > alan schrieb: > > > This ignores CTRL-C on every platform I've tested: > > > python -c "import threading; threading.Event().wait()" > > ^C^C^C^C > > > It looks to me like all signals are masked before entering wait(). Can > > someo

Re: threading - race condition?

2008-05-12 Thread Rhamphoryncus
On May 12, 1:31 pm, skunkwerk <[EMAIL PROTECTED]> wrote: > On May 12, 1:40 am, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > > > On May 11, 10:16 am,skunkwerk<[EMAIL PROTECTED]> wrote: > > > > On May 10, 1:31 pm, Dennis Lee Bieber <[EMAIL PROTE

Re: threading - race condition?

2008-05-12 Thread Rhamphoryncus
On May 11, 10:16 am, skunkwerk <[EMAIL PROTECTED]> wrote: > On May 10, 1:31 pm, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > > > > > On Fri, 9 May 2008 08:40:38 -0700 (PDT),skunkwerk<[EMAIL PROTECTED]> > > declaimed the following in comp.lang.python: > > > Coming in late... > > > > On May

Re: Unimport statement

2008-05-11 Thread Rhamphoryncus
On May 11, 2:13 am, Filip Štědronský <[EMAIL PROTECTED]> wrote: > The main problem are references to objects within a module, because > we can NEVER be sure there aren't any, even though we cleaned up > everything, that's just a consequence of Python nature. We can keep > the old objects referenced

Re: Am I missing something with Python not having interfaces?

2008-05-10 Thread Rhamphoryncus
On May 9, 1:53 pm, Daniel Marcel Eichler <[EMAIL PROTECTED]> wrote: > Am Freitag 09 Mai 2008 10:19:45 schrieb Bruno Desthuilliers: > > > >> very often sees do-nothing catch-all try/catch blocks in Java - > > >> which is way worse than just letting the exception propagate. I > > >> find all this tot

Re: Feature suggestion: sum() ought to use a compensated summationalgorithm

2008-05-09 Thread Rhamphoryncus
On May 8, 3:09 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Szabolcs Horvát" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED]| Gabriel Genellina wrote: > > | > > | > Python doesn't require __add__ to be associative, so this should not be > used as a general sum replacement. > | >

Re: FreeBSD KeyboardInterrupt not captured

2008-05-07 Thread Rhamphoryncus
On May 7, 5:00 am, [EMAIL PROTECTED] wrote: > Hi Guys, > > during testing of my project on FreeBSD I've discovered stange > 'feature' of time.sleep(). It works if single thread is running, but > when multi-threaded, the SIGINT signal seems not to be handled in same > way. > > I've found three discu

Re: Decimal vs Float comparasion

2008-05-06 Thread Rhamphoryncus
On May 6, 1:31 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Tue, 6 May 2008 11:52:10 +0800, "Yuan HOng" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > > > It seems to me that rather than allowing this to happen, comparasion > > between the two should either be mad

Re: Feature suggestion: sum() ought to use a compensated summation algorithm

2008-05-05 Thread Rhamphoryncus
On May 3, 4:31 pm, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > On Sat, 2008-05-03 at 21:37 +, Ivan Illarionov wrote: > > On Sat, 03 May 2008 20:44:19 +0200, Szabolcs Horvát wrote: > > > > Arnaud Delobelle wrote: > > > >> sum() works for any sequence of objects with an __add__ method, not >

Re: I just killed GIL!!!

2008-04-18 Thread Rhamphoryncus
On Apr 18, 4:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > On Apr 17, 7:40 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > > I'd love to be wrong about that, but the GIL *has* been the subject of > &g

Re: I just killed GIL!!!

2008-04-17 Thread Rhamphoryncus
On Apr 17, 11:05 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 17, 6:03 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > Interesting. Windows specific, but there's other ways to do the same > > thing more portably. > > I believe you can compile Py

Re: I just killed GIL!!!

2008-04-17 Thread Rhamphoryncus
On Apr 17, 7:40 am, Steve Holden <[EMAIL PROTECTED]> wrote: > I'd love to be wrong about that, but the GIL *has* been the subject of > extensive efforts to kill it over the last five years, and it has > survived despite the best efforts of the developers. Yo. http://code.google.com/p/python-safet

Re: I just killed GIL!!!

2008-04-17 Thread Rhamphoryncus
On Apr 17, 9:19 am, sturlamolden <[EMAIL PROTECTED]> wrote: > On 17 Apr, 10:25, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > > help progress at all. I think neither was the case in this thread - > > the guy claimed that he actually did something about the GIL, and > > now we are all waiting for

Re: py3k s***s

2008-04-16 Thread Rhamphoryncus
On Apr 16, 12:52 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Apr 16, 2:33 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > The point is, you can't have it both ways. Either you evolve the > > language and break things, or you keep it static and nothing b

Re: py3k s***s

2008-04-16 Thread Rhamphoryncus
On Apr 16, 12:10 pm, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Apr 16, 1:42 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > The only reason to not make the > > changes is that old, crufty, unmaintained libraries & applications > > might depend on th

Re: py3k s***s

2008-04-16 Thread Rhamphoryncus
On Apr 16, 10:40 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > On Apr 16, 12:27 pm, Rhamphoryncus <[EMAIL PROTECTED]> wrote: > > > On Apr 16, 6:56 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > > > > I don't get it. It ain't broke. Don'

Re: py3k s***s

2008-04-16 Thread Rhamphoryncus
On Apr 16, 6:56 am, Aaron Watters <[EMAIL PROTECTED]> wrote: > I don't get it. It ain't broke. Don't fix it. So how would you have done the old-style class to new-style class transition? -- http://mail.python.org/mailman/listinfo/python-list

Re: C API design flaw (was: Re: Multiple independent Python interpreters in a C/C++ program?)

2008-04-13 Thread Rhamphoryncus
On Apr 12, 2:02 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > On Apr 12, 7:05 pm, sturlamolden <[EMAIL PROTECTED]> wrote: > > > In theory, a GIL private to each (sub)interpreter would make Python > > more scalable. The current GIL behaves like the BKL in earlier Linux > > kernels. However, some thi

Re: Tremendous slowdown due to garbage collection

2008-04-13 Thread Rhamphoryncus
On Apr 12, 6:58 pm, Steve Holden <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Steve Holden <[EMAIL PROTECTED]> writes: > >> I believe you are making surmises outside your range of competence > >> there. While your faith in the developers is touching, the garbage > >> collection scheme is some

Re: Multiple independent Python interpreters in a C/C++ program?

2008-04-12 Thread Rhamphoryncus
On Apr 11, 10:24 am, [EMAIL PROTECTED] wrote: > This question was posed to me today. Given a C/C++ program we can clearly > embed a Python interpreter in it. Is it possible to fire up multiple > interpreters in multiple threads? For example: > > C++ main > thread 1 > Py_I

Re: bsddb3 thread problem

2008-04-01 Thread Rhamphoryncus
On Apr 1, 1:29 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > In my application I am trying to access(read) a DB thru a thread while > my main thread is adding data to it and it gives following error(s) > > bsddb._db.DBRunRecoveryError: (-30974, 'DB_RUNRECOVERY: Fatal error, > run database re

Re: Article of interest: Python pros/cons for the enterprise

2008-02-23 Thread Rhamphoryncus
On Feb 23, 11:39 am, Nicola Musatti <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Nicola Musatti <[EMAIL PROTECTED]> writes: > >>>a = [f(x) + g(y) for x,y in izip(m1, m2) if h(x,y).frob() == 7] > [...] > > There you replace one line of code with 40+ lines to get around the > > absence of G

Re: Multiple interpreters retaining huge amounts of memory

2008-02-07 Thread Rhamphoryncus
On Feb 2, 10:32 pm, Graham Dumpleton <[EMAIL PROTECTED]> wrote: > The multi interpreter feature has some limitations, but if you know > what you are doing and your application can be run within those > limitations then it works fine. I've been wondering about this for a while. Given the severe li

Re: super, decorators and gettattribute

2008-01-15 Thread Rhamphoryncus
ed. Don't think of them as mappings. Think of them as a way for a class to hook into getattr's protocol, conveniently named similar to getattr (__getattr__ and __getattribute__). getattr() may call several methods, no methods at all, change the arguments, etc. Although len() may seem simple, many others are not so simple. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >