Re: Documentation suggestions

2005-12-06 Thread Rhamphoryncus
than calling them expressions and linking to CPython's Grammar file? -- Adam Olsen, aka Rhamphoryncus [0] Colors pulled off the top of my head -- http://mail.python.org/mailman/listinfo/python-list

Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-17 Thread Rhamphoryncus
the all important one, can I get it in to python core? 0.5 wink -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Proposal for adding Shallow Threads and a Main Loop to Python

2005-03-17 Thread Rhamphoryncus
and event notifiers. Otherwise I'd just use blocking calls in real threads, or maybe just twisted, and not bother creating anything new, ya know? -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Using weakrefs instead of __del__

2005-04-06 Thread Rhamphoryncus
without that problem. * I've no idea what will happen when the interpreter exits, but I don't imagine it would matter much for most uses. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

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

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 GC. Sounds

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 recovery

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

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 something that has

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 third-party

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: 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't fix it. So how would you have done the old-style class to new-style

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 them somehow. If that's more important to you, what

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 breaks. I disagree. You can add lots

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 him to also

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.

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 Python as a shared object (.so) on Linux as well

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 extensive efforts to kill it over the last five years

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 just

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 made correct (by

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 discussion

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. | | It does not

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 totally pointless,

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 and

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 9, 12:12 am, John

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 PROTECTED] wrote: On Fri, 9 May 2008 08:40:38 -0700 (PDT),skunkwerk

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 a

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 properly

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 our new

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 objects.

Re: 2.6, 3.0, and truly independent intepreters

2008-10-23 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 don't

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, but of

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-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 be shareable.  A module and its

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: On approximately 10/23/2008 12:24 AM, came the following

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 arbitrary values to be stored in them. What

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 answers for

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 topic keeps

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 than hacking all of CPython. Did anyone

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 it's the

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 someone familiar with

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 having to

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 built-in function intern -- http://mail.python.org/mailman/listinfo/python-list

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: 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 benchmarks

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 because it

Re: How to kill a thread?

2008-06-07 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 them

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, then

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 forcibly kill a thread in Python (at least not in a portable way

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] wrote: On Jun 6, 12:44 pm, The Pythonista [EMAIL PROTECTED] wrote

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] wrote: On Jun 6, 12:44 pm, The Pythonista [EMAIL PROTECTED] wrote

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 thread

Re: How to kill a thread?

2008-06-11 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 to hit the underlying blocked I/O than

Re: Producer-consumer threading problem

2008-06-11 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-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] wrote: How does that protect code like this? f = open('somefile

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 the normal Thread.join() method on all your

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 until it returns. Ah

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: I'm not saying it can't be made to work in your specific case

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 [EMAIL PROTECTED] wrote: The trick here is that calling proxy.sleep(0.01

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 that

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 probably

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.dnsalias.org/~dstromberg/pypty/), but I'm

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 thread to

Idea for joined() builtin

2007-08-16 Thread Rhamphoryncus
characteristics. Get them confused or attempt to over- generalize and you will be bitten. [1] Math/crypto has some exceptions. Stop mentally poking holes in my argument. :) -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: removeall() in list

2008-01-12 Thread Rhamphoryncus
On Jan 12, 1:37 am, [EMAIL PROTECTED] wrote: On Jan 11, 8:04 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: [EMAIL PROTECTED] writes: Could you: lockerA= Locker( listA, listB ) lockerA.op( listB.reverse ) lockerA.op( listA.pop ) Where lockerA ops acquire the locks on all its

Re: super, decorators and gettattribute

2008-01-15 Thread Rhamphoryncus
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

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 with

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: --- BEGIN ---

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

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 two different

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 is the burden of the

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 actively

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. importthreading

Re: Python Interview Questions

2007-10-31 Thread Rhamphoryncus
for sequences. If it's mutable, use .append(). If it's immutable, build up in a mutable sequence, then convert. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Populating huge data structures from disk

2007-11-07 Thread Rhamphoryncus
, as unused portions of a long-running program may get swapped out. Also note that poking need only touch 1 byte per page, much cheaper than copying the entire page (so long as the page is already loaded from disk.) -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo

Re: Confused about closures and scoping rules

2007-11-07 Thread Rhamphoryncus
return bar Obviously, bar can't be set until after the function object is created. Showing changes also matches the behaviour of globals, which is a good thing IMO. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python as primary language

2007-11-09 Thread Rhamphoryncus
approach to solving these problems: http://code.google.com/p/python-safethread/ -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python as primary language

2007-11-09 Thread Rhamphoryncus
, and there's a lot that can give good performance, but at this point they all offer poor to moderate usability, none having good usability. The crux of the multicore crisis is that lack of good usability. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python as primary language

2007-11-12 Thread Rhamphoryncus
On Nov 12, 2:28 am, Martin Vilcans [EMAIL PROTECTED] wrote: On Nov 10, 2007 12:48 AM, Rhamphoryncus [EMAIL PROTECTED] wrote: On Nov 9, 1:45 pm, Terry Reedy [EMAIL PROTECTED] wrote: 2. If micro-locked Python ran, say, half as fast, then you can have a lot of IPC (interprocess communition

Re: Troubleshooting garbage collection issues

2007-11-18 Thread Rhamphoryncus
. A refcounting error is the first thing that comes to mind, although I can't see off hand how this specific problem would come about. Are you using threading at all? Do you see any pattern to the types that have the bogus pointers? -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org

Re: Decorating class member functions

2007-05-04 Thread Rhamphoryncus
many times. I had no idea there was a direct solution. Thanks! -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread-safety of dict

2007-06-01 Thread Rhamphoryncus
when the total number of active+dummy slots exceeds 2/3rds it will trigger a resize (to the same size or even a smaller size!) so as to clear out all the dummy slots (letting lookups finish sooner). -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: tuples, index method, Python's design

2007-04-13 Thread Rhamphoryncus
value ≤ grapheme cluster ~ character ≤ syllable ≤ word ≤ sentence ≤ paragraph 12 in 123 allows you to handle bytes through scalar values the same way, glossing over the implementation details (such as UTF-32 on linux and UTF-16 on windows). -- Adam Olsen, aka Rhamphoryncus -- http

Re: tuples, index method, Python's design

2007-04-14 Thread Rhamphoryncus
On Apr 13, 11:05 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Rhamphoryncus [EMAIL PROTECTED] writes: i = s.index(e) = s[i] = e Then this algorithm is no longer guaranteed to work with strings. It never worked correctly on unicode strings anyway (which becomes the canonical string

Re: tuples, index method, Python's design

2007-04-15 Thread Rhamphoryncus
On Apr 14, 11:59 am, Paul Rubin http://[EMAIL PROTECTED] wrote: Rhamphoryncus [EMAIL PROTECTED] writes: Nope, it's pretty fundamental to working with text, unicode only being an extreme example: there's a wide number of ways to break down a chunk of text, making the odds of e being any

Re: tuples, index method, Python's design

2007-04-15 Thread Rhamphoryncus
On Apr 15, 1:55 am, Paul Rubin http://[EMAIL PROTECTED] wrote: Rhamphoryncus [EMAIL PROTECTED] writes: Indexing cost, memory efficiency, and canonical representation: pick two. You can't use a canonical representation (scalar values) without some sort of costly search when indexing (O(log

Re: tuples, index method, Python's design

2007-04-15 Thread Rhamphoryncus
On Apr 15, 8:56 am, Roel Schroeven [EMAIL PROTECTED] wrote: Paul Rubin schreef: Rhamphoryncus [EMAIL PROTECTED] writes: Indexing cost, memory efficiency, and canonical representation: pick two. You can't use a canonical representation (scalar values) without some sort of costly search

Re: Python's handling of unicode surrogates

2007-04-20 Thread Rhamphoryncus
(surrogates, 4 byte UTF-8 sequences) for Scintilla, a text editing component. I dream of a day when complete unicode support is universal. With enough effort we may get there some day. :) -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's handling of unicode surrogates

2007-04-20 Thread Rhamphoryncus
, yes. One character, two code units. The only code that will be changed is that which doesn't handle surrogates properly. Some will start working properly. Some (ie random.choice(u'\U0010\u')) will fail explicitly (rather than silently). -- Adam Olsen, aka Rhamphoryncus -- http

Re: Python's handling of unicode surrogates

2007-04-20 Thread Rhamphoryncus
On Apr 20, 5:49 pm, Ross Ridge [EMAIL PROTECTED] wrote: Rhamphoryncus [EMAIL PROTECTED] wrote: The only code that will be changed is that which doesn't handle surrogates properly. Some will start working properly. Some (ie random.choice(u'\U0010\u')) will fail explicitly (rather

Re: Python's handling of unicode surrogates

2007-04-20 Thread Rhamphoryncus
I'd be lying if I said I supported Unicode if I only handled the BMP. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: do people really complain about significant whitespace?

2006-08-10 Thread Rhamphoryncus
Stephen Kellett wrote: function() loop1() blah blah loop2() blah loop3() blah blah3 otherloop()

Re: Python share CPU time?

2006-08-10 Thread Rhamphoryncus
Yannick wrote: Hi, I would like to program a small game in Python, kind of like robocode (http://robocode.sourceforge.net/). Problem is that I would have to share the CPU between all the robots, and thus allocate a time period to each robot. However I couldn't find any way to start a thread

istep() addition to itertool? (Was: Re: Printing n elements per line in a list)

2006-08-19 Thread Rhamphoryncus
unexpected wrote: If have a list from 1 to 100, what's the easiest, most elegant way to print them out, so that there are only n elements per line. I've run into this problem a few times, and although many solutions have been presented specifically for printing I would like to present a more

Re: sum and strings

2006-08-19 Thread Rhamphoryncus
Bill Pursell wrote: Georg Brandl wrote: Paul Rubin wrote: Sybren Stuvel [EMAIL PROTECTED] writes: Because of there should only be one way to do it, and that way should be obvious. There are already the str.join and unicode.join methods, Those are obvious??? Why would you try

Re: sum and strings

2006-08-20 Thread Rhamphoryncus
Paddy wrote: Rhamphoryncus wrote: It's worthwhile to note that the use of + as the concatenation operator is arbitrary. It could just have well been | or , and has no relationship with mathematically addition. The effect of the string concatenation operator is only secondary

Re: Is LOAD_GLOBAL really that slow?

2007-08-30 Thread Rhamphoryncus
that a python dictionary lookup can have less cost than two simple array indexes, but there you go. Python dictionaries are already damn fast. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Is LOAD_GLOBAL really that slow?

2007-08-30 Thread Rhamphoryncus
On Aug 30, 12:04 pm, Chris Mellon [EMAIL PROTECTED] wrote: On 8/30/07, Rhamphoryncus [EMAIL PROTECTED] wrote: On Aug 29, 8:33 pm, Carsten Haese [EMAIL PROTECTED] wrote: On Wed, 2007-08-29 at 19:23 -0600, Adam Olsen wrote: There is no loop overhead here, and after subtracting the function

Re: concise code (beginner)

2007-09-07 Thread Rhamphoryncus
semantics. -- Adam Olsen, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

Re: Using fractions instead of floats

2007-10-02 Thread Rhamphoryncus
, aka Rhamphoryncus -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >