Re: Recursion limit problems

2007-05-14 Thread elventear
On May 14, 2:03 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > > Dicts and sets use the key's hash value to determine the "bucket" where > the key will be placed, and == to distingish between different objects > with the same hash value. > That is, you should define __hash__ and one of (_

Re: Recursion limit problems

2007-05-14 Thread elventear
On May 14, 1:20 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > Dicts first compare hashes and if they are equal, then check equality. If > two unequal strings have the same hash value, as is possible of course > (given only 2**32 possible hashes and many more possible strings), both can > still

Re: Recursion limit problems

2007-05-14 Thread elventear
On May 12, 12:25 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Fri, 11 May 2007 19:17:57 -0300, elventear <[EMAIL PROTECTED]> > escribió: > "The only required property is that objects which compare equal have the > same hash value; it is advis

Re: Recursion limit problems

2007-05-14 Thread elventear
On May 11, 11:54 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > > Without seeing the full code and the exception traceback, my guess is that > your __hash__ somehow calls itself due to a refence loop in your object. A > simple example of a loop: > a = []; a.append(a) > Now, list objects are not ha

Recursion limit problems

2007-05-11 Thread elventear
Hello everyone, I am runing into recursion limit problems. I have found that the culprit was related to the __hash__ function that I had assigned to the objects that were added to a set. Basically my __hash__ function is the following: def __hash__(self): out_int = 0

Re: Problem with inspect.getfile

2007-05-02 Thread elventear
On May 2, 1:12 am, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Wed, 02 May 2007 02:53:55 -0300, elventear <[EMAIL PROTECTED]> > escribió: > > > Found the offending code. I was importing between files that were at > > the same level of the

Re: Problem with inspect.getfile

2007-05-01 Thread elventear
Found the offending code. I was importing between files that were at the same level of the hierarchy without using absolute references. Coded worked fine, but inspect didn't. Was this gaffe on my part? Or was inspect supposed to handle it? Thanks! On May 1, 12:48 pm, elventear <[EMAIL P

Problem with inspect.getfile

2007-05-01 Thread elventear
ally the path I get is: "/Users/elventear/Documents/UTMEM/Projects/geotools/parsers/parser.py" When the correct path should be: "/Users/elventear/Documents/UTMEM/Projects/packages/geotools/parsers/ parser.py" Finally my PYTHONPATH contains: "/Users/elventear/Docum

Martel Package from Biopython

2007-04-18 Thread elventear
Hello, I know this is not the best place to ask this but I haven't had luck in the Biopython forums with my questions, so I'll just try here. I want to use the Martel package to do some parsing. I've found it to be very powerful and convenient. Yet the documentation avaialble is less than complet

Re: Question about Python on Mac

2006-05-21 Thread elventear
James Stroud wrote: > I think fink is not detecting the gmp (GNU multiple precision arithmetic > library) dependency. > > Try: > > % fink install gmp > > Then try building gmpy with /sw/bin/python. I think I didn't explain myself very well. gmp is already installed in my computer; when building gm

Re: Question about Python on Mac

2006-05-19 Thread elventear
On 2006-05-19 16:19:51 -0500, "elventear" <[EMAIL PROTECTED]> said: > The weird thing is that just for kicks I tried building with Python > that comes with MacOSX (py2.3) and it works. It builds and it loads > fine. Anybody have an idea why this would happen? Any ideas ho

Question about Python on Mac

2006-05-19 Thread elventear
Hello, I am working with Python 2.4.3 built from source courtesy of Fink. So far so good, until now. I want to use a module called GMPY (http://gmpy.sf.net/). I am able to build correctly the module, but once I try to import it I get the following error: ImportError: Failure linking new module: g

Decimal and Exponentiation

2006-05-19 Thread elventear
Hi, I am the in the need to do some numerical calculations that involve real numbers that are larger than what the native float can handle. I've tried to use Decimal, but I've found one main obstacle that I don't know how to sort. I need to do exponentiation with real exponents, but it seems that