complex() bug or feature?
Carsten Gaebler
clpy at snakefarm.org
Thu Nov 8 08:39:27 EST 2001
Michael Hudson wrote:
>
> Carsten Gaebler <clpy at snakefarm.org> writes:
>
> > >>> complex('1', '1')
> > (1+0j)
> According to the docs, this is in error:
>
> ,--http://python.sourceforge.net/devel-docs/lib/built-in-funcs.html---
> I read that to mean that if the first arg is a string, it should be
> the only arg. The code simply ignores imag if real is a string. Do
> you want to open a bug, or shall I?
Well, where exactly is the bug? Should the docs read 'If _real_ is a
string, _imag_ is ignored and defaults to zero', or should the
implementation raise an exception because it violates the docs? I'd
prefer the latter.
cg.
---
'In iteger arithetric divsion is no the oposite of multiplication.'
More information about the Python-list
mailing list