[Patches] [ python-Patches-479551 ] fix complex() with 2 string args

noreply@sourceforge.net noreply@sourceforge.net
Thu, 08 Nov 2001 07:13:10 -0800


Patches item #479551, was opened at 2001-11-08 05:21
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=479551&group_id=5470

Category: Core (C code)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Hudson (mwh)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: fix complex() with 2 string args

Initial Comment:
reported on c.l.py

>>> complex ("1", "1")
(1+0j)

>From my reading of the docs, this should fail.  Patch
does this, adds test case.

Assigned to Fred, largely at random.

----------------------------------------------------------------------

Comment By: Grant Griffin (dspguru)
Date: 2001-11-08 07:13

Message:
Logged In: YES 
user_id=70844

I agree with the discussion on c.l.py as to the 
interpretation of the docs, so it sounds like Michael's 
patch is a good thing.  However, along with the patch, I'd 
like to see the docs clarified a little.  Specifically, it 
would be nice if the docs stated that the imaginary part 
(if any) can be specified as part of the string using the 
standard "j" suffix:

   ActivePython 2.1.1, build 212 (ActiveState)
   >>> complex('1+1j')
   (1+1j)

This feature appears to be the reason that a separate 
imaginary argument was disallowed in the string case, so 
spelling that aspect out will help people understand (and 
therefore remember) the rules on this.

=g2

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=479551&group_id=5470