Take the 2-minute tour ×  I have renamed a python class being a
part of a library. I am willing to leave a possibility to use
its previous name for some time but would like to warn user that
it's deprecated and will be removed somewhere in the future.  I
think that to provide backward compatibility it will be enough
to use an alias like that:  class NewClsName:  OldClsName =
NewClsName  I have no idea how to mark the OldClsName as
deprecated in an elegant way. Maybe I could make OldClsName a
function which emits a warning (to logs) and constructs the
NewClsName object from its parameters (using *args and **kvargs)
but it doesn't seem elegant enough (or maybe it is?).
Unfortunately, I don't know how Python standard library
deprecation warnings work but I imagine that there may be some
nice magic to deal with deprecation, e.g. allowing treating it
as errors or silencing depending on some interpreter's command
line option.  The question is: How to warn users about using an
obsolete class alias (or obsolete clas