3 ms·
Isn't that a hash? Shouldn't python version be: dog['head']['ears'][0]['hairs'][123] ?
by viraptor 12y ago
Isn't that a hash? Shouldn't python version be: dog['head']['ears'][0]['hairs'][123] ?
- maratc 12y agoIn both Perl and Python, "object" is a glorified hash, and its attributes are entries in that hash. Python just allows for a deeper level of syntactic sugar.
- deleted 12y ago[deleted]
- pwr22 12y agoIn Perl a hash is any scalar value blessed into a class In modern Perl the attibutes would be accessed through accessors so the original example needs tr/{}/()/