bundles / astropy 7.0.1 / astropy / utils / decorators / deprecated
function
astropy.utils.decorators:deprecated
source: /astropy/utils/decorators.py :32
Signature
def deprecated ( since , message = '' , name = '' , alternative = '' , pending = False , obj_type = None , warning_type = <class 'astropy.utils.exceptions.AstropyDeprecationWarning'> , * , pending_warning_type = <class 'astropy.utils.exceptions.AstropyPendingDeprecationWarning'> ) Summary
Used to mark a function or class as deprecated.
Extended Summary
To mark an attribute as deprecated, use deprecated_attribute.
Parameters
since: strThe release at which this API became deprecated. This is required.
message: str, optionalOverride the default deprecation message. The format specifier
funcmay be used for the name of the function, andalternativemay be used in the deprecation message to insert the name of an alternative to the deprecated function.obj_typemay be used to insert a friendly name for the type of object being deprecated.name: str, optionalThe name of the deprecated function or class; if not provided the name is automatically determined from the passed in function or class, though this is useful in the case of renamed functions, where the new function is just assigned to the name of the deprecated function. For example
def new_function(): ... oldFunction = new_function
alternative: str, optionalAn alternative function or class name that the user may use in place of the deprecated object. The deprecation warning will tell the user about this alternative if provided.
pending: bool, optionalIf True, uses a
pending_warning_typeinstead of awarning_type.obj_type: str, optionalThe type of this object, if the automatically determined one needs to be overridden.
warning_type: WarningWarning to be issued. Default is AstropyDeprecationWarning.
pending_warning_type: WarningPending warning to be issued. This only works if
pendingis set to True. Default is AstropyPendingDeprecationWarning.
Aliases
-
astropy.utils.deprecated