Idea: how about an alternative syntax specifically for argument list
definitions. To be able to write down a dict holding argument list in
simpler form, namely with a
function-like syntax:
mystyle = dict ** (linestyle="dotted", marker="s", color=
(0.1,0.1,0.0), markersize=4)
as a synonym for the common
dict:mystyle= {"linestyle": "dotted", marker": "s", "color": (0.1,0.1,
0.0), "markersize": "4"}
(The example is from Mathplotlib plot line style.)
Pros: same look as in functon arguments, thus less visual confusion and
less re-typing, With such syntax I could simply copy-paste, say, examples
from library docs to separate dict "mystyle" and ready to insert the dict
into other function making use of dict unpackong. If need to move some
argument from "mystyle" to function call, no re-typing needed. Also it
looks significantly cleaner with less quotes and less colons.
Mikhail
_______________________________________________
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/6Y7MVK23G2ITIA5BDEXYCUA34EIYRTLA/
Code of Conduct: http://python.org/psf/codeofconduct/