[Python-ideas] str.rreplace

Neil Girdhar mistersheik at gmail.com
Tue Feb 4 04:15:25 CET 2014


I agree with everything you're saying.  Another reason to prefer keyword
arguments is that they simplify the interface and make it easier to learn.


On Mon, Feb 3, 2014 at 6:30 PM, Andrew Barnert <abarnert at yahoo.com> wrote:

> On Feb 3, 2014, at 14:11, Neil Girdhar <mistersheik at gmail.com> wrote:
>
> > Isn't the only reason that you don't like keyword arguments that take
> constant values a matter of efficiency?
>
> I'm pretty sure it's about clarity--letting you write what you mean, and
> making that meaning explicit at a glance--than performance. (On the rare
> occasions where performance makes a difference, surely you're already
> copying the method to a local variable anyway, right?)
>
> Keyword arguments imply a dynamic choice, different functions a static
> one, in basically the same way as, say, keyed values vs. attributes. So, if
> it would be very rare to choose between foo and rfoo dynamically, it makes
> sense for them to be separate methods; if it's relatively common, it makes
> sense to have a single method.
>
> (I'm not sure that it _would_ be rare, but if so, I agree with the rest of
> the argument against my point.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140203/5c8802fd/attachment.html>


More information about the Python-ideas mailing list