[issue8706] accept keyword arguments on most base type methods and builtins

2017-01-20 Thread INADA Naoki

INADA Naoki added the comment:

TL;DR

Changing positional argument name doesn't break backward compatibility.
After start accepting keyword argument, it's name is part of API and should be 
stable.

For example, document says `str.startswith(prefix[, start[, end]])`.
But this patch seems using `sub` instead of `prefix`.
https://docs.python.org/3.5/library/stdtypes.html#str.startswith

Keyword name should be chosen carefully, like choosing method name.
So I'm -1 to adding keyword argument support to many method in one issue.

--
nosy: +inada.naoki

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2017-01-20 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Most overhead of supporting keyword arguments when pass positional arguments 
was removed in issue29029. But still there is an overhead of passing argument 
by keywords. It can be decreased when convert functions to Argument Clinic or 
use new private argument parsing API. This is not very easy issue.

--
versions: +Python 3.7 -Python 3.5

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2016-02-14 Thread Nicholas Chammas

Changes by Nicholas Chammas :


--
nosy: +Nicholas Chammas

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2015-04-19 Thread Gregory P. Smith

Gregory P. Smith added the comment:

I wouldn't make an efficiency argument against it without trying it and
showing reproducible degradation in the hg.python.org/benchmarks suite.

On Sun, Apr 19, 2015, 10:31 PM Serhiy Storchaka 
wrote:

>
> Serhiy Storchaka added the comment:
>
> Supporting keyword arguments has performance loss. For fast builtins it
> make be significant. We should defer adding keyword arguments support until
> more efficient parsing will implemented. Note that it is easier to
> implement efficient argument parsing for functions with positional-only
> arguments (see for example issue23867).
>
> --
> nosy: +serhiy.storchaka
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2015-04-19 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Supporting keyword arguments has performance loss. For fast builtins it make be 
significant. We should defer adding keyword arguments support until more 
efficient parsing will implemented. Note that it is easier to implement 
efficient argument parsing for functions with positional-only arguments (see 
for example issue23867).

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2015-04-19 Thread Martin Panter

Martin Panter added the comment:

See also Issue 23738, which identifies some functions whose documentation 
already suggests they accept keywords. Perhaps these functions could be 
prioritized.

Also, I think “version changed” notices should be added in the documentation 
when a function grows support for keyword arguments.

--
nosy: +vadmium

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2015-04-19 Thread Berker Peksag

Changes by Berker Peksag :


--
components: +Extension Modules, Interpreter Core
nosy: +berker.peksag
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2014-07-21 Thread Julien Palard

Julien Palard added the comment:

I think for some builtins it may be usefull to have keyword arguments, in the 
case they take more than one parameter.

Typically, it's impossible to write:

self.drop_elements(partial(isinstance, type(lxml.etree.Comment)))

Because isinstance take its argument in the "other" order, we may bypass this 
using keywords arguments:


self.drop_elements(partial(isinstance, type=type(lxml.etree.Comment)))

But isinstance refuses keyword arguments, so there is no way to write this 
without a lambda:

self.drop_elements(lambda x: isinstance(x,
   type(lxml.etree.Comment)))

With is cool and work, I agree, it's just an example to explicitly show why 
keywords argument may be cool: functools.partial.

--
nosy: +Julien.Palard

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2012-03-02 Thread Éric Araujo

Éric Araujo  added the comment:

See also #13386 for the doc part.

--

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2012-03-01 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

I kicked off a discussion on python-ideas.  Lets take this there for the time 
being.

--

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2012-03-01 Thread Ezio Melotti

Ezio Melotti  added the comment:

> also: just because an argument is listed in the docs with a name does 
> not mean that that name is the most appropriate; part of adding keyword 
> support should be choosing a sensible name. 

I agree, but other implementations might not have this limitation and might 
already use the name that appears in the documentation/docstring -- or even a 
better one.

> I intend to bring this up for a brief discussion at the language summit
> next week

+1

--

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2012-03-01 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

restricting the scope of this makes sense.

also: just because an argument is listed in the docs with a name does not mean 
that that name is the most appropriate; part of adding keyword support should 
be choosing a sensible name.  Keyword arguments, when used, should increase the 
readability of code rather than add to confusion.

I intend to bring this up for a brief discussion at the language summit next 
week as representatives of all the Python VMs will be in the same room at once. 
 Goal: define the appropriate scope or at the very least non-scope.

As for performance and memory use, yes, it could have a small impact but it 
should not be large [worth measuring] and that seems like something we should 
fix in a more general way rather than by limiting the way methods can be called 
based on how a given VM is implemented.

--

___
Python tracker 

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



[issue8706] accept keyword arguments on most base type methods and builtins

2012-03-01 Thread Éric Araujo

Éric Araujo  added the comment:

I agree with Ezio and Raymond.  Tentatively editing the title to reflect the 
reduction in scope.

--
nosy: +eric.araujo
title: accept keyword arguments on all base type methods and builtins -> accept 
keyword arguments on most base type methods and builtins

___
Python tracker 

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