> ## Documentation Index
> Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
> Use this file to discover all available pages before exploring further.

# experimental()

<span id="atoti.experimental" />

> atoti.experimental(<br />
>     *feature\_keys*: [Set](https://docs.python.org/3/library/collections.abc.html#collections.abc.Set)\[[str](https://docs.python.org/3/library/stdtypes.html#str)] | [Callable](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable)\[\[[set](https://docs.python.org/3/library/stdtypes.html#set)\[[str](https://docs.python.org/3/library/stdtypes.html#str)]], [Set](https://docs.python.org/3/library/collections.abc.html#collections.abc.Set)\[[str](https://docs.python.org/3/library/stdtypes.html#str)]],<br />
>     /,<br />
> ) → [Generator](https://docs.python.org/3/library/collections.abc.html#collections.abc.Generator)\[[None](https://docs.python.org/3/library/constants.html#None), [None](https://docs.python.org/3/library/constants.html#None), [None](https://docs.python.org/3/library/constants.html#None)]

Create a context allowing to use the experimental features with the passed keys.

<Warning>
  Experimental features are subject to breaking changes in any release.
</Warning>

### Parameters

<h4 id="atoti.experimental.feature_keys">
  *feature\_keys*
</h4>

The keys of the experimental features allowed to be used inside the context.

If a [`Callable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable) is passed, it will be called with the keys of all the experimental features and it must return the keys to allow.

***

By default, calling an experimental function/method raises an error:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> foo()
Traceback (most recent call last):
    ...
RuntimeError: This API is experimental, use `with tt.experimental({'foo'}): ...` to allow it.
```

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> bar = Bar()
>>> bar.prop
Traceback (most recent call last):
    ...
RuntimeError: This API is experimental, use `with tt.experimental({'Bar.prop'}): ...` to allow it.
```

An experimental feature can be used by passing its key to this function:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"foo"}):
...     foo()
```

Multiple keys can be passed:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"foo", "Bar.prop"}):
...     foo()
...     bar.prop
```

Nesting is supported too:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"foo"}):
...     foo()
...     with tt.experimental({"Bar.prop"}):
...         foo()
...         bar.prop
...     foo()
```

Once a feature is stabilized, passing its key to this function will raise a deprecation warning:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"baz"}):
...     None
Traceback (most recent call last):
    ...
FutureWarning: Experimental feature with key `baz` has been stabilized, stop passing its key.
```

Passing a key that does not match any feature will raise an error:

```pycon theme={"languages":{"custom":["/engine/python-sdk/0.9/languages/pycon.tmLanguage.json"]}}
>>> with tt.experimental({"quux"}):  
...     None
Traceback (most recent call last):
    ...
ValueError: No experimental feature with key `quux`, existing keys are ...
```
