Re: The fundamental concept of continuations

2007-10-09 Thread gnuist006
On Oct 9, 5:50 am, Matthias Blume <[EMAIL PROTECTED]> wrote: > "." <[EMAIL PROTECTED]> writes: > > On Tue, 09 Oct 2007 05:15:49 +, gnuist006 wrote: > > >> Again I am depressed to encounter a fundamentally new concept that I > >> was all along unheard of. Its not even in paul graham's book where

Re: Static variable vs Class variable

2007-10-09 Thread Marc 'BlackJack' Rintsch
On Tue, 09 Oct 2007 18:08:34 +, Steven D'Aprano wrote: L = [] id(L) > 3083496716L L += [1] id(L) > 3083496716L > > It's the same L, not rebound at all. It *is* rebound. To the same object, but it *is* assigned to `L` and not just mutated in place. In [107]: class A:

Re: tinyp2p - trying to get it to work

2007-10-09 Thread Fantus
Marc Christiansen pisze: > > I had a (not so quick) look. The code proves its point (i.e. writing a > very small p2p application is possible), but it is horrible. With only > one server, the code is broken; maybe it works using multiple servers, I > didn't test. A quick fix seems to be to change

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
Steven D'Aprano schrieb: > On Tue, 09 Oct 2007 19:23:37 +0200, Diez B. Roggisch wrote: > >> Your believes aside, this is simply wrong. The statement >> >> a += x >> >> always leads to a rebinding of a to the result of the operation +. > > Not true. Yes, it is. L = [] id(L) > 30834967

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread aaron . watters
On Oct 9, 3:35 pm, Istvan Albert <[EMAIL PROTECTED]> wrote: > > why would it be late? is the future of you own work not worth the time > it takes to rename it? Compared to all the other work it took ... it > is just a mere inconvenience. >From a sourceforge perspective I think it's more than in in

Re: The fundamental concept of continuations

2007-10-09 Thread .
On Tue, 09 Oct 2007 19:20:06 +, gnuist006 wrote: > On Oct 8, 11:09 pm, "." <[EMAIL PROTECTED]> wrote: >> On Tue, 09 Oct 2007 05:15:49 +, gnuist006 wrote: > >> >> > Can anyone explain: >> >> > (1) its origin >> >> One of the lambda papers, I think. I don't remember which. > > Hey no-name

RuntimeWarning: tp_compare

2007-10-09 Thread Bruno Barberi Gnecco
I'm getting the following exception when I call an external extension (pytst): /usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return -1 or -2 for exception return _active[_get_ident()] Traceback (most recent call last): File "testDataMiner2.py", line 77, in

Re: RuntimeWarning: tp_compare

2007-10-09 Thread Chris Mellon
On 10/9/07, Bruno Barberi Gnecco <[EMAIL PROTECTED]> wrote: > I'm getting the following exception when I call an external extension > (pytst): > > /usr/lib/python2.5/threading.py:697: RuntimeWarning: tp_compare didn't return > -1 or -2 for > exception >return _active[_get_ident()] > Tr

Re: storing meta data on dictionary keys

2007-10-09 Thread Chris Mellon
On 10/9/07, Andreas Kraemer <[EMAIL PROTECTED]> wrote: > > I sometimes find it useful to store meta data on dictionary keys, like in > the following example: > > class Dict(dict): > def __init__(self,*args,**kw): > self.key_dict = {} > super(Dict,self).__init__(*args,**kw) > def __setit

Re: The fundamental concept of continuations

2007-10-09 Thread Erik Jones
On Oct 9, 2007, at 3:32 PM, . wrote: > On Tue, 09 Oct 2007 19:20:06 +, gnuist006 wrote: > >> On Oct 8, 11:09 pm, "." <[EMAIL PROTECTED]> wrote: >>> On Tue, 09 Oct 2007 05:15:49 +, gnuist006 wrote: >> >>> Can anyone explain: >>> (1) its origin >>> >>> One of the lambda papers, I t

Unexpected behaviour with HTMLParser...

2007-10-09 Thread Just Another Victim of the Ambient Morality
HTMLParser is behaving in, what I find to be, strange ways and I would like to better understand what it is doing and why. First, it doesn't appear to translate HTML escape characters. I don't know the actual terminology but things like & don't get translated into & as one would like.

Re: Mixing Python and C classes in a module

2007-10-09 Thread John Machin
On 10/10/2007 12:56 AM, Stefan Arentz wrote: > Is it possible to mix classes defined in both Python and C in the same > module? Ideally I would like to be able to do: > > from some.module import MyPythonClass, MyCClass > > I guess that would mean that this would look like this on disk: > > som

Re: The fundamental concept of continuations

2007-10-09 Thread Chung-chieh Shan
[EMAIL PROTECTED] wrote in article <[EMAIL PROTECTED]> in comp.lang.functional: > > One of the most lucid explanations of definitional interpreters -- > > including those that are based on continuation-passing -- are > > explained in J. Reynolds' famous 1971 "Definitional Interpreters for > > Highe

Re: pytz has so many timezones!

2007-10-09 Thread Diez B. Roggisch
>> who says that timezones have to be separated by one hour each? > > The Earth says. It takes 24 hours to revolve. Wrong >> Why aren't they separated by 30minutes, or 20, or 10? Or 2 hours? > > Why isn't an hour defined to be 30 minutes? > >> Or why don't we have a global time? > > Like UTC?

Re: pytz has so many timezones!

2007-10-09 Thread Diez B. Roggisch
>> who says that timezones have to be separated by one hour each? > > The Earth says. It takes 24 hours to revolve. Your kidding me, aren't you? Beside the fact that the earth does not revolve in 24h (leap seconds, if you like to google), even the 24 hours of a day are as arbitrary as you prefe

Re: Unexpected behaviour with HTMLParser...

2007-10-09 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality schrieb: > HTMLParser is behaving in, what I find to be, strange ways and I would > like to better understand what it is doing and why. > > First, it doesn't appear to translate HTML escape characters. I don't > know the actual terminology but

Re: List loops

2007-10-09 Thread John Machin
On 10/10/2007 12:30 AM, Tommy Grav wrote: > Hi everyone, > > I have a list of objects where I have want to do two loops. > I want to loop over the list and inside this loop, work on all > the elements of the list after the one being handled in the outer > loop. I can of course do this with index

Re: List loops

2007-10-09 Thread John Machin
On 10/10/2007 1:33 AM, Hamilton, William wrote: >> From: Tommy Grav >> >> Hi everyone, >> >>I have a list of objects where I have want to do two loops. >> I want to loop over the list and inside this loop, work on all >> the elements of the list after the one being handled in the outer The man

Re: List loops

2007-10-09 Thread John Machin
On 10/10/2007 1:00 AM, Chris Mellon wrote: > On 10/9/07, Tommy Grav <[EMAIL PROTECTED]> wrote: >> Hi everyone, >> >>I have a list of objects where I have want to do two loops. >> I want to loop over the list and inside this loop, work on all >> the elements of the list after the one being handl

Re: Unexpected behaviour with HTMLParser...

2007-10-09 Thread Just Another Victim of the Ambient Morality
"Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Just Another Victim of the Ambient Morality schrieb: >> HTMLParser is behaving in, what I find to be, strange ways and I >> would like to better understand what it is doing and why. >> >> First, it doesn't a

Re: SOAPpy and ArrayOfKeyValue

2007-10-09 Thread Alex Ezell
It's cool when you solve your own problems. It was as simple as this: def dictToKeyValue(self, mydict): soap_list = [] for key,value in mydict.items(): inner = {"key":key,"value":value} soap_list.append(inner) return soap_list It's just a list of di

Re: Static variable vs Class variable

2007-10-09 Thread Steven D'Aprano
On Tue, 09 Oct 2007 19:46:35 +, Marc 'BlackJack' Rintsch wrote: > On Tue, 09 Oct 2007 18:08:34 +, Steven D'Aprano wrote: > > L = [] > id(L) >> 3083496716L > L += [1] > id(L) >> 3083496716L >> >> It's the same L, not rebound at all. > > It *is* rebound. To the same objec

Re: Static variable vs Class variable

2007-10-09 Thread Steven D'Aprano
On Tue, 09 Oct 2007 22:27:47 +0200, Diez B. Roggisch wrote: > Steven D'Aprano schrieb: >> On Tue, 09 Oct 2007 19:23:37 +0200, Diez B. Roggisch wrote: >> >>> Your believes aside, this is simply wrong. The statement >>> >>> a += x >>> >>> always leads to a rebinding of a to the result of the operat

Re: Static variable vs Class variable

2007-10-09 Thread Steven D'Aprano
On Tue, 09 Oct 2007 21:25:38 +0200, Laszlo Nagy wrote: > a = 1 > a+= 1 # The compiler will probably optimize this and the Python bytecode > interpreter will not rebind 'a' here, just increment the integer in > memory. No. This is Python, not C. You can't increment integers in memory. Integers ar

Re: List loops

2007-10-09 Thread Bill Hamilton
On 10/9/07, John Machin <[EMAIL PROTECTED]> wrote: > On 10/10/2007 1:33 AM, Hamilton, William wrote: > >> From: Tommy Grav > >> > >> Hi everyone, > >> > >>I have a list of objects where I have want to do two loops. > >> I want to loop over the list and inside this loop, work on all > >> the ele

Re: Static variable vs Class variable

2007-10-09 Thread Marc 'BlackJack' Rintsch
On Tue, 09 Oct 2007 22:43:16 +, Steven D'Aprano wrote: > On Tue, 09 Oct 2007 19:46:35 +, Marc 'BlackJack' Rintsch wrote: > >> On Tue, 09 Oct 2007 18:08:34 +, Steven D'Aprano wrote: >> >> L = [] >> id(L) >>> 3083496716L >> L += [1] >> id(L) >>> 3083496716L >>> >>> It'

Re: storing meta data on dictionary keys

2007-10-09 Thread Andreas Kraemer
From: Chris Mellon <[EMAIL PROTECTED]> Sent: Tuesday, October 9, 2007 1:51:04 PM > Because, by definition, if you have the key then you don't need to get > it from the dict. What you're doing here is conflating 2 mappings into > one: string value->person and person->values. Use 2 explicit dicts t

Re: The fundamental concept of continuations

2007-10-09 Thread Matthias Blume
[EMAIL PROTECTED] writes: > Matthias, thanks for the reference, but I dont have access to an > engineering library. I would appreciate, if you have access to paper/ > scanner or electronic copy to help many of us out, you are > not just helping me but many will thank you. Given that you seem to b

Re: The Modernization of Emacs: terminology buffer and keybinding

2007-10-09 Thread nebulous99
On Oct 8, 7:32 am, Joost Kremers <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Don't both "man" and those words for measurement come ultimately from > > words for "hand" (similarly to words like "manual", as in labor)? > > no. Do not bluntly contradict me in public. > "manual" is deri

Re: Static variable vs Class variable

2007-10-09 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : > Hi. > > I've got a question on the differences and how to define static and > class variables. What's a "static" variable ? A variable that doesn't move ?-) > Hence, my understanding is that static variables must be bound to the > class defining the variables Yo

Re: Static variable vs Class variable

2007-10-09 Thread Bruno Desthuilliers
Marc 'BlackJack' Rintsch a écrit : > On Tue, 09 Oct 2007 18:08:34 +, Steven D'Aprano wrote: > > >L = [] >id(L) >> >>3083496716L >> >L += [1] >id(L) >> >>3083496716L >> >>It's the same L, not rebound at all. > > It *is* rebound. To the same object, but it *is* assigned to `L`

Re: Static variable vs Class variable

2007-10-09 Thread Bruno Desthuilliers
Bruno Desthuilliers a écrit : (snip) > And it is *not* rebound: Doh. Stupid me. Of course it is - but to a ref to the same object... >>> class A: ... l = [] ... >>> class B(A): pass ... >>> B.__dict__ {'__module__': '__main__', '__doc__': None} >>> B.l [] >>> B.l += [1] >>> B.__dict__ {'__m

Re: Mixing Python and C classes in a module

2007-10-09 Thread Nicholas Bastin
On 10/9/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is it possible to mix classes defined in both Python and C in the same > > module? Ideally I would like to be able to do: > > > > from some.module import MyPythonCl

Jython import coventions

2007-10-09 Thread Benjamin
When importing Java packages in Jython, what is the convention to simplify imports? For example: import java.util as util Is this correct? Or should I use from * import *? -- http://mail.python.org/mailman/listinfo/python-list

xyplot in Control desk from dspace

2007-10-09 Thread yanzinmeister
Hello everyone, i'm new user of python, in fact, i'm using Control Desk from dsPACE. I just want to change the programm a bit to fit to my application. I draw xyplot using virsual instrument xyplot in Control Desk, and i want to delect any curses if it's needed. But in Control Desk the xyplot is

Re: Mixing Python and C classes in a module

2007-10-09 Thread timaranz
On Oct 10, 3:32 pm, "Nicholas Bastin" <[EMAIL PROTECTED]> wrote: > On 10/9/07, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > > > On 09 Oct 2007 16:56:30 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is it possible to mix classes defined in both Python and C in the same > > > module? Ideal

Re: Yet another comparison of Python Web Frameworks

2007-10-09 Thread mdipierro
Since you are starting a new project you may want to look into something new and different http://mdp.cti.depaul.edu/examples -- http://mail.python.org/mailman/listinfo/python-list

M2Crypto possible intermittent bug

2007-10-09 Thread John Nagle
I just "upgraded" from M2Crypto 0.17 to M2Crypto 0.18, and I'm running my regression tests. I'm seeing occasional cases where M2Crypto raises the exception SSL.SSLError, and the associated error is "(0, 'Error')", which is the bogus error you get if you feed 0 to "perror". It failed once on "v

Exceptions: Logging TB and local variables?

2007-10-09 Thread allen.fowler
Hi, My code looks like this: for item in bigset: self.__sub1(item) self.__sub2(item) self.__sub3(item) # the subX functions, in turn, use various 3rd party modules. Now, I would like to do this: for item in bigset: try: self.__sub1(item) self.__sub2(item) self.__sub3(item)

Re: storing meta data on dictionary keys

2007-10-09 Thread Erik Jones
On Oct 9, 2007, at 7:37 PM, Andreas Kraemer wrote: > From: Chris Mellon <[EMAIL PROTECTED]> > Sent: Tuesday, October 9, 2007 1:51:04 PM > > > Because, by definition, if you have the key then you don't need > to get > > it from the dict. What you're doing here is conflating 2 mappings > into >

Re: mutable objects as dictionary keys

2007-10-09 Thread Erik Jones
On Oct 9, 2007, at 12:44 PM, Andreas Kraemer wrote: > Hi everyone, > > I know that the subject of mutable objects as dictionary keys has > been discussed a number of times in this forum (see for instance > "freezing" of classes), but I would love to hear the thoughts of > the experts on the

Re: The fundamental concept of continuations

2007-10-09 Thread Marlene Miller
> Can anyone explain: > > (1) its origin >From the Bibliographic Notes of Chapter 12 Continuations in a Functional Language, Theories of Programming Languages by John C. Reynolds, page 370: "A history of the repeated discoveries of continuations (occurring largely in the context of functional lan

Re: The fundamental concept of continuations

2007-10-09 Thread Marlene Miller
> If nothing else, please use Google. Many will thank you. > http://www.google.com/search?hl=en&q=Definitional+Interpreters+for+Higher-Order+Functions&btnG=Search http://www.brics.dk/~hosc/vol11/contents.html Definitional Interpreters for Higher-Order Programming Languages Definitional Interpre

Re: The fundamental concept of continuations

2007-10-09 Thread Marlene Miller
Corrected the links... 1. Programming Languages: Application and Interpretation Shriram Krishnamurthi Part VII Continuations http://www.cs.brown.edu/~sk/Publications/Books/ProgLangs/2007-04-26/plai-2007-04-26.pdf 2. Essentials of Programming Languages (2nd edition) Friedman, Wand and Haynes Chapt

Re: tarfile...bug?

2007-10-09 Thread Anurag
Hi, Have any one faced such problem, I assume it must be common if it can be replicated so easily , or something wrong with my system Also if I use tar.members instead of tar.getmembers() it works so what is the diff. between tar.members and tar.getmembers() rgds Anurag -- http://mail.python.o

Re: Problem with argument parsing

2007-10-09 Thread lgwe
On 9 Okt, 17:18, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > lgwe wrote: > > I have a python-script: myscript, used to start a program on another > > computer and I use OptionParser in optpars. > > I use it like this: myscript -H host arg1 -x -y zzz > > I would like OptionParser to ignore all a

Re: Unexpected behaviour with HTMLParser...

2007-10-09 Thread Diez B. Roggisch
Just Another Victim of the Ambient Morality schrieb: > "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Just Another Victim of the Ambient Morality schrieb: >>> HTMLParser is behaving in, what I find to be, strange ways and I >>> would like to better underst

button binding isn't triggering event like it's supposed to

2007-10-09 Thread mridula
hi. i am trying to learn event binding. i have a form with a couple of buttons for different tags, which all call the same function. the text on the buttons changes from record to record. this is the problem area: def showrecords(self): """this function updates the form labels to show

APOLOGY (was: pytz has so many timezones!)

2007-10-09 Thread [EMAIL PROTECTED]
I apologize for being a dick. It won't happen again. I was actually thinking that the 25 standard timezones (which make a reasonable list or can be easily generated by clicking a map) could serve as a filter to make the detail list reasonably sized. Something like this: import pytz import dateti

unpickle from URL problem

2007-10-09 Thread Alan Isaac
I am on a Windows box. I pickle a tuple of 2 simple objects with the pickle module. It pickles fine. It unpickles fine. I upload to a server. I try to unpickle from the URL. No luck. Try it: x1, x2 = pickle.load(urllib.urlopen('http://www.american.edu/econ/notes/hw/example1')) I change the f

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
>> Yes, it is. > > I'm afraid not. > > As I admitted in my reply to Marc, I overstated my case by saying that L > isn't rebound at all. Of course it is rebound, but to itself. > > However, it is not true that += "always leads to a rebinding of a to the > result of the operation +". The + opera

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
Diez B. Roggisch schrieb: >>> Yes, it is. >> >> I'm afraid not. >> >> As I admitted in my reply to Marc, I overstated my case by saying that >> L isn't rebound at all. Of course it is rebound, but to itself. >> >> However, it is not true that += "always leads to a rebinding of a to >> the result

Re: unpickle from URL problem

2007-10-09 Thread Marc 'BlackJack' Rintsch
On Wed, 10 Oct 2007 05:58:51 +, Alan Isaac wrote: > I am on a Windows box. > > I pickle a tuple of 2 simple objects with the pickle module. > It pickles fine. It unpickles fine. > > I upload to a server. > I try to unpickle from the URL. No luck. Try it: > x1, x2 = > pickle.load(urllib.u

<    1   2