News for hackers. Stuff that matters.
Re:Perl 6 Optimism by arunix on Thursday January 25, 2018 @08:27AM (#16230591)
The difference is more dramatic once you have two or more dimensions:

    >>> foo = {}
    >>> foo[3][4] = 42
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    KeyError: 3
Compared to:

      DB<1> $foo{3}{4} = 42

      DB<2> x \%foo
    0  HASH(0x7f9f4315c940)
       3 => HASH(0x7f9f432bb148)
          4 => 42
Re:Perl 6 Optimism by pseudalopex on Monday January 29, 2018 @07:34AM (#16257095)

    tree = lambda: collections.defaultdict(tree)
    foo = tree()
    foo[3][4] = 42