diff options
author | Georg Brandl <georg@python.org> | 2007-03-17 16:08:45 +0000 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-03-17 16:08:45 +0000 |
commit | 2b869943fa284be9f3b9572df10b334f12962aa6 (patch) | |
tree | 4b14375b0251356b2399d78107c2cb3d4f7fc111 /Doc/lib/libcmath.tex | |
parent | 6f187743ffbce522c9d686ae5393272c1eb85dcc (diff) | |
download | cpython-git-2b869943fa284be9f3b9572df10b334f12962aa6.tar.gz |
Patch #1675423: PyComplex_AsCComplex() now tries to convert an object
to complex using its __complex__() method before falling back to the
__float__() method. Therefore, the functions in the cmath module now
can operate on objects that define a __complex__() method.
(backport)
Diffstat (limited to 'Doc/lib/libcmath.tex')
-rw-r--r-- | Doc/lib/libcmath.tex | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Doc/lib/libcmath.tex b/Doc/lib/libcmath.tex index 54e0cdb1fe..f8aa45bb4a 100644 --- a/Doc/lib/libcmath.tex +++ b/Doc/lib/libcmath.tex @@ -5,7 +5,14 @@ \modulesynopsis{Mathematical functions for complex numbers.} This module is always available. It provides access to mathematical -functions for complex numbers. The functions are: +functions for complex numbers. The functions in this module accept +integers, floating-point numbers or complex numbers as arguments. +They will also accept any Python object that has either a +\method{__complex__} or a \method{__float__} method: these methods are +used to convert the object to a complex or floating-point number, respectively, and +the function is then applied to the result of the conversion. + +The functions are: \begin{funcdesc}{acos}{x} Return the arc cosine of \var{x}. |