[Python-Dev] Fw: list.index(..) -> TypeError bug or feature?
Pearu Peterson
Pearu Peterson <pearu@cens.ioc.ee>
Tue, 6 Feb 2001 20:52:38 +0200 (EET)
On Tue, 6 Feb 2001, M.-A. Lemburg wrote:
> Fredrik Lundh wrote:
> >
> > (from comp.lang.python)
> >
> > can this be fixed? should this be fixed? (please?)
>
> Depends on whether gmpy (what is this, BTW) uses the old coercion
> mechanism correctly or not which is hard to say from here ;)
About gmpy, see
http://gmpy.sourceforge.net/
> Also, was gmpy recompiled for 2.1a2 and which part raised the
> exception (Python or gmpy) ?
gmpy was recompiled for 2.1a2, though the same gmpy worked fine with
2.0b2. The exception was raised in gmpy part.
> In any case, I'd say that .index() should not raise TypeErrors
> in case coercion fails.
I fixed this in gmpy source --- there the Pymp*_coerce functions raised an
exception instead of returning `1' when coerce failed.
So, this was gmpy bug, Python 2.1a2 just revealed it.
Regards,
Pearu