[Bug 804576] Re: Wrong info on complex()
Hans Joachim Desserud
804576 at bugs.launchpad.net
Wed Jan 2 17:12:55 UTC 2013
Thanks for reporting this issue and helping to make Ubuntu better.
I see the same result with your example with pychecker 0.8.19-6 on Ubuntu Raring. As I haven't used complex() before, I decided to check the documentation to see how many arguments it really require. However, I found conflicting information. According to python.org [1], the signature is complex([real[, imag]]). However, pydoc complex will list the following signature:
class complex(object)
| complex(real[, imag]) -> complex number
In other words, one have only optional arguments, while the second
require at least one argument and has an optional second one. I have not
verified this, but I would believe pychecker checks the signature of the
method in the same place pydoc gets it from. The question then is why do
they differ, and which is the correct one?
[1] http://docs.python.org/2/library/functions.html#complex
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-defaults in Ubuntu.
https://bugs.launchpad.net/bugs/804576
Title:
Wrong info on complex()
Status in “pychecker” package in Ubuntu:
New
Status in “python-defaults” package in Ubuntu:
New
Bug description:
Running pychecker on the code below incorrectly yields an error. In
fact, complex() is perfectly happy without any arguments.
$ cat foo.py
def foo():
return complex()
$
$ pychecker foo.py
Processing module foo (foo.py)...
Warnings...
foo.py:3: Invalid arguments to (complex), got 0, expected between 1 and 2
$
ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: pychecker 0.8.19-1
ProcVersionSignature: Ubuntu 2.6.38-10.46-generic 2.6.38.7
Uname: Linux 2.6.38-10-generic x86_64
NonfreeKernelModules: fglrx
Architecture: amd64
Date: Fri Jul 1 23:36:29 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Beta amd64 (20100901.1)
PackageArchitecture: all
ProcEnviron:
LANGUAGE=en_GB:en
PATH=(custom, user)
LANG=en_GB.UTF-8
SHELL=/bin/bash
SourcePackage: pychecker
UpgradeStatus: Upgraded to natty on 2011-04-30 (62 days ago)
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pychecker/+bug/804576/+subscriptions
More information about the foundations-bugs
mailing list