Comment 2 for bug 1229447

Revision history for this message
Jean-Paul Calderone (exarkun) wrote :

Here's one idea:

    from twisted.python.deprecate import deprecated

    @deprecated(...)
    class SomeDeprecatedThing(object):
        ...

Although since the goal of the deprecation should be for this code to result in a warning being emitted:

    from module import SomeDeprecatedThing

possibly the solution needs to be something more like `deprecatedModuleAttribute`.

I guess the important point is that there are two goals to keep in mind for this one API. It needs to cause a `DeprecationWarning` to be emitted when the deprecated API is used and it needs to inform pydoctor that it should annotate some generated documentation with deprecation information.