Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Support for nested indexing? #53

@davidbrochart

Description

@davidbrochart

What happened:

Nested indexing doesn't seem to be supported.

What you expected to happen:

Maybe it's not in the scope of this library, but it would be great if the mutable mapping felt more like a dictionary.

Minimal Complete Verifiable Example:

import pickle
import zlib

from zict import File, Func, LRU

l4 = File("cache/", mode="a")
l3 = Func(zlib.compress, zlib.decompress, l4)
l2 = Func(pickle.dumps, pickle.loads, l3)
l1 = LRU(100, l2)

l1["foo"] = {}
l1["foo"]
# {}

l1["foo"]["bar"] = {}
l1["foo"]["bar"]
# Traceback (most recent call last):
#   File "<stdin>", line 1, in <module>
# KeyError: 'bar'

Anything else we need to know?:

I'd like to use zict in akernel to cache the execution of cells. It currently uses a dictionary for the cache, and I thought I would be able to swap if with a mutable mapping from zict.

Environment:

  • Dask version: N/A
  • Python version: 3.10
  • Operating System: Ubuntu 21.04
  • Install method (conda, pip, source): pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions