Module Expr Str ImportFrom alias TryExcept body ImportFrom alias handlers ExceptHandler type NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad Import alias FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr Assign NameStore CompareIs NameLoad NameLoad Assign NameStore CompareIn Str NameLoad Assign NameStore CompareIn Str NameLoad Assign NameStore BoolOpAnd NameLoad NameLoad Assign NameStore BoolOpAnd NameLoad CompareEq SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore BoolOpOr BoolOpAnd NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad NameLoad Index Str NameLoad Assign NameStore BoolOpAnd NameLoad CompareIs AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Str orelse If BoolOpAnd NameLoad UnaryOpNot NameLoad body Assign NameStore Str orelse If BoolOpAnd NameLoad UnaryOpNot NameLoad body Assign NameStore Str orelse If UnaryOpNot NameLoad body Assign NameStore Str orelse Assign NameStore Str Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults Num body Expr Str If NameLoad body Raise Call NameLoad Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign TupleStore NameStore NameStore NameStore NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Str If NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad orelse Assign NameStore Call AttributeLoad NameLoad attr Str NameLoad FunctionDef arguments args NameParam NameParam NameParam defaults body If CompareIn Str NameLoad body Delete SubscriptDel NameLoad Index Str If CompareIs NameLoad NameLoad body If NameLoad body Assign NameStore Call NameLoad NameLoad orelse Assign NameStore NameLoad orelse If Call NameLoad NameLoad body Assign NameStore NameLoad orelse Assign NameStore Call NameLoad NameLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad NameLoad Return Call NameLoad NameLoad decorator_list Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return BoolOpAnd Call NameLoad NameLoad NameLoad Call NameLoad NameLoad Str decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str Assign NameStore ListComp Call NameLoad NameLoad Str Call NameLoad NameLoad comprehension NameStore NameLoad If CompareIsNot NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad If CompareEq Call NameLoad NameLoad Num body Return SubscriptLoad NameLoad Index Num Assign NameStore Call NameLoad NameLoad If UnaryOpNot NameLoad body Assert UnaryOpNot NameLoad Return NameLoad orelse If CompareGt Call NameLoad NameLoad Num body Raise Call NameLoad Str NameLoad Return SubscriptLoad NameLoad Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str If UnaryOpNot NameLoad body Assign NameStore ListComp NameLoad comprehension NameStore NameLoad CompareIsNot NameLoad NameLoad Assign NameStore ListLoad For NameStore NameLoad body For NameStore NameLoad body If BoolOpAnd Call NameLoad NameLoad NameLoad CompareIsNot NameLoad NameLoad body Break orelse If CompareIn NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list
N/A N/A Class advice.

This module was adapted from 'protocols.advice', part of the Python
Enterprise Application Kit (PEAK).  Please notify the PEAK authors
(pje@telecommunity.com and tsarna@sarna.org) if bugs are found or
Zope-specific changes are required, so that the PEAK version of this module
can be kept in sync.

PEAK is a Python application framework that interoperates with (but does
not require) Zope 3 and Twisted.  It provides tools for manipulating UML
models, object-relational persistence, aspect-oriented programming, and more.
Visit the PEAK home page at http://peak.telecommunity.com for more information.
 types FunctionType N/A N/A types ClassType N/A N/A N/A ImportError N/A N/A __python3 True N/A N/A __python3 False N/A sys getFrameInfo N/A N/A frame N/A N/A N/A Return (kind,module,locals,globals) for a frame

    'kind' is one of "exec", "module", "class", "function call", or "unknown".
     N/A f_locals N/A frame f_locals N/A f_globals N/A frame f_globals N/A sameNamespace N/A f_locals f_globals N/A hasModule N/A __module__ f_locals N/A hasName N/A __name__ f_globals N/A sameName N/A hasModule hasName N/A sameName N/A sameName N/A N/A f_globals N/A __name__ N/A f_locals N/A __module__ N/A module N/A N/A hasName N/A N/A N/A sys modules get N/A f_globals N/A __name__ None N/A namespaceIsModule N/A module N/A N/A module __dict__ f_globals N/A N/A namespaceIsModule N/A N/A kind exec N/A N/A N/A sameNamespace N/A hasModule N/A N/A kind module N/A N/A N/A sameName N/A sameNamespace N/A N/A kind class N/A N/A N/A sameNamespace N/A N/A kind function call N/A N/A kind unknown N/A N/A kind module f_locals f_globals N/A addClassAdvisor N/A N/A callback depth N/A 2 N/A N/A Set up 'callback' to be passed the containing class upon creation

    This function is designed to be called by an "advising" function executed
    in a class suite.  The "advising" function supplies a callback that it
    wishes to have executed when the containing class is created.  The
    callback will be given one argument: the newly created containing class.
    The return value of the callback will be used in place of the class, so
    the callback should return the input if it does not wish to replace the
    class.

    The optional 'depth' argument to this function determines the number of
    frames between this function and the targeted class suite.  'depth'
    defaults to 2, since this skips this function's frame and one calling
    function frame.  If you use this function from a function called directly
    in the class suite, the default will be correct, otherwise you will need
    to determine the correct depth yourself.

    This function works by installing a special class factory function in
    place of the '__metaclass__' of the containing class.  Therefore, only
    callbacks *after* the last '__metaclass__' assignment in the containing
    class will be executed.  Be sure that classes using "advising" functions
    declare any '__metaclass__' *first*, to ensure all callbacks are run. N/A __python3 N/A N/A N/A TypeError Class advice impossible in Python3 N/A frame N/A N/A sys _getframe depth N/A N/A kind module caller_locals caller_globals N/A getFrameInfo frame N/A previousMetaclass N/A N/A caller_locals get __metaclass__ N/A __python3 N/A N/A defaultMetaclass N/A N/A caller_globals get __metaclass__ type N/A N/A defaultMetaclass N/A N/A caller_globals get __metaclass__ ClassType advise N/A N/A name bases cdict N/A N/A N/A N/A __metaclass__ cdict N/A N/A N/A cdict N/A __metaclass__ N/A N/A previousMetaclass None N/A N/A bases N/A N/A meta N/A determineMetaclass bases N/A N/A meta defaultMetaclass N/A N/A N/A isClassAdvisor previousMetaclass N/A N/A meta previousMetaclass N/A N/A meta N/A determineMetaclass bases previousMetaclass N/A newClass N/A meta name bases cdict N/A N/A callback newClass N/A N/A N/A advise previousMetaclass previousMetaclass N/A N/A advise callback callback N/A N/A caller_locals N/A __metaclass__ advise N/A isClassAdvisor N/A N/A ob N/A N/A N/A True if 'ob' is a class advisor function N/A N/A N/A isinstance ob FunctionType N/A hasattr ob previousMetaclass N/A determineMetaclass N/A N/A bases explicit_mc N/A None N/A N/A Determine metaclass from 1+ bases and optional explicit __metaclass__ N/A meta N/A N/A getattr b __class__ N/A type b N/A b bases N/A N/A explicit_mc None N/A N/A N/A N/A meta append explicit_mc N/A N/A N/A len meta 1 N/A N/A N/A meta N/A 0 N/A candidates N/A minimalBases meta N/A N/A candidates N/A N/A N/A __python3 N/A ClassType N/A N/A N/A N/A len candidates 1 N/A N/A N/A TypeError Incompatible metatypes bases N/A N/A candidates N/A 0 N/A minimalBases N/A N/A classes N/A N/A N/A Reduce a list of base classes to its ordered minimum equivalent N/A N/A __python3 N/A N/A classes N/A c N/A c classes N/A c ClassType N/A candidates N/A N/A m classes N/A N/A n classes N/A N/A N/A N/A issubclass n m N/A m n N/A N/A N/A N/A N/A m candidates N/A N/A N/A N/A candidates remove m N/A N/A N/A candidates append m N/A candidates N/A