Re: wxPython - drawing without paint event

2007-08-11 Thread 7stud
On Aug 11, 7:59 pm, [EMAIL PROTECTED] wrote: > On Aug 11, 3:31 am, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > On a related topic, it seems like it would be nice to do *all* > > > drawing in > > > response topaintevents. When I get aneventfrom the timer,

Re: python + XUL

2007-08-11 Thread Stefan Behnel
Madhu Alagu wrote: > Hi > > > > Python + XUL Success Stories > > > > > Thanks > > Madhu Alagu Any chance you forgot to ask a question? Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: LRU cache?

2007-08-11 Thread Alex Martelli
Paul Rubin wrote: > Anyone got a favorite LRU cache implementation? I see a few in google > but none look all that good. I just want a dictionary indexed by > strings, that remembers the last few thousand entries I put in it. So what's wrong with Evan Prodromou's lruc

Database intensive application

2007-08-11 Thread Rohit
I am a novice. I want to know whether Python can be used to develop client/server database and web applications like .NET. Which is the best book/source to learn Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: is there anybody using __del__ correctly??

2007-08-11 Thread Michele Simionato
On Aug 10, 7:09 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > There were also a few recipes posted during this discussion that wrap > weakrefs up a bit nicer so it's easier to use them in place of __del__: > > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/519635 I knew about your recip

python + XUL

2007-08-11 Thread Madhu Alagu
Hi Python + XUL Success Stories Thanks Madhu Alagu -- http://mail.python.org/mailman/listinfo/python-list

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 11, 2:50 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > So why is the destructor not called when the generator is even > explicitly 'del'ed? Does somebody else still hold a reference on it? You ( we ) have produced a reference cycle. In that case __del__ doesn't work properly ( according t

Re: Web based Reporting tool for Python

2007-08-11 Thread Madhu Alagu
On Aug 8, 4:57 pm, Jon Rosebaugh <[EMAIL PROTECTED]> wrote: > On 2007-08-07 23:35:26 -0500, Madhu Alagu <[EMAIL PROTECTED]> said: > > > Thanking so much for all the informations and links.I would like to > > use Mako Templates(www.makotemplates.org).Ilike to use simple and > > python default module

Re: Module imports during object instantiation

2007-08-11 Thread Ritesh Raj Sarraf
On Aug 11, 3:17 am, James Stroud <[EMAIL PROTECTED]> wrote: > You do realize your import statement will only be called for nt and dos > systems don't you? > Yes. I would like to load a Windows Python Module (which is, say a specific implementation for Windows only) in such a condition where I find

Re: python 2.5 bug

2007-08-11 Thread Dustan
On Aug 11, 12:32 am, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > 4. don't do something you don't fully understand (in this case >installing Python 2.5 and uninstalling Python 2.4) If we were all limited by that rule, none of us would never have used a computer in the first place. Operating a c

Re: wxPython - drawing without paint event

2007-08-11 Thread glenn . chappell
On Aug 11, 3:31 am, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > On a related topic, it seems like it would be nice to do *all* > > drawing in > > response topaintevents. When I get aneventfrom the timer, I > > would just tell wx that part of the window needs redrawing, and > > depen

Pausing and Unpausing Threads

2007-08-11 Thread Aaron J. M.
Hello, This is a question about how to pause and unpause threads (as the title suggests). I've created an extension of threading.Thread which I'll call Server. Server has a collection of Controlers. A Controler has a method turn(), which lets it do various interesting things. While the Server i

Re: Something in the function tutorial confused me.

2007-08-11 Thread Alex Martelli
Neil Cerutti <[EMAIL PROTECTED]> wrote: ... > OK, I've thought about this some more and I think the source of > my confusion was I thought assignment in Python meant binding a > name to something, not mutating an object. But in the case of > augmented assignment, assignment no longer means that?

New Programms for free

2007-08-11 Thread Hasipups
http://www.pennergame.de/ref.php?uid=5572 -- http://mail.python.org/mailman/listinfo/python-list

Binary, Hex, and Decimal string conversions

2007-08-11 Thread Robert Dailey
Hi, I was wondering if there is a built in module that supports conversion in any direction between Binary, Hex, and Decimal strings? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

C++ Runtime Library error message - Pythonwin?

2007-08-11 Thread goldtech
Hi, Doing GIS [Geographic Information Systems] scripts. I was running a batch clip script that worked OK for 126 iterations then I got the following message: "Microsoft Visual C++ Runtime Library program: C:\python21\pythonwin\pythonwin.exe This application has requested the runtime to termi

Threading problem when many sockets open

2007-08-11 Thread Philip Zigoris
Hi all, I have written a socket based service in python and under fairly heavy traffic it performs really well. But i have encountered the following problem: when the system runs out of file descriptors, it seems to stop switching control between threads. Here is some more detail: The system ha

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-11 Thread Greg Donald
On 8/11/07, Robert Dailey <[EMAIL PROTECTED]> wrote: > I had this very same problem with the doxygen mailing list... doxygen is > such a great tool but full of assholes in their mailing list. I'm not defending any assholes you may have ran into, but I find the thing to do is only ask questions in

Re: The Future of Python Threading

2007-08-11 Thread Ant
On Aug 11, 5:43 am, Seun Osewa <[EMAIL PROTECTED]> wrote: > > I think I've heard Guido say the last attempt at removing the Global > > Interpreter Lock (GIL) resulted in a Python that was much slower... > > What is it about Python that makes a thread-safe CPython version much > slower? Why doesn't

Re: Something in the function tutorial confused me.

2007-08-11 Thread Neil Cerutti
> On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Neil Cerutti <[EMAIL PROTECTED]> wrote: >>... >>> The Python Language Reference seems a little confused about >>> the terminology. >>> >>> 3.4.7 Emulating numeric types >>> 6.3.1 Augmented assignment statements >>> >>> The forme

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-11 Thread Robert Dailey
I had this very same problem with the doxygen mailing list... doxygen is such a great tool but full of assholes in their mailing list. On 8/2/07, Jamie <[EMAIL PROTECTED]> wrote: > > In <[EMAIL PROTECTED]>, > [EMAIL PROTECTED] mentions: > >Python is a better language, with php support, anyway, but

Re: The Future of Python Threading

2007-08-11 Thread Ben Sizer
On Aug 10, 5:13 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 8/10/07, Ben Sizer <[EMAIL PROTECTED]> wrote: > > > On 10 Aug, 15:38, Ben Finney <[EMAIL PROTECTED]> > > wrote: > > > Last I checked, multiple processes can run concurrently on multi-core > > > systems. That's a well-established way

Re: python 2.5 bug

2007-08-11 Thread Thorsten Kampe
* (Sat, 11 Aug 2007 12:50:38 -0700) > On 11 kol, 20:58, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > > * Laurent Pointal (Sat, 11 Aug 2007 20:09:03 +0200) > > > [EMAIL PROTECTED] wrote: > > > > On 11 kol, 11:59, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > > >> On Sat, 11 Aug 2007 02:41

Re: The Future of Python Threading

2007-08-11 Thread Bjoern Schliessmann
Nick Craig-Wood wrote: > Bjoern Schliessmann <[EMAIL PROTECTED]> >> So, how much performance gain would you get? Again, managing >> fine-grained locking can be much more work than one simple lock. > > Assuming that you are not IO bound, but compute bound and that > compute is being done in pyth

Re: python 2.5 bug

2007-08-11 Thread Bjoern Schliessmann
Thorsten Kampe wrote: > Yeah. Did the Original Poster mention any details about his > problem. Like - for instance - that he's using Windows? Don't you know the empiric law of platforms? :) "Users who ask about OS specific problems and not state their platform are Windows users." Regards, Björ

Re: Public Telnet Server?

2007-08-11 Thread Bjoern Schliessmann
Dave wrote: > Hi there. I'm a beginner at Python and I'm writing my first Python > script. It's a text adventure about coffee and mixing drinks and > being crazy and such. I keep updating it and want my friends to > beta test it for me, but some of them don't have the right version > of Python or

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Bjoern Schliessmann
Adam W. wrote: > Why in the world does str() have any business rounding my numbers, You are at the floating point numbers precision limit. Using str, numbers are rounded to your machine's float precision in decimal notation. Since floats are internally represented in binary notation of constant p

Re: Something in the function tutorial confused me.

2007-08-11 Thread David Wahler
On 8/11/07, Gregory D. Weber <[EMAIL PROTECTED]> wrote: > I too thought += was an assignment. And it bit me very painfully a few weeks > ago. > > If it's an assignment, then wouldn't "x += y" mean the same thing as "x = x + > y"? > > If so, why does an assignment to variable a, below, have the *

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread John Machin
On Aug 12, 5:37 am, Zentrader <[EMAIL PROTECTED]> wrote: > On Aug 11, 9:40 am, "Adam W." <[EMAIL PROTECTED]> wrote: > > > After a fair amount of troubleshooting of why my lists were coming > > back a handful of digits short, and the last digit rounded off, I > > determined the str() function was to

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Roel Schroeven <[EMAIL PROTECTED]> wrote: > >I used to interpret the target in 'The target is only evaluated once' >more like an L-value in C/C++. That's not correct, of course, but I >didn't understand exactly how wrong it was until now. It's true almost everywh

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, OKB (not okblacke) <[EMAIL PROTECTED]> wrote: > > This sentence is phrased as though it is the whole story, but it >isn't, because the operation might not in fact wind up being an >assignment. Shouldn't there be an "except see below" or something >there, to

Re: Metaclass v.s. Property function.

2007-08-11 Thread Dustan
On Aug 11, 7:33 am, Jens Thiede <[EMAIL PROTECTED]> wrote: > I don't like the property function, usable in the new-style classes, > because having to remember to manage a list of "foo = property(...)" > assignments just plain sucks, so I wrote a metaclass that does things > a little differently. Pl

Re: Something in the function tutorial confused me.

2007-08-11 Thread Roel Schroeven
Gregory D. Weber schreef: > Neil Cerutti wrote: >> On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote: >>> Neil Cerutti <[EMAIL PROTECTED]> wrote: >>>... The Python Language Reference seems a little confused about the terminology. 3.4.7 Emulating numeric types 6

Re: Something in the function tutorial confused me.

2007-08-11 Thread Gregory D. Weber
Neil Cerutti wrote: > On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Neil Cerutti <[EMAIL PROTECTED]> wrote: >>... >>> The Python Language Reference seems a little confused about the >>> terminology. >>> >>> 3.4.7 Emulating numeric types >>> 6.3.1 Augmented assignment statements

SUCK my HUSBAND'S CUM from my CUNT

2007-08-11 Thread Tony
-- http://mail.python.org/mailman/listinfo/python-list

SUCK my HUSBAND'S CUM from my CUNT

2007-08-11 Thread Tony
-- http://mail.python.org/mailman/listinfo/python-list

Re: python 2.5 bug

2007-08-11 Thread vedrandekovic
On 11 kol, 20:58, Thorsten Kampe <[EMAIL PROTECTED]> wrote: > * Laurent Pointal (Sat, 11 Aug 2007 20:09:03 +0200) > > > [EMAIL PROTECTED] wrote: > > > On 11 kol, 11:59, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > > >> On Sat, 11 Aug 2007 02:41:26 -0700, vedrandekovic wrote: > > >> > I wa

ANN: Compyler 0.1

2007-08-11 Thread Grant Olson
Compyler is a pre-alpha x86 native code compiler. So far it can generate primitive .pyds but not standalone executables. It can run some simple test cases including pystones (although there is a memory leak there). And no, I don't expect it'll ever be much faster than Cpython . I was primarily i

Re: Ligmail bug?

2007-08-11 Thread Steve Holden
No.23 wrote: [way too much, ending with] >File "/usr/local/lib/python2.5/urllib2.py", line 1076, in do_open > raise URLError(err) > urllib2.URLError: resolution')> > > > other information: > Shell:~ >: uname -a > OpenBSD ob41.org 4.1 ob41#0 i386 > Shell:~ >: python > Python 2.5 (r25:51

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Zentrader
On Aug 11, 9:40 am, "Adam W." <[EMAIL PROTECTED]> wrote: > After a fair amount of troubleshooting of why my lists were coming > back a handful of digits short, and the last digit rounded off, I > determined the str() function was to blame: > > >>> foonum > > 0.0071299720384678782 > > >>> str(foonum

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Steve Holden
Roel Schroeven wrote: > Adam W. schreef: >> After a fair amount of troubleshooting of why my lists were coming >> back a handful of digits short, and the last digit rounded off, I >> determined the str() function was to blame: >> > foonum >> 0.0071299720384678782 > str(foonum) >> '0.0071299

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 17:10:05 +, Adam W. wrote: > On Aug 11, 12:53 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> If `str()` would not round you would get very long numbers because of the >> inaccuracies of floating point values. I know Python is lying when 0.1 >> prints as 0.1, bu

Re: python 2.5 bug

2007-08-11 Thread Thorsten Kampe
* Laurent Pointal (Sat, 11 Aug 2007 20:09:03 +0200) > [EMAIL PROTECTED] wrote: > > On 11 kol, 11:59, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Sat, 11 Aug 2007 02:41:26 -0700, vedrandekovic wrote: > >> > I was install Python 2.5 and uninstall Python 2.4 now I cannot run my > >> >

Re: decorators - more than just syntactic sugar

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 20:30:54 +0200, Helmut Jarausch wrote: > are decorators more than just syntactic sugar in python 2.x and what > about python 3k ? They are just syntactic sugar. @spam def ham(): pass is the same as def ham(): pass ham = spam(ham) > How can I find out the predefine

decorators - more than just syntactic sugar

2007-08-11 Thread Helmut Jarausch
Hi, are decorators more than just syntactic sugar in python 2.x and what about python 3k ? How can I find out the predefined decorators? Many thanks for your help, Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany -- http://mail.python.org/ma

Re: python 2.5 bug

2007-08-11 Thread Laurent Pointal
[EMAIL PROTECTED] wrote: > On 11 kol, 11:59, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Sat, 11 Aug 2007 02:41:26 -0700, vedrandekovic wrote: >> > I was install Python 2.5 and uninstall Python 2.4 now I cannot run my >> > scripts, only from idle >> >> > What should I do? >> >> Inst

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Roel Schroeven
OKB (not okblacke) schreef: > Aahz wrote: > >>> tup=([],) >>> tup[0] += ['zap'] Traceback (most recent call last): File "", line 1, in TypeError: 'tuple' object does not support item assignment > >> Obviously, you can easily work around it: >> > t = ([],) > l = t

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread OKB (not okblacke)
Aahz wrote: >> tup=([],) >> tup[0] += ['zap'] >>> Traceback (most recent call last): >>> File "", line 1, in >>> TypeError: 'tuple' object does not support item assignment > Obviously, you can easily work around it: > t = ([],) l = t[0] l += ['foo'] t > (['foo'],)

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Roel Schroeven
Adam W. schreef: > After a fair amount of troubleshooting of why my lists were coming > back a handful of digits short, and the last digit rounded off, I > determined the str() function was to blame: > foonum > 0.0071299720384678782 str(foonum) > '0.00712997203847' > > Why in the world

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Roel Schroeven
Aahz schreef: def foo(bar): bar[0] += ['zap'] > ... import dis dis.dis(foo) > 1 0 LOAD_FAST0 (bar) > 3 LOAD_CONST 1 (0) > 6 DUP_TOPX 2 > 9 BINARY_SUBSCR > 10 LOAD_

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Adam W.
On Aug 11, 12:53 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > If `str()` would not round you would get very long numbers because of the > inaccuracies of floating point values. I know Python is lying when 0.1 > prints as 0.1, but do you really want to see > 0.155511151

Re: Who told str() to round my int()'s!!!

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 16:40:02 +, Adam W. wrote: > After a fair amount of troubleshooting of why my lists were coming > back a handful of digits short, and the last digit rounded off, I > determined the str() function was to blame: > foonum > 0.0071299720384678782 str(foonum) > '0.007

Ligmail bug?

2007-08-11 Thread No.23
#!/usr/bin/env python import libgmail from time import gmtime, strftime fp = open('/tmp/python.list', 'w') ga = libgmail.GmailAccount("[EMAIL PROTECTED]", "mypass") ga.login() result = self.ga.getMessagesByLabel('python.list', True) result_len = len(result) cnt = 0 if result_len: for thread

Re: How to change a PyObject passed to the C extension

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 09:43:19 -0700, MD wrote: >I have a Python C extension which is passed a PyObject containing > an integer value. Is it possible to change this same PyObject so that > now the integer is of a different value? No it is not. Even if you poke around in the object ``struct`` t

How to change a PyObject passed to the C extension

2007-08-11 Thread MD
Hi, I have a Python C extension which is passed a PyObject containing an integer value. Is it possible to change this same PyObject so that now the integer is of a different value? Thanks and Regards, -MD -- http://mail.python.org/mailman/listinfo/python-list

Who told str() to round my int()'s!!!

2007-08-11 Thread Adam W.
After a fair amount of troubleshooting of why my lists were coming back a handful of digits short, and the last digit rounded off, I determined the str() function was to blame: >>> foonum 0.0071299720384678782 >>> str(foonum) '0.00712997203847' >>> Why in the world does str() have any business ro

Re: Metaclass v.s. Property function.

2007-08-11 Thread Duncan Booth
Jens Thiede <[EMAIL PROTECTED]> wrote: > I don't like the property function, usable in the new-style classes, > because having to remember to manage a list of "foo = property(...)" > assignments just plain sucks, so I wrote a metaclass that does things > a little differently. Please have a look an

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-11 Thread Dr.Ruud
RedGrittyBrick schreef: > treasure the saints, tolerate the irritable and > ignore the whiners. *You are what you read.* What is "irritating" to some, is "to the point" to others. That should say enough, but some people just can not stand short replies, they can not hold themselves back from rea

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-11 Thread Dr.Ruud
grocery_stocker schreef: > In the beginning there was Mathematics > And all was good > Then one day God said "Let there be the Lambda Calculus" > And hence the Lambda Calculus was born. > However, God felt the the Lambda Calculus needed a mate > So god said "Let there be Lisp" > And thus, Lisp was

Re: I am giving up perl because of assholes on clpm -- switching to Python

2007-08-11 Thread Dr.Ruud
Paul Boddie schreef: > let us > avoid comp.lang.python becoming some kind of linux-kernel ego trip > where anyone who has stuck around has an interest in perpetuating a > hostile atmosphere. "When did you stop beating your wife?" -- Affijn, Ruud "Gewoon is een tijger." -- http://mail.python.

Public Telnet Server?

2007-08-11 Thread Dave
Hi there. I'm a beginner at Python and I'm writing my first Python script. It's a text adventure about coffee and mixing drinks and being crazy and such. I keep updating it and want my friends to beta test it for me, but some of them don't have the right version of Python or don't want to get Pytho

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Roel Schroeven <[EMAIL PROTECTED]> wrote: >Aahz schreef: >> >> Although Alex is essentially correct, the situation is a bit more complex >> and you are correct that augmented assignment allows the object to decide >> whether to mutate in place. However, the critic

Re: The Future of Python Threading

2007-08-11 Thread Nick Craig-Wood
Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Nick Craig-Wood wrote: > [GIL] > > That is certainly true. However the point being is that running > > on 2 CPUs at once at 95% efficiency is much better than running on > > only 1 at 99%... > > How do you define this percent efficiency? Those

RE: Do you want to know about ISLAM

2007-08-11 Thread sdrodrian
[EMAIL PROTECTED] wrote: > Do you want to know about ISLAM, > the fastest growing peril to the World ? > If yes, this is the ONLY site you need visit: http://islamisbad.com Or, you could just read your newspapers with your BRAINS instead of your sheep's horns. S D Rodrian http://poems.sd

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Roel Schroeven
Aahz schreef: > In article <[EMAIL PROTECTED]>, > Neil Cerutti <[EMAIL PROTECTED]> wrote: >> On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote: >>> Neil Cerutti <[EMAIL PROTECTED]> wrote: >>>... The Python Language Reference seems a little confused about the terminology. >>

Re: LRU cache?

2007-08-11 Thread Steve Holden
Thomas Wittek wrote: > Paul Rubin schrieb: >> Anyone got a favorite LRU cache implementation? I see a few in google >> but none look all that good. I just want a dictionary indexed by >> strings, that remembers the last few thousand entries I put in it. > > I don't know a module for that (althou

Re: Deleting objects on the fly

2007-08-11 Thread Steve Holden
Dustan wrote: > On Aug 10, 1:49 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> "Campbell Barton" <[EMAIL PROTECTED]> wrote in message >> >> news:[EMAIL PROTECTED]| Michele Simionato wrote: >> >> | > Probably not, 'del x' just decrements the reference count, >> >> Or ashttp://docs.python.org/ref/de

A new french book on Python

2007-08-11 Thread Tarek
Hello, A new french book is coming out on the 16th of august. It's focused on Python good practices, agility, and all the things that makes a Python developer loves the language. If you are interested, the web page is here : http://programmation-python.org/guide Regards Tarek -- http://mail.

Re: Destruction of generator objects

2007-08-11 Thread Stefan Bellon
On Sat, 11 Aug, Marc 'BlackJack' Rintsch wrote: > On Sat, 11 Aug 2007 14:50:33 +0200, Stefan Bellon wrote: > > But then, even when terminating the interpreter, __del__ is not > > called. > > Because that is not guaranteed by the language reference. The reason > why it is a bad idea to depend on

Re: Finding gurus (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Steve Holden
Aahz wrote: > In article <[EMAIL PROTECTED]>, > Alex Martelli <[EMAIL PROTECTED]> wrote: >> Because of this, a Google search for >> >> " " python >> >> may sometimes help; when you get 116,000 hits, as for "Steve Holden" >> python, that may be a reasonable indication that the poster is one of >> t

Re: deselect an iterm in ListBox wxPython

2007-08-11 Thread kyosohma
On Aug 11, 2:53 am, Bailu <[EMAIL PROTECTED]> wrote: > Hi, > >I am a newbie in wxPython and doing a program with ListBox, > I want to select and deselect items in this box, > I have use > > self.devlist = wx.ListBox(self, style=wx.LB_MULTIPLE) > self.Bind(wx.EVT_LISTBOX, self.select_dev, self.d

Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Neil Cerutti <[EMAIL PROTECTED]> wrote: >On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote: >> Neil Cerutti <[EMAIL PROTECTED]> wrote: >>... >>> The Python Language Reference seems a little confused about the >>> terminology. >>> >>> 3.4.7 Emulating nume

Re: LRU cache?

2007-08-11 Thread Thomas Wittek
Paul Rubin schrieb: > Anyone got a favorite LRU cache implementation? I see a few in google > but none look all that good. I just want a dictionary indexed by > strings, that remembers the last few thousand entries I put in it. I don't know a module for that (although it might exist), but I coul

Finding gurus (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread Aahz
In article <[EMAIL PROTECTED]>, Alex Martelli <[EMAIL PROTECTED]> wrote: > >Because of this, a Google search for > > " " python > >may sometimes help; when you get 116,000 hits, as for "Steve Holden" >python, that may be a reasonable indication that the poster is one of >the world's Python Gurus (

Re: Destruction of generator objects

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 14:50:33 +0200, Stefan Bellon wrote: > On Sat, 11 Aug, Kay Schluehr wrote: > >> But why shall the destructor be called? Your example does not indicate >> that a ListGenerator object is somewhere destroyed neither explicitely >> using del nor implicitely by destroying the scope

Re: Destruction of generator objects

2007-08-11 Thread Stefan Bellon
On Sat, 11 Aug, Kay Schluehr wrote: > But why shall the destructor be called? Your example does not indicate > that a ListGenerator object is somewhere destroyed neither explicitely > using del nor implicitely by destroying the scope it is living in. After having constructed the list itself, the

Metaclass v.s. Property function.

2007-08-11 Thread Jens Thiede
I don't like the property function, usable in the new-style classes, because having to remember to manage a list of "foo = property(...)" assignments just plain sucks, so I wrote a metaclass that does things a little differently. Please have a look and tell me whether this is useful or impractical.

Re: python 2.5 bug

2007-08-11 Thread Thorsten Kampe
* (Sat, 11 Aug 2007 02:41:26 -0700) > I was install Python 2.5 and uninstall Python 2.4 now I cannot run my > scripts, only from idle > > What should I do? 1. read "How To Ask Questions The Smart Way"[1] 2. read "How to Report Bugs Effectively"[2] 3. don't call something a "bug" if the "bug" i

Re: Deleting objects on the fly

2007-08-11 Thread Paul Rubin
Dustan <[EMAIL PROTECTED]> writes: > > | del x will remove x from memory if nothing else is refering to it, > > This is implementation dependent: true for CPython, not for Jython, ??? for > > IronPython. > Wait a second; do you mean to say that in Jython, del x will never > remove x from memory? Ho

Re: Deleting objects on the fly

2007-08-11 Thread Dustan
On Aug 10, 1:49 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Campbell Barton" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED]| Michele Simionato wrote: > > | > Probably not, 'del x' just decrements the reference count, > > Or ashttp://docs.python.org/ref/del.html > puts it, " Del

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 11, 2:00 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > On Sat, 11 Aug, Kay Schluehr wrote: > > Honestly, I'd recommend wrapping the generator into a function object, > > create the resource on construction ( or pass it ) and destroy it > > implementing __del__. > > > def gen_value(self): >

LRU cache?

2007-08-11 Thread Paul Rubin
Anyone got a favorite LRU cache implementation? I see a few in google but none look all that good. I just want a dictionary indexed by strings, that remembers the last few thousand entries I put in it. It actually looks like this is almost a FAQ. A well-written implementation would probably mak

Re: Destruction of generator objects

2007-08-11 Thread Stefan Bellon
On Sat, 11 Aug, Kay Schluehr wrote: > Honestly, I'd recommend wrapping the generator into a function object, > create the resource on construction ( or pass it ) and destroy it > implementing __del__. > > def gen_value(self): > while True: > yield self.iter.next() > > class Generator

Re: The Future of Python Threading

2007-08-11 Thread Kay Schluehr
Have you checked out the processing [1] package? I've currently the impression that people want to change the whole language before they checkout a new package. It would be nice to read a review. [1] http://cheeseshop.python.org/pypi/processing -- http://mail.python.org/mailman/listinfo/python-l

Re: Ipc mechanisms and designs.

2007-08-11 Thread king kikapu
On Aug 10, 10:33 pm, Nikita the Spider <[EMAIL PROTECTED]> wrote: > In article <[EMAIL PROTECTED]>, > king kikapu <[EMAIL PROTECTED]> wrote: > > > > Hi King Kikapu > There's a shared memory module for Python, but it is *nix only, I'm > afraid. I realize you said "mainly Windows" but this module se

Re: The Future of Python Threading

2007-08-11 Thread [EMAIL PROTECTED]
Justin T. wrote: > On Aug 10, 2:02 pm, [EMAIL PROTECTED] (Luc Heinrich) wrote: >> Justin T. <[EMAIL PROTECTED]> wrote: >>> What these seemingly unrelated thoughts come down to is a perfect >>> opportunity to become THE next generation language. >> Too late: >> >> :) >> >> -

Re: wxPython - drawing without paint event

2007-08-11 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > On a related topic, it seems like it would be nice to do *all* > drawing in > response to paint events. When I get an event from the timer, I > would just tell wx that part of the window needs redrawing, and > depend on it to give me a paint even when nothing of higher

Re: Something in the function tutorial confused me.

2007-08-11 Thread Neil Cerutti
On 2007-08-11, Alex Martelli <[EMAIL PROTECTED]> wrote: > Neil Cerutti <[EMAIL PROTECTED]> wrote: >... >> The Python Language Reference seems a little confused about the >> terminology. >> >> 3.4.7 Emulating numeric types >> 6.3.1 Augmented assignment statements >> >> The former refers to

Re: cookielib

2007-08-11 Thread John J. Lee
Boris Ozegovic <[EMAIL PROTECTED]> writes: > Hi > > I have HTTP client which accepts cookies. If client allready has cookie, > but that cookie has expired, server sends him new cookie, and in response > object Set-Cookie: header everything is fine, but if I reload request, > client sends expired

Re: Destruction of generator objects

2007-08-11 Thread Kay Schluehr
On Aug 11, 12:16 pm, Stefan Bellon <[EMAIL PROTECTED]> wrote: > On Sat, 11 Aug, Kay Schluehr wrote: > > On Aug 9, 1:14 am, Stefan Bellon <[EMAIL PROTECTED]> wrote: > > > Sorry, I forgot to mention that I am forced to using Python 2.4. > > It doesn't matter. You can use try...finally as well in Pyth

Re: The Future of Python Threading

2007-08-11 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Chris Mellon <[EMAIL PROTECTED]> wrote: . . . >There's nothing "undocumented" about IPC. It's been around as a >technique for decades. Message passing is as old as the hills.

Re: The Future of Python Threading

2007-08-11 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Seun Osewa <[EMAIL PROTECTED]> wrote: >> I think I've heard Guido say the last attempt at removing the Global >> Interpreter Lock (GIL) resulted in a Python that was much slower... > >What is it about Python that makes a thread-safe CPython version much >slower? Wh

Re: The Modernization of Emacs: keyboard shortcuts pain

2007-08-11 Thread Xah Lee
The following is a FAQ from emacs modernization http://xahlee.org/emacs/modernization.html Q: Emacs's undo is superior, because the prevalent Undo/Redo system actually loss info. A: Emac's undo is very confusing and does not have a Redo command. To redo after a undo, people are told to type somet

Re: Destruction of generator objects

2007-08-11 Thread Stefan Bellon
On Sat, 11 Aug, Kay Schluehr wrote: > On Aug 9, 1:14 am, Stefan Bellon <[EMAIL PROTECTED]> wrote: > > Sorry, I forgot to mention that I am forced to using Python 2.4. > It doesn't matter. You can use try...finally as well in Python 2.4. > It's just not possible to use except and finally clauses i

Re: python 2.5 bug

2007-08-11 Thread vedrandekovic
On 11 kol, 11:59, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Sat, 11 Aug 2007 02:41:26 -0700, vedrandekovic wrote: > > I was install Python 2.5 and uninstall Python 2.4 now I cannot run my > > scripts, only from idle > > > What should I do? > > Install 2.4 again. Both can be installe

Re: question: howto transfer objects between server and client?

2007-08-11 Thread OpenPavilion
On 11 Aug., 11:21, Irmen de Jong <[EMAIL PROTECTED]> wrote: > OpenPavilion wrote: > > Since XMLRPC has limited features: Is there any other server/client > > technique to transfer objects (not strings, or dictionaries, but self > > defined object types) ? > > Take a look at Pyro; http://pyro.sour

Re: python 2.5 bug

2007-08-11 Thread Marc 'BlackJack' Rintsch
On Sat, 11 Aug 2007 02:41:26 -0700, vedrandekovic wrote: > I was install Python 2.5 and uninstall Python 2.4 now I cannot run my > scripts, only from idle > > What should I do? Install 2.4 again. Both can be installed in parallel. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.o

python 2.5 bug

2007-08-11 Thread vedrandekovic
Hello, I was install Python 2.5 and uninstall Python 2.4 now I cannot run my scripts, only from idle What should I do? Regards, Vedran -- http://mail.python.org/mailman/listinfo/python-list

Re: question: howto transfer objects between server and client?

2007-08-11 Thread Irmen de Jong
OpenPavilion wrote: > Since XMLRPC has limited features: Is there any other server/client > technique to transfer objects (not strings, or dictionaries, but self > defined object types) ? Take a look at Pyro; http://pyro.sourceforge.net --Irmen -- http://mail.python.org/mailman/listinfo/pytho

question: howto transfer objects between server and client?

2007-08-11 Thread OpenPavilion
Hello community, maybe one of you can help me out with a question regarding the transfer of objects betwen client an server: I have three files: ### ClassA.py ### class ClassA: def setA(self, newA): self.a = newA def getA(self): return self.a ### client.py ###

  1   2   >