File: api_attrdict.md

package info (click to toggle)
python-milc 1.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 788 kB
  • sloc: python: 1,868; sh: 55; makefile: 3
file content (47 lines) | stat: -rw-r--r-- 749 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<a id="attrdict"></a>

# attrdict

<a id="attrdict.AttrDict"></a>

## AttrDict Objects

```python
class AttrDict(object)
```

A dictionary that can also be accessed by attribute.

<a id="attrdict.AttrDict.__getitem__"></a>

#### \_\_getitem\_\_

```python
def __getitem__(key: Any) -> Any
```

Returns an item.

<a id="attrdict.SparseAttrDict"></a>

## SparseAttrDict Objects

```python
class SparseAttrDict(AttrDict)
```

A dictionary that can also be accessed by attribute.

This class never raises IndexError, instead it will return None if a
key does not yet exist.

<a id="attrdict.SparseAttrDict.__getitem__"></a>

#### \_\_getitem\_\_

```python
def __getitem__(key: Any) -> Any
```

Returns an item, creating it if it doesn't already exist