Shortcuts

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

warn_deprecated()[source]
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.

Read the Docs v: v0.4.4
Versions
latest
stable
v0.4.4
v0.4.3
v0.4.2
v0.4.1
v0.4.0
v0.3.5_b
v0.3.4
v0.3.3
v0.3.2
v0.3.1
Downloads
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.