Module Expr Str Assign NameStore ListLoad Str Str Str Str Str Import alias alias ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias Assign NameStore Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr If BoolOpOr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad body Assign NameStore AttributeLoad NameLoad attr Return BinOpMod Str TupleLoad NameLoad NameLoad orelse If Call AttributeLoad NameLoad attr NameLoad body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Return BinOpMod Str TupleLoad NameLoad NameLoad Return NameLoad decorator_list Assign AttributeStore NameLoad attr Str Assign AttributeStore NameLoad attr Str FunctionDef arguments args defaults body Expr Str Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Global identifier Assign NameStore NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore BinOpMod Str TupleLoad Call NameLoad NameLoad If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad Return BinOpAdd NameLoad Str decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Return BinOpMod Str TupleLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore BinOpMod NameLoad Dict Str Str NameLoad Call NameLoad NameLoad If NameLoad body Assign NameStore BinOpMod Str TupleLoad NameLoad Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Return Call NameLoad Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad FunctionDef arguments args defaults vararg kwarg body Expr Call NameLoad NameLoad NameLoad keyword Num Return Call NameLoad NameLoad NameLoad decorator_list Assign NameStore Call NameLoad NameLoad NameLoad Expr Call NameLoad NameLoad Call NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore ListLoad If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad orelse If CompareEq Call NameLoad NameLoad Num body Expr Call AttributeLoad NameLoad attr ListLoad Str NameLoad Str orelse Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr ListLoad Str BinOpAdd NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad Str attr NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call AttributeLoad NameLoad attr NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Str NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Dict Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Return BinOpMod Str TupleLoad AttributeLoad Call NameLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Expr Call NameLoad AttributeLoad NameLoad attr NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad If AttributeLoad NameLoad attr body Assign NameStore NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If CompareIsNot NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr orelse Assign NameStore Call NameLoad AttributeLoad NameLoad attr NameLoad If CompareEq NameLoad Str body Assign AttributeStore NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpAdd BinOpAdd AttributeLoad NameLoad attr Str NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr BinOpAdd BinOpAdd NameLoad Str AttributeLoad NameLoad attr Expr Call NameLoad NameLoad NameLoad keyword Num Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Str Assign SubscriptStore NameLoad Index NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad If UnaryOpNot Call NameLoad NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Expr Call NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Assign NameStore SubscriptLoad SubscriptLoad NameLoad Index Num Index Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword AttributeLoad NameLoad attr keyword Call AttributeLoad NameLoad attr Str Dict keyword NameLoad If CompareLt SubscriptLoad AttributeLoad NameLoad attr Slice Num TupleLoad Num Num body Expr Call AttributeLoad NameLoad attr Str Expr Call NameLoad NameLoad NameLoad decorator_list
N/A N/A 
Deprecation framework for Twisted.

To mark a method or function as being deprecated do this::

    from twisted.python.versions import Version
    from twisted.python.deprecate import deprecated

    @deprecated(Version("Twisted", 8, 0, 0))
    def badAPI(self, first, second):
        '''
        Docstring for badAPI.
        '''
        ...

The newly-decorated badAPI will issue a warning when called. It will also have
a deprecation notice appended to its docstring.

To mark module-level attributes as being deprecated you can use::

    badAttribute = "someValue"

    ...

    deprecatedModuleAttribute(
        Version("Twisted", 8, 0, 0),
        "Use goodAttribute instead.",
        "your.full.module.name",
        "badAttribute")

The deprecated attributes will issue a warning whenever they are accessed. If
the attributes being deprecated are in the same module as the
L{deprecatedModuleAttribute} call is being made from, the C{__name__} global
can be used as the C{moduleName} parameter.

See also L{Version}.

@type DEPRECATION_WARNING_FORMAT: C{str}
@var DEPRECATION_WARNING_FORMAT: The default deprecation warning string format
    to use when one is not provided by the user.
 N/A __all__ N/A deprecated getDeprecationWarningString getWarningMethod setWarningMethod deprecatedModuleAttribute N/A sys inspect warnings warn warn_explicit dis findlinestarts twisted.python.versions getVersionString twisted.python.util mergeFunctionMetadata N/A DEPRECATION_WARNING_FORMAT %(fqpn)s was deprecated in %(version)s _fullyQualifiedName N/A N/A obj N/A N/A N/A 
    Return the fully qualified name of a module, class, method or function.
    Classes and functions need to be module level ones to be correctly
    qualified.

    @rtype: C{str}.
     N/A name N/A obj __name__ N/A N/A N/A N/A inspect isclass obj N/A N/A inspect isfunction obj N/A N/A moduleName N/A obj __module__ N/A N/A %s.%s N/A moduleName name N/A N/A N/A N/A inspect ismethod obj N/A N/A className N/A _fullyQualifiedName N/A obj im_class N/A N/A %s.%s N/A className name N/A name N/A N/A N/A _fullyQualifiedName __module__ twisted.python.reflect N/A N/A _fullyQualifiedName __name__ fullyQualifiedName getWarningMethod N/A N/A N/A N/A N/A 
    Return the warning method currently used to record deprecation warnings.
     N/A warn N/A setWarningMethod N/A N/A newMethod N/A N/A N/A 
    Set the warning method to use to record deprecation warnings.

    The callable should take message, category and stacklevel. The return
    value is ignored.
     N/A warn N/A warn newMethod N/A _getDeprecationDocstring N/A N/A version replacement N/A None N/A N/A 
    Generate an addition to a deprecated object's docstring that explains its
    deprecation.

    @param version: the version it was deprecated.
    @type version: L{Version}

    @param replacement: The replacement, if specified.
    @type replacement: C{str} or callable

    @return: a string like "Deprecated in Twisted 27.2.0; please use
        twisted.timestream.tachyon.flux instead."
     N/A doc N/A Deprecated in %s N/A N/A getVersionString version N/A replacement N/A N/A doc N/A %s; %s N/A doc N/A _getReplacementString replacement N/A N/A doc . N/A _getReplacementString N/A N/A replacement N/A N/A N/A 
    Surround a replacement for a deprecated API with some polite text exhorting
    the user to consider it as an alternative.

    @type replacement: C{str} or callable

    @return: a string like "please use twisted.python.modules.getModule
        instead".
     N/A N/A callable replacement N/A N/A replacement N/A _fullyQualifiedName replacement N/A N/A please use %s instead N/A replacement N/A _getDeprecationWarningString N/A N/A fqpn version format replacement N/A None None N/A N/A 
    Return a string indicating that the Python name was deprecated in the given
    version.

    @param fqpn: Fully qualified Python name of the thing being deprecated
    @type fqpn: C{str}

    @param version: Version that C{fqpn} was deprecated in.
    @type version: L{twisted.python.versions.Version}

    @param format: A user-provided format to interpolate warning values into, or
        L{DEPRECATION_WARNING_FORMAT
        <twisted.python.deprecate.DEPRECATION_WARNING_FORMAT>} if C{None} is
        given.
    @type format: C{str}

    @param replacement: what should be used in place of C{fqpn}. Either pass in
        a string, which will be inserted into the warning message, or a
        callable, which will be expanded to its full import path.
    @type replacement: C{str} or callable

    @return: A textual description of the deprecation
    @rtype: C{str}
     N/A N/A format None N/A N/A format DEPRECATION_WARNING_FORMAT N/A warningString N/A format N/A fqpn version fqpn N/A getVersionString version N/A replacement N/A N/A warningString N/A %s; %s N/A warningString N/A _getReplacementString replacement N/A warningString N/A getDeprecationWarningString N/A N/A callableThing version format replacement N/A None None N/A N/A 
    Return a string indicating that the callable was deprecated in the given
    version.

    @type callableThing: C{callable}
    @param callableThing: Callable object to be deprecated

    @type version: L{twisted.python.versions.Version}
    @param version: Version that C{callableThing} was deprecated in

    @type format: C{str}
    @param format: A user-provided format to interpolate warning values into,
        or L{DEPRECATION_WARNING_FORMAT
        <twisted.python.deprecate.DEPRECATION_WARNING_FORMAT>} if C{None} is
        given

    @param callableThing: A callable to be deprecated.

    @param version: The L{twisted.python.versions.Version} that the callable
        was deprecated in.

    @param replacement: what should be used in place of the callable. Either
        pass in a string, which will be inserted into the warning message,
        or a callable, which will be expanded to its full import path.
    @type replacement: C{str} or callable

    @return: A string describing the deprecation.
    @rtype: C{str}
     N/A N/A _getDeprecationWarningString N/A _fullyQualifiedName callableThing version format replacement N/A deprecated N/A N/A version replacement N/A None N/A N/A 
    Return a decorator that marks callables as deprecated.

    @type version: L{twisted.python.versions.Version}
    @param version: The version in which the callable will be marked as
        having been deprecated.  The decorated function will be annotated
        with this version, having it set as its C{deprecatedVersion}
        attribute.

    @param version: the version that the callable was deprecated in.
    @type version: L{twisted.python.versions.Version}

    @param replacement: what should be used in place of the callable. Either
        pass in a string, which will be inserted into the warning message,
        or a callable, which will be expanded to its full import path.
    @type replacement: C{str} or callable
     deprecationDecorator N/A N/A function N/A N/A N/A 
        Decorator that marks C{function} as deprecated.
         N/A warningString N/A getDeprecationWarningString function version None replacement deprecatedFunction N/A N/A N/A args kwargs N/A N/A N/A warn warningString DeprecationWarning stacklevel 2 N/A N/A function args kwargs N/A N/A deprecatedFunction N/A mergeFunctionMetadata function deprecatedFunction N/A N/A _appendToDocstring deprecatedFunction N/A _getDeprecationDocstring version replacement N/A N/A deprecatedFunction deprecatedVersion version N/A deprecatedFunction N/A N/A deprecationDecorator N/A _appendToDocstring N/A N/A thingWithDoc textToAppend N/A N/A N/A 
    Append the given text to the docstring of C{thingWithDoc}.

    If C{thingWithDoc} has no docstring, then the text just replaces the
    docstring. If it has a single-line docstring then it appends a blank line
    and the message text. If it has a multi-line docstring, then in appends a
    blank line a the message text, and also does the indentation correctly.
     N/A N/A thingWithDoc __doc__ N/A N/A docstringLines N/A N/A N/A thingWithDoc __doc__ splitlines N/A N/A docstringLines N/A N/A N/A N/A len docstringLines 0 N/A N/A N/A N/A docstringLines append textToAppend N/A N/A N/A N/A len docstringLines 1 N/A N/A N/A N/A docstringLines extend N/A textToAppend N/A N/A spaces N/A N/A docstringLines pop N/A N/A N/A docstringLines extend N/A N/A spaces textToAppend spaces N/A N/A thingWithDoc __doc__ N/A N/A join docstringLines N/A _InternalState N/A object N/A N/A 
    An L{_InternalState} is a helper object for a L{_ModuleProxy}, so that it
    can easily access its own attributes, bypassing its logic for delegating to
    another object that it's proxying for.

    @ivar proxy: a L{ModuleProxy}
     __init__ N/A N/A self proxy N/A N/A N/A N/A N/A object __setattr__ self proxy proxy N/A __getattribute__ N/A N/A self name N/A N/A N/A N/A N/A object __getattribute__ N/A N/A object __getattribute__ self proxy name N/A __setattr__ N/A N/A self name value N/A N/A N/A N/A N/A object __setattr__ N/A N/A object __getattribute__ self proxy name value N/A N/A _ModuleProxy N/A object N/A N/A 
    Python module wrapper to hook module-level attribute access.

    Access to deprecated attributes first checks
    L{_ModuleProxy._deprecatedAttributes}, if the attribute does not appear
    there then access falls through to L{_ModuleProxy._module}, the wrapped
    module object.

    @ivar _module: Module on which to hook attribute access.
    @type _module: C{module}

    @ivar _deprecatedAttributes: Mapping of attribute names to objects that
        retrieve the module attribute's original value.
    @type _deprecatedAttributes: C{dict} mapping C{str} to
        L{_DeprecatedAttribute}

    @ivar _lastWasPath: Heuristic guess as to whether warnings about this
        package should be ignored for the next call.  If the last attribute
        access of this module was a C{getattr} of C{__path__}, we will assume
        that it was the import system doing it and we won't emit a warning for
        the next access, even if it is to a deprecated attribute.  The CPython
        import system always tries to access C{__path__}, then the attribute
        itself, then the attribute itself again, in both successful and failed
        cases.
    @type _lastWasPath: C{bool}
     __init__ N/A N/A self module N/A N/A N/A state N/A _InternalState self N/A N/A state _module module N/A N/A state _deprecatedAttributes N/A N/A N/A state _lastWasPath False N/A __repr__ N/A N/A self N/A N/A N/A 
        Get a string containing the type of the module proxy and a
        representation of the wrapped module object.
         N/A state N/A _InternalState self N/A N/A <%s module=%r> N/A N/A N/A type self __name__ N/A state _module N/A __setattr__ N/A N/A self name value N/A N/A N/A 
        Set an attribute on the wrapped module object.
         N/A state N/A _InternalState self N/A N/A state _lastWasPath False N/A N/A setattr N/A state _module name value N/A __getattribute__ N/A N/A self name N/A N/A N/A 
        Get an attribute from the module object, possibly emitting a warning.

        If the specified name has been deprecated, then a warning is issued.
        (Unless certain obscure conditions are met; see
        L{_ModuleProxy._lastWasPath} for more information about what might quash
        such a warning.)
         N/A state N/A _InternalState self N/A N/A state _lastWasPath N/A N/A deprecatedAttribute None N/A N/A deprecatedAttribute N/A N/A N/A state _deprecatedAttributes get name N/A N/A deprecatedAttribute None N/A N/A value N/A N/A deprecatedAttribute get N/A N/A value N/A getattr N/A state _module name N/A N/A name __path__ N/A N/A N/A state _lastWasPath True N/A N/A N/A state _lastWasPath False N/A value N/A N/A _DeprecatedAttribute N/A object N/A N/A 
    Wrapper for deprecated attributes.

    This is intended to be used by L{_ModuleProxy}. Calling
    L{_DeprecatedAttribute.get} will issue a warning and retrieve the
    underlying attribute's value.

    @type module: C{module}
    @ivar module: The original module instance containing this attribute

    @type fqpn: C{str}
    @ivar fqpn: Fully qualified Python name for the deprecated attribute

    @type version: L{twisted.python.versions.Version}
    @ivar version: Version that the attribute was deprecated in

    @type message: C{str}
    @ivar message: Deprecation message
     __init__ N/A N/A self module name version message N/A N/A N/A 
        Initialise a deprecated name wrapper.
         N/A N/A self module module N/A N/A self __name__ name N/A N/A self fqpn N/A N/A N/A module __name__ . name N/A N/A self version version N/A N/A self message message N/A get N/A N/A self N/A N/A N/A 
        Get the underlying attribute value and issue a deprecation warning.
         N/A result N/A getattr N/A self module N/A self __name__ N/A message N/A _getDeprecationWarningString N/A self fqpn N/A self version N/A N/A DEPRECATION_WARNING_FORMAT :  N/A self message N/A N/A warn message DeprecationWarning stacklevel 3 N/A result N/A N/A _deprecateAttribute N/A N/A proxy name version message N/A N/A N/A 
    Mark a module-level attribute as being deprecated.

    @type proxy: L{_ModuleProxy}
    @param proxy: The module proxy instance proxying the deprecated attributes

    @type name: C{str}
    @param name: Attribute name

    @type version: L{twisted.python.versions.Version}
    @param version: Version that the attribute was deprecated in

    @type message: C{str}
    @param message: Deprecation message
     N/A _module N/A N/A object __getattribute__ proxy _module N/A attr N/A _DeprecatedAttribute _module name version message N/A _deprecatedAttributes N/A N/A object __getattribute__ proxy _deprecatedAttributes N/A N/A _deprecatedAttributes N/A name attr N/A deprecatedModuleAttribute N/A N/A version message moduleName name N/A N/A N/A 
    Declare a module-level attribute as being deprecated.

    @type version: L{twisted.python.versions.Version}
    @param version: Version that the attribute was deprecated in

    @type message: C{str}
    @param message: Deprecation message

    @type moduleName: C{str}
    @param moduleName: Fully-qualified Python name of the module containing
        the deprecated attribute; if called from the same module as the
        attributes are being deprecated in, using the C{__name__} global can
        be helpful

    @type name: C{str}
    @param name: Attribute name to deprecate
     N/A module N/A N/A sys modules N/A moduleName N/A N/A N/A isinstance module _ModuleProxy N/A N/A module N/A _ModuleProxy module N/A N/A N/A sys modules N/A moduleName module N/A N/A _deprecateAttribute module name version message N/A warnAboutFunction N/A N/A offender warningString N/A N/A N/A 
    Issue a warning string, identifying C{offender} as the responsible code.

    This function is used to deprecate some behavior of a function.  It differs
    from L{warnings.warn} in that it is not limited to deprecating the behavior
    of a function currently on the call stack.

    @param function: The function that is being deprecated.

    @param warningString: The string that should be emitted by this warning.
    @type warningString: C{str}

    @since: 11.0
     N/A offenderModule N/A N/A sys modules N/A N/A offender __module__ N/A filename N/A N/A inspect getabsfile offenderModule N/A lineStarts N/A list N/A findlinestarts N/A offender func_code N/A lastLineNo N/A N/A lineStarts N/A -1 N/A 1 N/A globals N/A offender func_globals N/A kwargs N/A dict category DeprecationWarning filename filename lineno lastLineNo module N/A offenderModule __name__ registry N/A N/A globals setdefault __warningregistry__ N/A module_globals None N/A N/A N/A N/A sys version_info N/A 2 N/A 2 5 N/A N/A N/A N/A kwargs pop module_globals N/A N/A warn_explicit warningString kwargs N/A