declearn.utils.create_types_registry
Create a TypesRegistry backing generic (de)serialization utils.
Note: this function may either be used to create a registy with an existing type as base through functional syntax, or be placed as a decorator for class-defining code
Parameters:
Name | Type | Description | Default |
---|---|---|---|
base |
Optional[Type]
|
Base class that registered entries should inherit from. If None, return a class decorator. |
None
|
name |
Optional[str]
|
Name of the registry, used to register or access classes
using the generic |
None
|
Returns:
Name | Type | Description |
---|---|---|
base |
type
|
The input |
Source code in declearn/utils/_register.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|