| 1 |
# Type Specifiers |
| 2 |
|
| 3 |
Type specifiers consist of primitive types with optional subtypes. |
| 4 |
|
| 5 |
Supported primitive types are listed in the [Muon |
| 6 |
Reference](https://docs.muon.build/reference) under the `Objects` header. |
| 7 |
|
| 8 |
A value that can take one of many types can be specified by writing multiple |
| 9 |
types separated with a `|` such as `int|str`. |
| 10 |
|
| 11 |
There are a few preset combinations of types: |
| 12 |
|
| 13 |
- `any` - all types except `null` |
| 14 |
- `exe` - `str|file|external_program|python_installation|build_tgt|custom_tgt` |
| 15 |
|
| 16 |
`dict` and `list` must be followed by a sub-type enclosed in square |
| 17 |
brackets, e.g. `dict[str|int]` or `list[any]`. |
| 18 |
|
| 19 |
You can also wrap the entire type in `glob[<type>]` or `listify[<type>]` to get |
| 20 |
the special argument handling detailed in [Muon Internals](internals.md) (search for |
| 21 |
`TYPE_TAG_{GLOB,LISTIFY}`). |
| 22 |
|
| 23 |
Applying the `glob` tag to the type of a kwarg causes any unmatched keywords to |
| 24 |
be stored in that kwarg as a dict. |