[Bug 511366] [NEW] python 3.1 complex number data type returning wrong result from .imag() function

seanlynch sean.seanlynch at gmail.com
Fri Jan 22 21:26:52 UTC 2010


Public bug reported:

Binary package hint: python3.1

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 at 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 <ubuntu-devel-discuss at lists.ubuntu.com>
Original-Maintainer: Matthias Klose <doko at debian.org>
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 <ubuntu-devel-discuss at lists.ubuntu.com>
Original-Maintainer: Matthias Klose <doko at debian.org>
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

** Affects: python3.1 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
python 3.1 complex number data type returning wrong result from .imag() function
https://bugs.launchpad.net/bugs/511366
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs at lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs




More information about the universe-bugs mailing list