python 3.1 complex number data type returning wrong result from .imag() function

Bug #511331 reported by seanlynch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python3.0 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: python3.0

the .imag() function is returning different results when operating on an object reference versus when operating on a complex data object directly.

Here is a python 3 interpreter session that shows the difference:

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

sean01@argonne:~/py3eg$ python3
Python 3.1.1+ (r311:74480, Nov 2 2009, 14:49:22)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import math
>>> # assign a reference to a complex number
...
>>> a = 3-4j
>>> # extract the real and imaginary parts
...
>>> a.real
3.0
>>> a.imag
-4.0
>>> # This worked as expected
...
>>> # now try doing this on a complex type directly
...
>>> 3-4j.real
3.0
>>> # That looks good
...
>>> 3-4j.imag
-1.0
>>> # expected -4.0 not -1.0
...
>>>
----------------------------------------------------------

lsb_release -rd:

Description: Ubuntu 9.10
Release: 9.10

----------------------------------------------------------
apt-cache policy python3.1:

python3.1:
  Installed: 3.1.1-0ubuntu5
  Candidate: 3.1.1-0ubuntu5
  Version table:
 *** 3.1.1-0ubuntu5 0
        500 http://mirror.anl.gov karmic-updates/universe Packages
        100 /var/lib/dpkg/status
     3.1.1-0ubuntu4 0
        500 http://mirror.anl.gov karmic/universe Packages
--------------------------------------------------------
apt-cache show python3.1:

Package: python3.1
Priority: optional
Section: universe/python
Installed-Size: 12148
Maintainer: Ubuntu Core Developers <email address hidden>
Original-Maintainer: Matthias Klose <email address hidden>
Architecture: i386
Version: 3.1.1-0ubuntu5
Provides: python3.1-celementtree, python3.1-cjkcodecs, python3.1-ctypes, python3.1-elementtree, python3.1-gdbm, python3.1-wsgiref
Depends: python3.1-minimal (= 3.1.1-0ubuntu5), mime-support, libbz2-1.0, libc6 (>= 2.7), libdb4.7, libncursesw5 (>= 5.6+20071006-3), libreadline6, libsqlite3-0 (>= 3.6.16)
Suggests: python3.1-doc, python3.1-profiler, binutils
Filename: pool/universe/p/python3.1/python3.1_3.1.1-0ubuntu5_i386.deb
Size: 3577990
MD5sum: b7c6fd0414223db6b9a3105375847caf
SHA1: 2ce438f87e6ff9d54ab420f489c9fedc0fcfa0a0
SHA256: 30d1bc140526d2f56b5bc473b92631565dffb1b33d87c237184cce2a957035fe
Description: An interactive high-level object-oriented language (version 3.1)
 Version 3.1 of the high-level, interactive object oriented language,
 includes an extensive class library with lots of goodies for
 network programming, system administration, sounds and graphics.
Python-Version: 3.1
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Package: python3.1
Priority: optional
Section: universe/python
Installed-Size: 12148
Maintainer: Ubuntu Core Developers <email address hidden>
Original-Maintainer: Matthias Klose <email address hidden>
Architecture: i386
Version: 3.1.1-0ubuntu4
Provides: python3.1-celementtree, python3.1-cjkcodecs, python3.1-ctypes, python3.1-elementtree, python3.1-gdbm, python3.1-wsgiref
Depends: python3.1-minimal (= 3.1.1-0ubuntu4), mime-support, libbz2-1.0, libc6 (>= 2.7), libdb4.7, libncursesw5 (>= 5.6+20071006-3), libreadline6, libsqlite3-0 (>= 3.6.16)
Suggests: python3.1-doc, python3.1-profiler, binutils
Filename: pool/universe/p/python3.1/python3.1_3.1.1-0ubuntu4_i386.deb
Size: 3577806
MD5sum: d24399d5868a7d8e47e765c111039d84
SHA1: e961b52cc69a57126094d2f1aaa5e1aae97254ea
SHA256: 334e6e3fffb37023280632caea37060c5f4187e410ed45412986fcc1c84a5854
Description: An interactive high-level object-oriented language (version 3.1)
 Version 3.1 of the high-level, interactive object oriented language,
 includes an extensive class library with lots of goodies for
 network programming, system administration, sounds and graphics.
Python-Version: 3.1
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Origin: Ubuntu

Related branches

Revision history for this message
seanlynch (sean-seanlynch) wrote :

Please close this bug I wrongly posted under python3.0 instead of python3.1 package.
I have opened a separate python3.1 bug # 511366

Sorry for the wrongly posted bug

Michael Bienia (geser)
Changed in python3.0 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.