[Python-Dev] Re: complex() bug or feature? (fwd)

Skip Montanaro skip@pobox.com (Skip Montanaro)
Thu, 8 Nov 2001 15:34:47 +0100


The topic of the behavior and documentation of complex() in the face of
string args came up in c.l.py.  I believe the current behavior and
documentation are both in error.  I have a patch, test case and doc fixes
that I still need to run.  Looks like a probably bug fix for 2.2b2 to me.
I'll submit a bug report and patch and assign to Tim.

Skip

------- start of forwarded message (RFC 934 encapsulation) -------
From: Skip Montanaro <montanaro@tttech.com>
Sender: python-list-admin@python.org
To: "Steve Holden" <sholden@holdenweb.com>
Cc: python-list@python.org
Subject: Re: complex() bug or feature?
Date: Thu, 08 Nov 2001 15:23:58 +0100
Reply-To: skip@pobox.com (Skip Montanaro)


    Steve> Well the documentation should really make it clear that the
    Steve> single string argument case is completely different from
    Steve> the single numeric argument case.  The former uses an
    Steve> implied zero as the imaginary component, whereas the latter
    Steve> extracts the imaginary component from the string.

    Steve> And yes, the implementation *should* raise an exception
    Steve> with a string first argument and any second argument. But
    Steve> the docs could use clarification.

I've got a patch for the code I need to test and will generate a patch
for the doc, then submit both later today.  I suspect this will make
it into 2.2.

- -- 
Skip Montanaro (skip@pobox.com)
http://www.mojam.com/
http://www.musi-cal.com/
------- end -------