[Python-ideas] Quick idea: defining variables from functions that take the variable name

Xavier Combelle xavier.combelle at gmail.com
Wed Jun 1 21:34:41 EDT 2016


2016-06-02 1:50 GMT+02:00 Jonathan Goble <jcgoble3 at gmail.com>:

> I have a completely different idea here. Forget clunky syntax, overloading
> of 'def' and 'as', and all that. Introduce the magic parameter '$'. To wit:
>
>     def func(*args, **kwargs, $):  # positioning of the $ is discussed
> below
>         ...  # function code here
>


Why not a method similar to what is done with *args and **kwargs
(I chose pretty arbitrarely /namearg)

so for definition it would be
    def func(*args, **kwargs, /namearg):

and for override it would be
Record = namedtuple('name, address, phone, age', /'BusinessCard')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160602/1215990c/attachment.html>


More information about the Python-ideas mailing list