deprecate_posargs
Function/method decorator to deprecate some or all positional arguments.
def deprecate_posargs(
deprecation_warning: Warning,
remappable_names: list
) - > function
Function/method decorator to deprecate some or all positional arguments. The decorated function will map any positional arguments after the * to the corresponding keyword arguments and issue a deprecation warning.
Parameters
| Name | Type | Description |
|---|---|---|
| deprecation_warning | Warning | The warning category class (e.g., RemovedInDjangoXXWarning) to be issued when deprecated positional arguments are used. |
| remappable_names | list | A list of parameter names, in their original positional order, that have been converted from positional-or-keyword to keyword-only. |
Returns
| Type | Description |
|---|---|
function | A decorator function that wraps the target function or method to handle positional-to-keyword argument remapping and warning issuance. |