Hacker News new | ask | show | jobs
by kshay 1048 days ago
So basically Perl autovivification for Python?
1 comments

Seems a subset of it. Practicality aside, Perl can autovivify not only hashes but also arrays:

  my %x;
  $x{foo}[1]{bar} = 42;  # %x is ( foo => [ undef, { bar => 42 } ] )