A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-April/014433.html below:

string slicing and method consistency)

[Python-Dev] keyword-only arguments (was Re: string slicing and method consistency)Guido van Rossum guido@digicool.com
Mon, 23 Apr 2001 09:36:44 -0500
> Wouldn't it be nice if we could force particular arguments to be used as
> keyword arguments only ? :)

You could do this manually using **kwds (or its C equivalent), but it
gets ugly.

> I remember this coming up a few times on
> python-list, but I never quite understood why this isn't done. Syntax
> doesn't seem too much of a problem ('def split(s, sep, **, maxsplit=0)'
> comes to mind, and a new marker for PyArg_ParseTuple, like "**") and now
> that we have warnings and __future__, we could phase it in even for oft-used
> things such as string.split().
> 
> Even if it's deemed dubious hypergeneralization (look ma, no macro ;) it's
> worth writing a PEP about, right ?

Sure.  My main problem with it is that I doubt how often it is useful,
compared to the cost of adding the syntax and new code generation
necessary.  I don't think that ** is the right separator, but I don't
have a better suggestion.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4