In article <mailman.9537.1398635527.18130.python-l...@python.org>, Andrew Konstantaras <akon...@icloud.com> wrote: >-=-=-=-=-=- > >I guess I am missing something big as I am looking for a shorthand way >of doing the following: > > dctA = dict(x=x, y=y, ... n=n) > >This is, as I understand it a very natural way of using a dictionary. >It seems that this syntax is unnecessarily redundant and hence my goal >of writing something more compact. Perhaps the way I am doing it is a >little unorthodox, but the ultimate use of a dictionary is, as I >understand it, completely in line with how dictionaries were designed to >be used. In my other code, I often use these dictionaries to pass >arguments to functions and return results. It allows me great >flexibility without breaking existing code. I pack a dictionary before >passing and unpack when retrieving.
Okay very well. I suggest you use the m4 preprocessor. This will allow you to get a maximum of compactness without compromising the Python language. Implementations of it are available on MS-Windows too. > >I will give the locals approach a try, it seems a little more clumsy >than simply passing the variables to the function. > >Thanks again for your input. > >---Andrew > <SNIP> <Was that top posting? Too late I snipped it already> Groetjes Albert -- Albert van der Horst, UTRECHT,THE NETHERLANDS Economic growth -- being exponential -- ultimately falters. albert@spe&ar&c.xs4all.nl &=n http://home.hccnet.nl/a.w.m.van.der.horst
-- https://mail.python.org/mailman/listinfo/python-list