Comment

Anthony Ricaud

The solution comes down to merging the `data` and `initial` dicts, with a preference for the content of `data`. Using an idiomatic merge would outline this behaviour. https://treyhunner.com/2016/02/how-to-merge-dictionaries-in-python/ has a bunch of those.

```python
def __init__(self, data, **kwargs):
    initial = kwargs.get('initial', {})
    data = {**initial, **data}
    super().__init__(data, **kwargs)
```

Replies

Peter Bengtsson

That's neat! It's ultimately sugar syntax to my otherwise clunky loop where I merge `data` and `kwargs.get('initial')`. Thanks!