---
title: dictview | CodeWeaver Docs
description: API reference for codeweaver.core.types.dictview
url: "https://docs.knitli.com/api/core/types/dictview"
type: static
generatedAt: "2026-04-17T17:21:08.161Z"
---

# dictview
       [Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F.%20I%20want%20to%20ask%20questions%20about%20it.)[View in Markdown](/codeweaver/api/core/types/dictview.md)       [Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F)[Share on X](https://x.com/intent/tweet?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F&text=dictview)[Share on Threads](https://threads.net/intent/post?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F&text=dictview)[Share on Bluesky](https://bsky.app/intent/compose?text=dictview%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F)[Share on Reddit](https://reddit.com/submit?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F&title=dictview)[Share on Hacker News](https://news.ycombinator.com/submitlink?u=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F&t=dictview)[Share on Email](mailto:?subject=dictview&body=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F)[Share on WhatsApp](https://wa.me/?text=dictview%20https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F)[Share on Telegram](https://t.me/share/url?url=https%3A%2F%2Fdocs.knitli.com%2Fcodeweaver%2Fapi%2Fcore%2Ftypes%2Fdictview%2F&text=dictview)
# `codeweaver.core.types.dictview`
[Section titled “codeweaver.core.types.dictview”](#codeweavercoretypesdictview)
Read-only view wrapper around a mapping (intended for TypedDict-backed dicts).

## Class: `DictView`
[Section titled “Class: DictView”](#class-dictview)
Read-only view wrapper around a mapping (intended for TypedDict-backed dicts).

Provides a read-only view of a TypedDict (or other) mapping, preventing any modifications to the underlying data. This is useful for exposing configuration or data structures that should not be altered after creation.

Args: mapping (TypedDictT): The mapping to wrap. make_immutable (bool, optional): Whether to make the underlying mapping immutable using `MappingProxyType`. Defaults to `True`. Important things to understand here:

 - DictView is always read-only, and the underlying mapping, if it is mutable, cannot be modified through the DictView interface (but can still be modified directly if the original mapping is accessible).
 - If `make_immutable` is `True`, the underlying mapping is wrapped in a `MappingProxyType`, making it immutable. This prevents any modifications to the original mapping through any references *to this mapping* — like DictView, MappingProxyType provides a dynamic read-only view of the original mapping. The main difference is hashability and performance: MappingProxyType is hashable and slightly faster for read operations.
 - If `make_immutable` is `False`, the original mapping is used directly. This is useful if the original mapping is already immutable or you’re not paranoid about mutability like we are.

### Method: `get`
[Section titled “Method: get”](#method-get)

**

```
get()
```

Return the value for the given key, or the default value if the key is not found.

### Method: `get_subview`
[Section titled “Method: get_subview”](#method-get_subview)

**

```
get_subview()
```

Return a DictView of the sub-mapping at the given key.

### Method: `items`
[Section titled “Method: items”](#method-items)

**

```
items()
```

Return a view of the items in the mapping.

### Method: `keys`
[Section titled “Method: keys”](#method-keys)

**

```
keys()
```

Return a view of the keys in the mapping.

### Method: `values`
[Section titled “Method: values”](#method-values)

**

```
values()
```

Return a view of the values in the mapping.