Re: Rappresenting infinite

2007-06-27 Thread Rob De Almeida
On Jun 27, 6:41 am, andrea <[EMAIL PROTECTED]> wrote: > I would like to have a useful rappresentation of infinite, is there > already something?? from numpy import inf -- http://mail.python.org/mailman/listinfo/python-list

Re: What was that web interaction library called again?

2007-06-22 Thread Rob De Almeida
On Jun 22, 11:19 am, Harald Korneliussen <[EMAIL PROTECTED]> wrote: > Hi, > > I remember I came across a python library that made it radically > simple to interact with web sites, connecting to gmail and logging in > with four or five lines, for example. I thought, "that's interesting, > I must loo

Re: WSGI with mod_python (was: Python, WSGI, legacy web application)

2006-11-23 Thread Rob De Almeida
Ben Finney wrote: > I was under the impression that WSGI in mod_python was a rather kludgy > way to do WSGI, but I don't know what the alternatives are. CGI? > Python http server (e.g. CherryPy)? Something else? You can use FastCGI or SCGI too, with Apache, lighttpd or Cherokee. I have a short des

Re: Dictionaries

2006-10-18 Thread Rob De Almeida
Lad wrote: > Let's suppose I have > > a={'c':1,'d':2} > b={'c':2} > but > a.update(b) > will make > {'c': 2, 'd': 2} > > and I would need > {'c': 3, 'd': 2} > > (because `c` is 1 in `a` dictionary and `c` is 2 in `b` dictionary, so > 1+2=3) > > How can be done that? dict([(k, a.get(k, 0) + b.ge

Re: What value should be passed to make a function use the default argument value?

2006-10-03 Thread Rob De Almeida
LaundroMat wrote: > Suppose I have this function: > > def f(var=1): > return var*2 > > What value do I have to pass to f() if I want it to evaluate var to 1? > I know that f() will return 2, but what if I absolutely want to pass a > value to f()? "None" doesn't seem to work.. If you *absolutely* w

Re: Compile AST to bytecode?

2006-09-19 Thread Rob De Almeida
Duncan Booth wrote: > > I would like to compile an AST to bytecode, so I can eval it later. > I'm not sure there are any properly documented functions for converting an > AST to a code object, so your best bet may be to examine what a > pycodegen class like Expression or Module actually does. Than

Compile AST to bytecode?

2006-09-19 Thread Rob De Almeida
Hi, I would like to compile an AST to bytecode, so I can eval it later. I tried using parse.compileast, but it fails: >>> import compiler, parser >>> ast = compiler.parse("42") >>> parser.compileast(ast) Traceback (most recent call last): File "", line 1, in ? TypeError: compilest() argument 1

Re: ancestor class' __init__ doesn't call other methods

2006-09-15 Thread Rob De Almeida
Luis P. Mendes wrote: > Method a() is not called. Why is this? What is the best option to > solve this? Have Cotacoes returning values and not to be an ancestor > class of CruzaEmas? It works for me, after rearranging your code a little bit: class Ema: pass class Sistema: def __init__

Re: Where to find fpconst?

2006-09-04 Thread Rob De Almeida
> Anybody know where I can find fpconst? I uploaded the lastest copy I could find to the Cheese Shop (http://www.python.org/pypi/fpconst/). I'm not affiliated in any way with fpconst, btw. Rob -- http://mail.python.org/mailman/listinfo/python-list