Skip to content

Commit

Permalink
add dict type to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PgBiel committed Jan 15, 2025
1 parent 25eee7e commit fa1d532
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/book/src/types/type-system/type-combinators.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ You can use `types.exact(typ)` to ensure there is no casting involved for this t
## `types.array`: Array of a type

You can use `types.array(typ)` to accept arrays of elements of the same type.

## `types.dict`: Dictionary with values of a type

You can use `types.dict(typ)` to accept dictionaries with values of the same type. (Note that dictionary keys are all strings.)

For example, `(a: 5, b: 6)` is a valid `dict(int)`, but not a valid `dict(str)`.

0 comments on commit fa1d532

Please sign in to comment.