Andrea Crotti wrote:
On Feb 11, 3:56 pm, Martin De Kauwe <mdeka...@gmail.com> wrote:
Hi,

I have a series of parameter values which i need to pass throughout my
code (>100), in C I would use a structure for example. However in
python it is not clear to me if it would be better to use a dictionary
or build a class object? Personally I think accessing the values is
neater (visually) with an object rather than a dictionary, e.g.

x = params['price_of_cats'] * params['price_of_elephants']

vs.

x = params.price_of_cats * params.price_of_elephants

Visually neater is not really a good parameter to judge.

I strongly disagree.  Code readability is one of the most important issues.

~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to