Re: Simple thread-safe counter?

2005-04-01 Thread Tim Peters
[Paul Rubin] I'd like to have a function (or other callable object) that returns 0, 1, 2, etc. on repeated calls. That is: print f() # prints 0 print f() # prints 1 print f() # prints 2 # etc. There should never be any possibility of any number getting returned twice,

Re: property and virtuality

2005-04-01 Thread Michele Simionato
Diez B. Roggisch: On second thoughts, a metaclass _might_ help here - but it would be rather elaborate: look in the baseclasses for properties that have getters and setters of the same name as some methods in the current class, and replace them, or create a new property with them (I'm not

Re: Simple thread-safe counter?

2005-04-01 Thread Skip Montanaro
Paul I'd like to have a function (or other callable object) that Paul returns 0, 1, 2, etc. on repeated calls. ... Paul There should never be any possibility of any number getting Paul returned twice, or getting skipped over, even if f is being called Paul from multiple

Re: Simple thread-safe counter?

2005-04-01 Thread Paul Rubin
Tim Peters [EMAIL PROTECTED] writes: The GIL is your friend here: import itertools f = itertools.count().next Thanks, I was hoping something like this would work but was not sure I could rely on it. A similar thing can be done with xrange. But either way sucks if you call it

Re: Lambda: the Ultimate Design Flaw

2005-04-01 Thread Steve Holden
Aahz wrote: In article [EMAIL PROTECTED], =?iso-8859-1?Q?Fran=E7ois?= Pinard [EMAIL PROTECTED] wrote: [Sunnan] [...] for Pythons ideal of having one canonical, explicit way to program. No doubt it once was true, but I guess this ideal has been abandoned a few years ago. My honest feeling is that

Re: Lambda: the Ultimate Design Flaw

2005-04-01 Thread Steve Holden
alex goldman wrote: Daniel Silva wrote: At any rate, FOLD must fold. I personally think GOTO was unduly criticized by Dijkstra. With the benefit of hindsight, we can see that giving up GOTO in favor of other primitives failed to solve the decades-old software crisis. What software crisis? Knuth

Re: Queue.Queue-like class without the busy-wait

2005-04-01 Thread Nick Craig-Wood
Paul Rubin http wrote: Antoon Pardon [EMAIL PROTECTED] writes: I'm not sure that this would be an acceptable approach. I did the man semop and it indicates this is part of system V IPC. This makes me fear that semaphores will use file descriptors or other resources that are only

Re: that is it is not it (logic in Python)

2005-04-01 Thread Steve Holden
F. Petitjean wrote: [...] *I* wrote the original post. and am pretty sure it is not faked. And I run it before posting to be sure not to say anything wrong. it is a kind of relief to learn that computers in 2005 (even Python powered) are humor-impaired and follow the « ref manual » every time

Re: Installing Python on a Windows 2000 Server

2005-04-01 Thread Steve Holden
Mike Moum wrote: Hi, I'm a civil engineer who also doubles as chief programmer for technical applications at my company. Most of our software is written in Visual Basic because our VP in charge of I.T. likes to have consistency, and at the moment we're a Microsoft shop. He has assigned me the

Re: Translation review?

2005-04-01 Thread Michele Simionato
This is spectacular! :) Is there a way to make it to work from environments (such as emacs) where stdin is special? Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: How To Do It Faster?!?

2005-04-01 Thread Simo Melenius
[EMAIL PROTECTED] writes: Every user of thsi big directory works on big studies regarding oil fields. Knowing the amount of data (and number of files) we have to deal with (produced by simulators, visualization tools, and so on) and knowing that users are usually lazy in doing clean up of

Re: Queue.Queue-like class without the busy-wait

2005-04-01 Thread Paul Rubin
Nick Craig-Wood [EMAIL PROTECTED] writes: I believe futex is the thing you want for a modern linux. Not very portable though. That's really cool, but I don't see how it can be a pure userspace operation if the futex has a timeout. The kernel must need to keep track of the timeouts. However,

Re: Simple thread-safe counter?

2005-04-01 Thread Artie Gold
Skip Montanaro wrote: Paul I'd like to have a function (or other callable object) that Paul returns 0, 1, 2, etc. on repeated calls. ... Paul There should never be any possibility of any number getting Paul returned twice, or getting skipped over, even if f is being called

Re: Grouping code by indentation - feature or ******?

2005-04-01 Thread Javier Bezos
Steve Holden [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] [Discussion on Python slices and the off-by-one issue deleted] While this may be an interesting philosophical (or should that be philological) discussion, since Python has worked this way for donkey's years, and

Re: Attributes and built-in types

2005-04-01 Thread Martin v. Löwis
Dave Opstad wrote: Is it just an implementation limitation that attributes cannot be assigned to instances of internal types? No, not just. Some types have a fixed set of attributes by design, whereas others allow addition of attributes. There are several reasons for this design. Performance is

[ python-Bugs-1174712 ] subclassing ModuleType and another built-in type

2005-04-01 Thread SourceForge.net
Bugs item #1174712, was opened at 2005-04-01 09:22 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1174712group_id=5470 Category: Python Interpreter Core Group: None Status: Open

[ python-Bugs-1174606 ] Reading /dev/zero causes SystemError

2005-04-01 Thread SourceForge.net
Bugs item #1174606, was opened at 2005-04-01 04:48 Message generated for change (Comment added) made by arigo You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1174606group_id=5470 Category: Python Interpreter Core Group: None Status: Open Resolution: None

[ python-Bugs-1173637 ] quit should quit

2005-04-01 Thread SourceForge.net
Bugs item #1173637, was opened at 2005-03-30 23:37 Message generated for change (Comment added) made by sjoerd You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1173637group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5

[ python-Bugs-1174795 ] PYTHONPATH is not working

2005-04-01 Thread SourceForge.net
Bugs item #1174795, was opened at 2005-04-01 15:49 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1174795group_id=5470 Category: Windows Group: Python 2.4 Status: Open

[ python-Bugs-1174795 ] PYTHONPATH is not working

2005-04-01 Thread SourceForge.net
Bugs item #1174795, was opened at 2005-04-01 21:49 Message generated for change (Comment added) made by quiver You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1174795group_id=5470 Category: Windows Group: Python 2.4 Status: Open Resolution: None Priority:

[ python-Bugs-1173637 ] quit should quit

2005-04-01 Thread SourceForge.net
Bugs item #1173637, was opened at 2005-03-30 16:37 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1173637group_id=5470 Category: None Group: None Status: Open Resolution: None Priority: 5

[ python-Bugs-997100 ] optparse.py:668 triggers FutureWarning

2005-04-01 Thread SourceForge.net
Bugs item #997100, was opened at 2004-07-24 10:20 Message generated for change (Comment added) made by hydrian You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=997100group_id=5470 Category: Python Library Group: Python 2.3 Status: Closed Resolution: Fixed

[ python-Bugs-1175022 ] property example code error

2005-04-01 Thread SourceForge.net
Bugs item #1175022, was opened at 2005-04-01 20:09 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1175022group_id=5470 Category: Documentation Group: Python 2.4 Status: Open

[ python-Bugs-1174795 ] PYTHONPATH is not working

2005-04-01 Thread SourceForge.net
Bugs item #1174795, was opened at 2005-04-01 04:49 Message generated for change (Comment added) made by bcannon You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1174795group_id=5470 Category: Windows Group: Python 2.4 Status: Closed Resolution: Invalid

[ python-Bugs-1170424 ] why should URL be required for all packages

2005-04-01 Thread SourceForge.net
Bugs item #1170424, was opened at 2005-03-25 10:58 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1170424group_id=5470 Category: Distutils Group: None Status: Closed Resolution: Invalid Priority:

[ python-Bugs-1169633 ] Install fail code 2932 after fail to copy python_icon.exe

2005-04-01 Thread SourceForge.net
Bugs item #1169633, was opened at 2005-03-24 05:04 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1169633group_id=5470 Category: Installation Group: Python 2.4 Status: Open Resolution: None

[ python-Bugs-1167262 ] Fails assertion in winsig.c under VC 8.0

2005-04-01 Thread SourceForge.net
Bugs item #1167262, was opened at 2005-03-21 04:25 Message generated for change (Comment added) made by loewis You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=1167262group_id=5470 Category: Python Library Group: Python 2.5 Status: Open Resolution: None

[ python-Bugs-997100 ] optparse.py:668 triggers FutureWarning

2005-04-01 Thread SourceForge.net
Bugs item #997100, was opened at 2004-07-24 11:20 Message generated for change (Comment added) made by gward You can respond by visiting: https://sourceforge.net/tracker/?func=detailatid=105470aid=997100group_id=5470 Category: Python Library Group: Python 2.3 Status: Closed Resolution: Fixed

<    1   2   3