19 Dec
2010
19 Dec
'10
4:05 a.m.
On Sun, 19 Dec 2010 12:03:43 +1100
Steven D'Aprano
List comprehensions are also cryptic if you see them for the first time. The curly brackets with bars "{| |}" should symbolize that Python object are glorified dicts. It is also quite close to Ocaml's syntax for records.
Not really. A list comp looks like a cross between a list and a for-loop, which is exactly what a list comp is.
And actually python (composite) objects, conceptually, are closer to named tuples than to dicts; composite objects are _not_ collections. That they are based on dicts is, imo, an implementation detail. For this reason, I'm pleased their dict attr is weirdly called "__dict__". Denis -- -- -- -- -- -- -- vit esse estrany ☣ spir.wikidot.com