asteroid.utils.deprecation_utils module¶
-
exception
asteroid.utils.deprecation_utils.
VisibleDeprecationWarning
[source]¶ Bases:
UserWarning
Visible deprecation warning.
By default, python will not show deprecation warnings, so this class can be used when a very visible warning is helpful, for example because the usage is most likely a user bug.
-
class
asteroid.utils.deprecation_utils.
DeprecationMixin
[source]¶ Bases:
object
Deprecation mixin. Example to come
-
asteroid.utils.deprecation_utils.
mark_deprecated
(message, version=None)[source]¶ Decorator to add deprecation message.
Parameters: message – Migration steps to be given to users.
-
asteroid.utils.deprecation_utils.
is_overridden
(method_name, obj, parent=None) → bool[source]¶ Check if method_name from parent is overridden in obj.
Parameters: - method_name (str) – Name of the method.
- obj – Instance or class that potentially overrode the method.
- parent – parent class with which to compare. If None, traverse the MRO for the first parent that has the method.
Raises RuntimeError if parent is not a parent class and if parent doesn’t have the method. Or, if parent was None, that none of the potential parents had the method.