generated from mintlify/starter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41a730a
commit 4ea2b91
Showing
3 changed files
with
199 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
--- | ||
title: 'repr' | ||
--- | ||
|
||
<a id="repr.repr_mode"></a> | ||
|
||
--- | ||
|
||
### repr\_mode | ||
|
||
```python | ||
def repr_mode() -> str | ||
``` | ||
|
||
Gets the global representation mode as currently set. This is used when representing | ||
the various unify types on screen. Can be either "verbose" or "concise". | ||
|
||
<a id="repr.key_repr"></a> | ||
|
||
--- | ||
|
||
### key\_repr | ||
|
||
```python | ||
def key_repr(instance: _FormattedBaseModel) -> Union[Dict, List] | ||
``` | ||
|
||
Get the key representation for the instance passed, either as the keys to keep or | ||
the keys to remove. | ||
|
||
**Arguments**: | ||
|
||
- `instance` - The instance for which we want to retrieve the key repr policy. | ||
|
||
|
||
**Returns**: | ||
|
||
Dict containing the policy, with a base key of "skip" or "keep", followed by | ||
the nested structure of the elements to either remove or keep. | ||
|
||
<a id="repr.keys_to_skip"></a> | ||
|
||
--- | ||
|
||
### keys\_to\_skip | ||
|
||
```python | ||
def keys_to_skip() -> Dict[Type, Dict] | ||
``` | ||
|
||
Return the currently set keys to skip, which is a dict with types as keys and the | ||
nested structure to skip as values. | ||
|
||
<a id="repr.set_keys_to_skip"></a> | ||
|
||
--- | ||
|
||
### set\_keys\_to\_skip | ||
|
||
```python | ||
def set_keys_to_skip(skip_keys: Union[Dict[Type, Dict], str]) -> None | ||
``` | ||
|
||
Set the keys to be skipped during representation, which is a dict with types as keys | ||
and the nested structure to skip as values. | ||
|
||
**Arguments**: | ||
|
||
- `skip_keys` - The types as keywords arguments and dictionary representing the | ||
structure of the keys to skip for that type as values. | ||
|
||
<a id="repr.keys_to_keep"></a> | ||
|
||
--- | ||
|
||
### keys\_to\_keep | ||
|
||
```python | ||
def keys_to_keep() -> Dict[Type, Dict] | ||
``` | ||
|
||
Return the currently set keys to keep, which is a dict with types as keys and the | ||
nested structure to keep as values. | ||
|
||
<a id="repr.set_keys_to_keep"></a> | ||
|
||
--- | ||
|
||
### set\_keys\_to\_keep | ||
|
||
```python | ||
def set_keys_to_keep(keep_keys: Union[Dict[Type, Dict], str]) -> None | ||
``` | ||
|
||
Set the keys to be kept during representation, which is a dict with types as keys | ||
and the nested structure to keep as values. | ||
|
||
**Arguments**: | ||
|
||
- `keep_keys` - The types as keywords arguments and dictionary representing the | ||
structure of the keys to keep for that type as values. | ||
|
||
<a id="repr.set_repr_mode"></a> | ||
|
||
--- | ||
|
||
### set\_repr\_mode | ||
|
||
```python | ||
def set_repr_mode(mode: str) -> None | ||
``` | ||
|
||
Sets the global representation mode, to be used when representing the various unify | ||
types on screen. Can be either "verbose" or "concise". | ||
|
||
**Arguments**: | ||
|
||
- `mode` - The value to set the mode to, either "verbose" or "concise". | ||
|
||
<a id="repr.ReprMode"></a> | ||
|
||
## ReprMode | ||
|
||
```python | ||
class ReprMode(str) | ||
``` | ||
|
||
<a id="repr.ReprMode.__init__"></a> | ||
|
||
--- | ||
|
||
### \_\_init\_\_ | ||
|
||
```python | ||
def __init__(val: str) | ||
``` | ||
|
||
Set a representation mode for a specific context in the code, by using the | ||
`with` an instantiation of this class. | ||
|
||
**Arguments**: | ||
|
||
- `val` - The value of the string, must be either "verbose" or "concise". | ||
|
||
<a id="repr.KeepKeys"></a> | ||
|
||
## KeepKeys | ||
|
||
```python | ||
class KeepKeys() | ||
``` | ||
|
||
<a id="repr.KeepKeys.__init__"></a> | ||
|
||
--- | ||
|
||
### \_\_init\_\_ | ||
|
||
```python | ||
def __init__(keep_keys: Union[Dict[Type, Dict], str]) | ||
``` | ||
|
||
Set a the keys to keep for a specific context in the code, by using the | ||
`with` an instantiation of this class. | ||
|
||
**Arguments**: | ||
|
||
- `keep_keys` - The types as keywords arguments and dictionary representing the | ||
structure of the keys to keep for that type as values. | ||
|
||
<a id="repr.SkipKeys"></a> | ||
|
||
## SkipKeys | ||
|
||
```python | ||
class SkipKeys() | ||
``` | ||
|
||
<a id="repr.SkipKeys.__init__"></a> | ||
|
||
--- | ||
|
||
### \_\_init\_\_ | ||
|
||
```python | ||
def __init__(skip_keys: Union[Dict[Type, Dict], str]) | ||
``` | ||
|
||
Set a the keys to skip for a specific context in the code, by using the | ||
`with` an instantiation of this class. | ||
|
||
**Arguments**: | ||
|
||
- `skip_keys` - The types as keywords arguments and dictionary representing the | ||
structure of the keys to skip for that type as values. | ||
|
||
<a id="types"></a> |