[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Ammar Askar

Changes by Ammar Askar :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Shmuel Amar

Shmuel Amar added the comment:

ok thanks i think it can be closed

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Mark Dickinson

Mark Dickinson added the comment:

I think you're misreading the signature. The '*' is not a parameter in its own 
right; it's a piece of syntax marking the end of the positional parameters. 
Everything following that can only be passed by keyword.  See PEP 3102 for an 
explanation of the syntax.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Shmuel Amar

Shmuel Amar added the comment:

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 "", line 1, in 
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.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29389] math.isclose signature contains incorrect start parameter

2017-01-30 Thread Shmuel Amar

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 "", line 1, in 
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@python
components: Documentation
messages: 286474
nosy: Shmuel Amar, docs@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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com