def deprecate_bear(bear):
 bear.old_run = bear.run
 def warn_deprecation_and_run(*args, **kwargs):
  logging.warning('The bear {} is deprecated. Use {} instead!'.format(bear.__name__, bear.__bases__[0].__name__))
  return bear.old_run(*args, **kwargs)
 bear.run = warn_deprecation_and_run
 return bear

def deprecate_bear ( bear ) : bear . old_run = bear . run def warn_deprecation_and_run ( * args , ** kwargs ) : logging . warning ( 'The bear {} is deprecated. Use {} instead!' . format ( bear . __name__ , bear . __bases__ [ 0 ] . __name__ ) ) return bear . old_run ( * args , ** kwargs ) bear . run = warn_deprecation_and_run return bear
use this to deprecate a bear .