[docs] [issue29389] math.isclose signature contains incorrect start parameter

Shmuel Amar report at bugs.python.org
Mon Jan 30 04:02:05 EST 2017


New submission from Shmuel Amar:

documentation of math.isclose() signature on https://docs.python.org/3/library/math.html#math.isclose is as follows:

    math.isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0)

the third star '*' argument is not allowed inside the function: 
https://hg.python.org/cpython/file/tip/Modules/clinic/mathmodule.c.h#l511

or mentioned in PEP485 here: https://www.python.org/dev/peps/pep-0485/#implementation

and does not work when trying provide more than 2 positional values:

>>> import math
>>> math.isclose(1,2,3, rel_tol=5.)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Function takes at most 2 positional arguments (3 given)

So IMHO to solve this remove the positional argument on the signature of isclose() as it misleading.

----------
assignee: docs at python
components: Documentation
messages: 286474
nosy: Shmuel Amar, docs at python
priority: normal
severity: normal
status: open
title: math.isclose signature contains incorrect start parameter
versions: Python 3.5, Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue29389>
_______________________________________


More information about the docs mailing list