Why (for example web2py) you return data from a controller in a dictionary instead (see Rails) in variables?
For example:
return dict(sape=4139, guido=4127, jack=4098)
instead of (that's the way Rails does it)
@var1 = "jello"
@var2 = "hihi"
Is there any advantage using dictionaries over plain variables (speed-wise/code-wise)?
Update: The above way is actually a correct way for creating a dictionary (at least in Puthon 2.6.1). The other way (that many people say it's the correct one)
return {"var1": "jello", "var2": "hihi"}
is not used a lot by python frameworks.
From Python's documentation: "When the keys are simple strings, it is sometimes easier to specify pairs using keyword arguments:"
dict(sape=4139, guido=4127, jack=4098)