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

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

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

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

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

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

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)

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

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

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

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

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

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

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

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

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

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

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: 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: 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 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: 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: NUCULAR fielded text searchable indexing

2007-10-09 Thread Istvan Albert
On Oct 9, 9:14 am, [EMAIL PROTECTED] wrote: > a great tradition of tounge-in-cheek package names, like > "Cold fusion", for example. Cold Fusion is a super cool name. Nobody will every think of it as representing something odd or silly. > too late now. sorry again, why would it be late? is the

Re: Static variable vs Class variable

2007-10-09 Thread Laszlo Nagy
Steven D'Aprano wrote: > 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. > Hmm. Or you can write __iadd__ to

Re: The fundamental concept of continuations

2007-10-09 Thread Jeff M.
> (6) any good readable references that explain it lucidly ? This was something that has been very interesting to me for a while now, and I'm actually still having a difficult time wrapping my head around it completely. The best written explanation that I've come across was in "The Scheme Progra

Re: The fundamental concept of continuations

2007-10-09 Thread gnuist006
Special thanks to many of you for your very decent replies. On Oct 9, 11:18 am, George Neuner wrote: > On Tue, 09 Oct 2007 05:15:49 -, [EMAIL PROTECTED] 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 bo

Re: The fundamental concept of continuations

2007-10-09 Thread gnuist006
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 "dot" you are the only one who says its origin is in one of the old

Re: pytz has so many timezones!

2007-10-09 Thread Bill Hamilton
On 10/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > On Oct 9, 8:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > On Oct 8, 1:03 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > > >> On Mon, 2007-10-08 at 10:41 -0700, [EMAIL PROTECTED] wrote: > > >> > For

Fwd: NUCULAR fielded text searchable indexing

2007-10-09 Thread Bill Hamilton
On 10/9/07, Grant Edwards <[EMAIL PROTECTED]> wrote: > On 2007-10-09, Robin Becker <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > >> On Oct 9, 8:46 am, Istvan Albert <[EMAIL PROTECTED]> wrote: > >>> ps. there is a python project named "The Devil Framework", I cringe > >>> every time I he

Re: pytz has so many timezones!

2007-10-09 Thread Chris Mellon
On 10/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > 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? > > > > > Your 25 timezones are an abstraction the same way > > Not

Re: pytz has so many timezones!

2007-10-09 Thread J. Clifford Dyer
On Tue, Oct 09, 2007 at 11:21:41AM -0700, [EMAIL PROTECTED] wrote regarding Re: pytz has so many timezones!: > > The Earth says. It takes 24 hours to revolve. > > > 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 do

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread Grant Edwards
On 2007-10-09, Robin Becker <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: >> On Oct 9, 8:46 am, Istvan Albert <[EMAIL PROTECTED]> wrote: >>> ps. there is a python project named "The Devil Framework", I cringe >>> every time I hear about it.Nucularis not as bad, but it is close. >> >> Aw sh

Re: pytz has so many timezones!

2007-10-09 Thread [EMAIL PROTECTED]
On Oct 9, 8:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Oct 8, 1:03 pm, Carsten Haese <[EMAIL PROTECTED]> wrote: > >> On Mon, 2007-10-08 at 10:41 -0700, [EMAIL PROTECTED] wrote: > >> > For example, Windows has seperate listings for > > >> > Central America

Re: The fundamental concept of continuations

2007-10-09 Thread George Neuner
On Tue, 09 Oct 2007 05:15:49 -, [EMAIL PROTECTED] 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 i >learnt part of Lisp. Its in Marc Feeley's video. > >Can anyone explain: > >(1) its origin Lambd

storing meta data on dictionary keys

2007-10-09 Thread Andreas Kraemer
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 __setitem__(self,k,v): self.key_dict[k] = k super(Dict,self).__setitem

SOAPpy and ArrayOfKeyValue

2007-10-09 Thread Alex Ezell
Can anyone offer any assistance as to how to convert a basic python dictionary, list, or even tuple into the SOAP type "ArrayOfKeyValue"? I am currently using SOAPpy, but would be willing to change to ZSI or something else if it made this conversion easier. I have tried with the arrayType and str

Re: ANN: generator_tools-0.1 released

2007-10-09 Thread Kay Schluehr
On Oct 9, 7:17 pm, Steven Bethard <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: > > Originally I came up with the idea of a pure Python implementation for > > copyable generators as an ActiveState Python Cookbook recipe. Too bad, > > it was badly broken as Klaus Müller from the SimPy project poi

Re: Static variable vs Class variable

2007-10-09 Thread Steven D'Aprano
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. >>> L = [] >>> id(L) 3083496716L >>> L += [1] >>> id(L) 3083496716L It's the same

mutable objects as dictionary keys

2007-10-09 Thread Andreas Kraemer
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 approach below. The use case that I encounter frequently is the c

Re: Memory leak/gc.get_objects()/Improved gc in version 2.5

2007-10-09 Thread arvind
On Oct 9, 7:54 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 10/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > I'm running a python program that simulates a wireless network > > protocol for a certain number of "frames" (measure of time). I've > > observed the following: > > > 1

Re: pytz has so many timezones!

2007-10-09 Thread [EMAIL PROTECTED]
On Oct 9, 2:58 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Mon, 08 Oct 2007 10:41:03 -0700, "[EMAIL PROTECTED]" > <[EMAIL PROTECTED]> declaimed the following in comp.lang.python: > > > > > There are only 25 timezones: -12, -11, ... -1, 0 (GMT), +1, ... +11, > > +12. > > Uhm... -12

Re: Static variable vs Class variable

2007-10-09 Thread Diez B. Roggisch
> In point #3, you really bind a name to a value. As you probably know, in > Python, there are names and objects. The initial value of the name 'a' > is 1. It is an immutable object. The "+=" operator usually increments a > value of an object. However, because the 'int' type is immutable, the +=

Re: Static variable vs Class variable

2007-10-09 Thread Matimus
On Oct 9, 9:16 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi. > > I've got a question on the differences and how to define static and > class variables. AFAIK, class methods are the ones which receives the > class itself as an argument, while static methods are the one which > runs static

Re: NUCULAR fielded text searchable indexing

2007-10-09 Thread Robin Becker
[EMAIL PROTECTED] wrote: > On Oct 9, 8:46 am, Istvan Albert <[EMAIL PROTECTED]> wrote: >> ps. there is a python project named "The Devil Framework", I cringe >> every time I hear about it.Nucularis not as bad, but it is close. > > Aw shucks. I thought it was funny. Can't I make fun of > politici

Re: ANN: generator_tools-0.1 released

2007-10-09 Thread Steven Bethard
Kay Schluehr wrote: > Originally I came up with the idea of a pure Python implementation for > copyable generators as an ActiveState Python Cookbook recipe. Too bad, > it was badly broken as Klaus Müller from the SimPy project pointed > out. Two weeks and lots of tests later I got finally a running

Re: Static variable vs Class variable

2007-10-09 Thread Laszlo Nagy
> Your question "is variable a > static or class variable?" has no real answer. After running the > increment() method on a descendant class, e.g. Child1 will rebind the > name Child1.a, creating a new name in the namespace of the class. So the > variable Foo.a is still there, but you are acce

Re: The fundamental concept of continuations

2007-10-09 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | 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 i | learnt part of Lisp. Its in Marc Feeley's video. | | Can anyone explain: | | (1) its origin |

Re: Static variable vs Class variable

2007-10-09 Thread Marc 'BlackJack' Rintsch
On Tue, 09 Oct 2007 09:16:12 -0700, [EMAIL PROTECTED] wrote: > I've got a question on the differences and how to define static and > class variables. First you have to define what you mean by "static". > AFAIK, class methods are the ones which receives the > class itself as an argument, while st

Re: Static variable vs Class variable

2007-10-09 Thread Laszlo Nagy
[EMAIL PROTECTED] wrote: > Hi. > > I've got a question on the differences and how to define static and > class variables. AFAIK, class methods are the ones which receives the > class itself as an argument, while static methods are the one which > runs statically with the defining class. > > Hence,

Re: Native class methods

2007-10-09 Thread Chris Mellon
On 09 Oct 2007 17:45:12 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > "Chris Mellon" <[EMAIL PROTECTED]> writes: > > > On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > > > Is there an easy way to implement a specific method of a Python class > > > in C? Like a nat

Static variable vs Class variable

2007-10-09 Thread [EMAIL PROTECTED]
Hi. I've got a question on the differences and how to define static and class variables. AFAIK, class methods are the ones which receives the class itself as an argument, while static methods are the one which runs statically with the defining class. Hence, my understanding is that static variabl

Re: Native class methods

2007-10-09 Thread Jean-Paul Calderone
On 09 Oct 2007 17:45:12 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: >"Chris Mellon" <[EMAIL PROTECTED]> writes: > >> On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: >> > >> > Is there an easy way to implement a specific method of a Python class >> > in C? Like a native m

Re: Native class methods

2007-10-09 Thread Stefan Arentz
"Chris Mellon" <[EMAIL PROTECTED]> writes: > On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > > > Is there an easy way to implement a specific method of a Python class > > in C? Like a native method in Java? I would really like to do the > > majority of my class code in

RE: List loops

2007-10-09 Thread Hamilton, William
> 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 > loop. I can of course do this with indexes: > > >>> alist

Re: Native class methods

2007-10-09 Thread Diez B. Roggisch
Stefan Arentz wrote: > > Is there an easy way to implement a specific method of a Python class > in C? Like a native method in Java? I would really like to do the > majority of my class code in Python and just do one or two methods > in C. ctypes or subclassing C-implemented classes. Diez -- h

Re: Native class methods

2007-10-09 Thread Chris Mellon
On 09 Oct 2007 17:20:09 +0200, Stefan Arentz <[EMAIL PROTECTED]> wrote: > > Is there an easy way to implement a specific method of a Python class > in C? Like a native method in Java? I would really like to do the > majority of my class code in Python and just do one or two methods > in C. > > S.

Re: Query

2007-10-09 Thread Nathaniel Smith
> I want to make a binary file , which would execute on it's own. First do $ which python to get the location of your python binary. The default, i think, is just /usr/bin/python. Then add this line to the top of your file: #!/usr/bin/python (or whatever the `which` command returned) th

Re: List loops

2007-10-09 Thread Chris Mellon
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 handled in the outer > loop. I can of course do this wi

Native class methods

2007-10-09 Thread Stefan Arentz
Is there an easy way to implement a specific method of a Python class in C? Like a native method in Java? I would really like to do the majority of my class code in Python and just do one or two methods in C. S. -- http://mail.python.org/mailman/listinfo/python-list

Re: List loops

2007-10-09 Thread Tim Chase
> >>> alist = range(3) > >>> for i in xrange(len(alist)): > ... for j in xrange(i+1,len(alist)): > ... print i,j,alist[i],alist[j] > ... > 0 1 0 1 > 0 2 0 2 > 1 2 1 2 > >>> > > > Is there a way to do this without using indexes? The following works for me, replicating your code, >>> al

Re: Problem with argument parsing

2007-10-09 Thread Diez B. Roggisch
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 arguments after arg1, because > these are options that should be used by

Re: Mixing Python and C classes in a module

2007-10-09 Thread Kay Schluehr
On Oct 9, 4:56 pm, 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 MyPythonClass, MyCClass > > I guess that would mean that this would look like this on di

Re: Mixing Python and C classes in a module

2007-10-09 Thread Chris Mellon
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 MyPythonClass, MyCClass > > I guess that would mean that this would look l

Re: supplying password to subprocess.call('rsync ...'), os.system('rsync ...')

2007-10-09 Thread timw.google
On Oct 7, 1:01 pm, Michael Torrie <[EMAIL PROTECTED]> wrote: > timw.google wrote: > > Hi > > > I want to write a python script that runs rsync on a given directory > > and host. I build the command line string, but when I try to run > > subprocess.call(cmd), or p=subprocess.Popen(cmd, shell=True),o

Mixing Python and C classes in a module

2007-10-09 Thread Stefan Arentz
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: some/ __init__.py module.py (contains MyPythonClass)

Re: Virtual filesystem in python ( Fuse or WebDav ? )

2007-10-09 Thread Grant Edwards
On 2007-10-09, Thomas W <[EMAIL PROTECTED]> wrote: > I want to create a virtual filesystem based on a relational > database. [...] http://en.wikipedia.org/wiki/Filesystem_in_Userspace http://fuse.sourceforge.net/ -- Grant Edwards grante Yow! I'm a nuclear

Re: Memory leak/gc.get_objects()/Improved gc in version 2.5

2007-10-09 Thread Chris Mellon
On 10/8/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I'm running a python program that simulates a wireless network > protocol for a certain number of "frames" (measure of time). I've > observed the following: > > 1. The memory consumption of the program grows as the number of frames > I sim

List loops

2007-10-09 Thread 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 loop. I can of course do this with indexes: >>> alist = range(3) >>> for i in xrange(len(a

Re: why did MIT drop scheme for python in intro to computing?

2007-10-09 Thread Grant Edwards
On 2007-10-09, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Comparing apples with apples, how do you compare the scheme > gui library with wxpython ? Isnt it better than Tkinter ? I haven't used the newer Scheme GUI bindings. I switched from STk to tkinter, and then from tkinter to PyGTK and w

  1   2   >