Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/inspect.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


�
��c@sdZdZdZddkZddkZddkZddkZddkZddkZddk	Z	ddk
Z
ddkZddkl
Z
d�Zd�Zd�Zd	�Zd
�Zeed�o
d�Zn
d
�Zeed�o
d�Zn
d�Zd�Zd�Zd�Zd�Zd�Zd�Zdd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%d �Z&dd!�Z'hZ(hZ)dd"�Z*d#�Z+d$�Z,d%e-fd&��YZ.d'dFd(��YZ/d)�Z0d*�Z1d+�Z2d,�Z3d-d.�Z4dG\Z5Z6Z7Z8d3�Z9d4�Z:d5�Z;d6�Z<e<d7�Z=ddde>d8�d9�d:�e<d;�Z?e>d<�d=�d>�e<d?�Z@d/d@�ZAdA�ZBd/dB�ZCd/dC�ZDeiEZFd/dD�ZGd/dE�ZHdS(HsuGet useful information from live Python objects.

This module encapsulates the interface provided by the internal special
attributes (func_*, co_*, im_*, tb_*, etc.) in a friendlier fashion.
It also provides some help for examining source code and class layout.

Here are some of the useful functions provided by this module:

    ismodule(), isclass(), ismethod(), isfunction(), istraceback(),
        isframe(), iscode(), isbuiltin(), isroutine() - check object types
    getmembers() - get members of an object that satisfy a given condition

    getfile(), getsourcefile(), getsource() - find an object's source code
    getdoc(), getcomments() - get documentation on an object
    getmodule() - determine the module that an object came from
    getclasstree() - arrange classes so as to represent their hierarchy

    getargspec(), getargvalues() - get info about function arguments
    formatargspec(), formatargvalues() - format an argument spec
    getouterframes(), getinnerframes() - get info about frames
    currentframe() - get the current stack frame
    stack(), trace() - get info about frames on the stack or in a traceback
sKa-Ping Yee <[email protected]>s
1 Jan 2001i�N(t
attrgettercCst|ti�S(s�Return true if the object is a module.

    Module objects provide these attributes:
        __doc__         documentation string
        __file__        filename (missing for built-in modules)(t
isinstancettypest
ModuleType(tobject((s/sys/lib/python/inspect.pytismodule#scCs t|ti�p
t|d�S(s�Return true if the object is a class.

    Class objects provide these attributes:
        __doc__         documentation string
        __module__      name of module in which this class was definedt	__bases__(RRt	ClassTypethasattr(R((s/sys/lib/python/inspect.pytisclass+scCst|ti�S(s�Return true if the object is an instance method.

    Instance method objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this method was defined
        im_class        class object in which this method belongs
        im_func         function object containing implementation of method
        im_self         instance to which this method is bound, or None(RRt
MethodType(R((s/sys/lib/python/inspect.pytismethod3s	cCsHt|d�o8t|d�o't|�ot|�ot|�S(s�Return true if the object is a method descriptor.

    But not if ismethod() or isclass() or isfunction() are true.

    This is new in Python 2.2, and, for example, is true of int.__add__.
    An object passing this test has a __get__ attribute but not a __set__
    attribute, but beyond that the set of attributes varies.  __name__ is
    usually sensible, and __doc__ often is.

    Methods implemented via descriptors that also pass one of the other
    tests return false from the ismethoddescriptor() test, simply because
    the other tests promise more -- you can, e.g., count on having the
    im_func attribute (etc) when an object passes ismethod().t__get__t__set__(RRt
isfunctionR	(R((s/sys/lib/python/inspect.pytismethoddescriptor>s
cCst|d�o
t|d�S(s�Return true if the object is a data descriptor.

    Data descriptors have both a __get__ and a __set__ attribute.  Examples are
    properties (defined in Python) and getsets and members (defined in C).
    Typically, data descriptors will also have __name__ and __doc__ attributes
    (properties, getsets, and members have both of these attributes), but this
    is not guaranteed.R
R(R(R((s/sys/lib/python/inspect.pytisdatadescriptorRstMemberDescriptorTypecCst|ti�S(s�Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.(RRR(R((s/sys/lib/python/inspect.pytismemberdescriptor^scCstS(s�Return true if the object is a member descriptor.

        Member descriptors are specialized descriptors defined in extension
        modules.(tFalse(R((s/sys/lib/python/inspect.pyRfstGetSetDescriptorTypecCst|ti�S(s�Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.(RRR(R((s/sys/lib/python/inspect.pytisgetsetdescriptoroscCstS(s�Return true if the object is a getset descriptor.

        getset descriptors are specialized descriptors defined in extension
        modules.(R(R((s/sys/lib/python/inspect.pyRwscCst|ti�S(sReturn true if the object is a user-defined function.

    Function objects provide these attributes:
        __doc__         documentation string
        __name__        name with which this function was defined
        func_code       code object containing compiled function bytecode
        func_defaults   tuple of any default values for arguments
        func_doc        (same as __doc__)
        func_globals    global namespace in which this function was defined
        func_name       (same as __name__)(RRtFunctionType(R((s/sys/lib/python/inspect.pyR~scCst|ti�S(sbReturn true if the object is a traceback.

    Traceback objects provide these attributes:
        tb_frame        frame object at this level
        tb_lasti        index of last attempted instruction in bytecode
        tb_lineno       current line number in Python source code
        tb_next         next inner traceback object (called by this level)(RRt
TracebackType(R((s/sys/lib/python/inspect.pytistraceback�scCst|ti�S(s|Return true if the object is a frame object.

    Frame objects provide these attributes:
        f_back          next outer frame object (this frame's caller)
        f_builtins      built-in namespace seen by this frame
        f_code          code object being executed in this frame
        f_exc_traceback traceback if raised in this frame, or None
        f_exc_type      exception type if raised in this frame, or None
        f_exc_value     exception value if raised in this frame, or None
        f_globals       global namespace seen by this frame
        f_lasti         index of last attempted instruction in bytecode
        f_lineno        current line number in Python source code
        f_locals        local namespace seen by this frame
        f_restricted    0 or 1 if frame is in restricted execution mode
        f_trace         tracing function for this frame, or None(RRt	FrameType(R((s/sys/lib/python/inspect.pytisframe�scCst|ti�S(suReturn true if the object is a code object.

    Code objects provide these attributes:
        co_argcount     number of arguments (not including * or ** args)
        co_code         string of raw compiled bytecode
        co_consts       tuple of constants used in the bytecode
        co_filename     name of file in which this code object was created
        co_firstlineno  number of first line in Python source code
        co_flags        bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
        co_lnotab       encoded mapping of line numbers to bytecode indices
        co_name         name with which this code object was defined
        co_names        tuple of names of local variables
        co_nlocals      number of local variables
        co_stacksize    virtual machine stack space required
        co_varnames     tuple of names of arguments and local variables(RRtCodeType(R((s/sys/lib/python/inspect.pytiscode�scCst|ti�S(s,Return true if the object is a built-in function or method.

    Built-in functions and methods provide these attributes:
        __doc__         documentation string
        __name__        original name of this function or method
        __self__        instance to which a method is bound, or None(RRtBuiltinFunctionType(R((s/sys/lib/python/inspect.pyt	isbuiltin�scCs1t|�p$t|�pt|�p
t|�S(s<Return true if the object is any kind of function or method.(RRRR(R((s/sys/lib/python/inspect.pyt	isroutine�s


cCsfg}xOt|�D]A}t||�}|p
||�o|i||f�qqW|i�|S(s�Return all members of an object as (name, value) pairs sorted by name.
    Optionally, only return members that satisfy a given predicate.(tdirtgetattrtappendtsort(Rt	predicatetresultstkeytvalue((s/sys/lib/python/inspect.pyt
getmembers�s

c
Cs�t|�}t|�}g}x[|D]S}||ijo|i|}nt||�}t|dd�}|djo0x-|D]!}||ijo|}Pq�q�Wn|dj	o!||ijo|i|}nt||�}t|t�o
d}	n_t|t�o
d}	nEt|t�o
d}	n+t	|�p
t
|�o
d}	nd}	|i||	||f�q%W|S(s�Return list of attribute-descriptor tuples.

    For each name in dir(cls), the return list contains a 4-tuple
    with these elements:

        0. The name (a string).

        1. The kind of attribute this is, one of these strings:
               'class method'    created via classmethod()
               'static method'   created via staticmethod()
               'property'        created via property()
               'method'          any other flavor of method
               'data'            not a method

        2. The class which defined this attribute (a class).

        3. The object as obtained directly from the defining class's
           __dict__, not via getattr.  This is especially important for
           data attributes:  C.data is just a data object, but
           C.__dict__['data'] may be a data descriptor with additional
           info, like a __doc__ string.
    t__objclass__s
static methodsclass methodtpropertytmethodtdataN(tgetmroR t__dict__R!tNoneRtstaticmethodtclassmethodR*RRR"(
tclstmrotnamestresulttnametobjthomeclstbasetobj_via_getattrtkind((s/sys/lib/python/inspect.pytclassify_class_attrs�s<







cCsG||jodSn|i|�x|iD]}t||�q,WdS(N(R"Rt_searchbases(R2taccumR9((s/sys/lib/python/inspect.pyR=s


cCs<t|d�o|iSng}t||�t|�SdS(sHReturn tuple of base classes (including cls) in method resolution order.t__mro__N(RR?R=ttuple(R2R5((s/sys/lib/python/inspect.pyR-#s

cCs,ti|�}t|�tti|��S(sBReturn the indent size, in spaces, at the start of a line of text.(tstringt
expandtabstlentlstrip(tlinetexpline((s/sys/lib/python/inspect.pyt
indentsize-scCs�y
|i}Wntj
odSnXt|ti�pdSnytiti|�d�}Wnt	j
odSn!Xt
i}xQ|dD]E}tti
|��}|o#t|�|}t||�}q�q�W|o|di
�|d<n|t
ijo6x3tdt|��D]}|||||<qWnx"|o|do|i�q@Wx%|o|do|id�qeWti|d�SdS(s�Get the documentation string for an object.

    All tabs are expanded to spaces.  To clean up docstrings that are
    indented to line up with blocks of code, any whitespace than can be
    uniformly removed from the second line onwards is removed.s
iii�N(t__doc__tAttributeErrorR/RRtStringTypesRAtsplitRBtUnicodeErrortsystmaxintRCRDtmintrangetpoptjoin(RtdoctlinestmarginREtcontenttindentti((s/sys/lib/python/inspect.pytgetdoc2s6
			 cCst|�o+t|d�o|iSntd��nt|�o@tii|i�}t|d�o|iSntd��nt	|�o
|i
}nt|�o
|i}nt
|�o
|i}nt|�o
|i}nt|�o|iSntd��dS(s@Work out which source or compiled file an object was defined in.t__file__sarg is a built-in modulesarg is a built-in classsNarg is not a module, class, method, function, traceback, frame, or code objectN(RRRZt	TypeErrorR	RMtmodulestgett
__module__Rtim_funcRt	func_codeRttb_frameRtf_codeRtco_filename(R((s/sys/lib/python/inspect.pytgetfileVs(










cCs~tii|�}td�ti��}|i�xC|D];\}}}}|||jo|| |||fSq;q;WdS(sDGet the module name, suffix, mode, and module type for a given file.cSs&|\}}}t|�|||fS((RC(t.0tsuffixtmodetmtype((s/sys/lib/python/inspect.pyt<lambda>qsN(tostpathtbasenametmaptimptget_suffixesR#(RktfilenametsuffixestneglenRfRgRh((s/sys/lib/python/inspect.pyt
getmoduleinfons	
cCs#t|�}|o|dSndS(s1Return the module name for a given file, or None.iN(Rs(Rktinfo((s/sys/lib/python/inspect.pyt
getmodulenamexscCs�t|�}ti|d�djo|d d}nxSti�D]E\}}}d|jo)ti|t|��|jodSqEqEWtii	|�o|Snt
t||�d�o|SndS(	sEReturn the Python source file an object was defined in, if it exists.i�s.pycs.pyos.pytbt
__loader__N(s.pycs.pyo(RdRAtlowerRnRoRCR/RjRktexistsRt	getmodule(RRpRfRgR;((s/sys/lib/python/inspect.pyt
getsourcefile}s
.cCsF|djot|�p
t|�}ntiitii|��S(s�Return an absolute path to the source or compiled file for an object.

    The idea is for each object to have a unique origin, so this routine
    normalizes the result as much as possible.N(R/R{RdRjRktnormcasetabspath(Rt	_filename((s/sys/lib/python/inspect.pyt
getabsfile�s
c
Cs8t|�o|Snt|d�otii|i�Sn|dj	o%|tjotiit|�Snyt||�}Wnt	j
odSnX|tjotiit|�Snx�tii
�D]�\}}t|�ott|d�od|i}|ti|d�joq�n|t|<t|�}|i
t|<ttii|�<q�q�W|tjotiit|�Sntid}t|d�pdSnt||i
�o+t||i
�}||jo|Sq�ntid}t||i
�o+t||i
�}	|	|jo|Sq4ndS(sAReturn the module an object was defined in, or None if not found.R^RZt__main__t__name__t__builtin__N(RRRMR\R]R^R/t
modulesbyfileRR[titemsRZt_filesbymodnameR�RjRktrealpathR!(
RR~tfiletmodnametmoduletftmaint
mainobjecttbuiltint
builtinobject((s/sys/lib/python/inspect.pyRz�sF
	
	
)




c
Cstt|�p
t|�}t||�}|oti||i�}nti|�}|ptd��nt|�o|dfSnt|�o�|i	}t
id|d�}g}xwtt
|��D]c}|i||�}|oC||ddjo||fSn|i|id�|f�q�q�W|o |i�||ddfSqmtd��nt|�o
|i}nt|�o
|i}nt|�o
|i}nt|�o
|i}nt|�o�t|d�ptd	��n|id}	t
id
�}x5|	djo'|i||	�oPn|	d}	q!W||	fSntd��dS(
sbReturn the entire source file and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of all the lines
    in the file and the line number indexes a line in that list.  An IOError
    is raised if the source code cannot be retrieved.scould not get source codeis^(\s*)class\s*s\btciscould not find class definitiontco_firstlinenos"could not find function definitions+^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)scould not find code objectN(R{RdRzt	linecachetgetlinesR.tIOErrorRR	R�tretcompileRPRCtmatchR"tgroupR#RR_RR`RRaRRbRRR�(
RR�R�RTR6tpatt
candidatesRXR�tlnum((s/sys/lib/python/inspect.pyt
findsource�sT

	$










c
Csyt|�\}}Wnttfj
odSnXt|�od}|o|dd djo
d}nx<|t|�jo(ti||�d	jo|d}qrW|t|�jo�||d djotg}|}xQ|t|�jo=||d djo(|iti	||��|d}q�Wti
|d�Sqn�|djo�t||�}|d}|djozti||�d djo\t||�|joEtiti	||��g}|djo�|d}titi	||��}xv|d djo`t||�|joI|g|d*|d}|djoPntiti	||��}qWnx0|o(ti|d�djog|d*q�Wx0|o(ti|d�djog|d)q�Wti
|d�SqndS(
swGet lines of comments immediately preceding an object's source code.

    Returns None when source can't be found.
    iis#!itt#i�N(R�R�(
R�R�R[R/RRCRAtstripR"RBRRRGRD(RRTR�tstarttcommentstendRWtcomment((s/sys/lib/python/inspect.pytgetcommentssF	
&0(+

+

+

%$$t
EndOfBlockcBseZRS((R�R^(((s/sys/lib/python/inspect.pyR�0stBlockFindercBs eZdZd�Zd�ZRS(s@Provide a tokeneater() method to detect the end of a code block.cCs1d|_t|_t|_t|_d|_dS(Nii(RWRtislambdatstartedtpasslinetlast(tself((s/sys/lib/python/inspect.pyt__init__4s
				c
CsM|\}}|\}}	|ipA|djo'|djo
t|_nt|_nt|_n�|tijo*t|_||_|io
t�qIn�|ion�|ti	jo|i
d|_
t|_nr|tijo.|i
d|_
|i
djo
t�qIn4|i
djo#|titi
fjo
t�ndS(Ntdeftclasstlambdaii(R�R�slambda(R�tTrueR�R�ttokenizetNEWLINERR�R�tINDENTRWtDEDENTtCOMMENTtNL(
R�ttypettokent.3t.4REtsrowtscolterowtecol((s/sys/lib/python/inspect.pyt
tokeneater;s,





		


)(R�R^RHR�R�(((s/sys/lib/python/inspect.pyR�2s	cCsPt�}y tit|�i|i�Wnttfj
onX||i S(s@Extract the block of code at the top of the given list of lines.(R�R�titertnextR�R�tIndentationErrorR�(RTtblockfinder((s/sys/lib/python/inspect.pytgetblockYs	 cCsIt|�\}}t|�o|dfSnt||�|dfSdS(s�Return a list of source lines and starting line number for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a list of the lines
    corresponding to the object and the line number indicates where in the
    original source file the first line of code was found.  An IOError is
    raised if the source code cannot be retrieved.iiN(R�RR�(RRTR�((s/sys/lib/python/inspect.pytgetsourcelinesbscCs"t|�\}}ti|d�S(sReturn the text of the source code for an object.

    The argument may be a module, class, method, function, traceback, frame,
    or code object.  The source code is returned as a single string.  An
    IOError is raised if the source code cannot be retrieved.R�(R�RARR(RRTR�((s/sys/lib/python/inspect.pyt	getsourceoscCsxg}|idtdd��xR|D]J}|i||if�||jo!|it||||��q&q&W|S(s-Recursive helper function for getclasstree().R&R^R�(R#RR"Rtwalktree(tclassestchildrentparentR%R�((s/sys/lib/python/inspect.pyR�ys
%icCs�h}g}x�|D]�}|io]xx|iD]K}||jog||<n||i|�|o||joPq-q-Wq||jo|i|�qqWx,|D]$}||jo|i|�q�q�Wt||d�S(s�Arrange the given list of classes into a hierarchy of nested lists.

    Where a nested list appears, it contains classes derived from the class
    whose entry immediately precedes the list.  Each entry is a 2-tuple
    containing a class and a tuple of its base classes.  If the 'unique'
    argument is true, exactly one entry appears in the returned structure
    for each class in the given list.  Otherwise, classes using multiple
    inheritance and their descendants will appear multiple times.N(RR"R�R/(R�tuniqueR�trootsR�R�((s/sys/lib/python/inspect.pytgetclasstree�s$	


!

iiiicCsot|�ptd��n|i}|i}|i}t|| �}d}x�t|�D]�}||d djo�ggg}}}	xk|t|�joWt||�}
|d}|
t	i
jo)t	i|
}t||�t||d�d}|d}|d
jo|i|�|	i|�q�d
jo�|i||�|p|dg|d<Pq�|dd|d<x]|ddjoK|i
�|	i
�}
||
g||
)|pPn|dd|d<q�W|pPq�q��q�W|d||<q[q[Wd}|it@o|i|}|d}nd}|it@o|i|}n|||fS(sGet information about the arguments accepted by a code object.

    Three things are returned: (args, varargs, varkw), where 'args' is
    a list of argument names (possibly containing nested lists), and
    'varargs' and 'varkw' are the names of the * and ** arguments or None.sarg is not a code objectiiR�t.iitUNPACK_TUPLEtUNPACK_SEQUENCEt
STORE_FASTi�(R�R�(R�R�N(RR[tco_codetco_argcounttco_varnamestlistRPRCtordtdist
HAVE_ARGUMENTtopnameR"RQR/tco_flagst
CO_VARARGStCO_VARKEYWORDS(tcotcodetnargsR4targststepRXtstacktremaintcounttopR�R'tsizetvarargstvarkw((s/sys/lib/python/inspect.pytgetargs�sV
			


&





cCsbt|�o
|i}nt|�ptd��nt|i�\}}}||||ifS(slGet the names and default values of a function's arguments.

    A tuple of four things is returned: (args, varargs, varkw, defaults).
    'args' is a list of the argument names (it may contain nested lists).
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'defaults' is an n-tuple of the default values of the last n arguments.
    sarg is not a Python function(RR_RR[R�R`t
func_defaults(tfuncR�R�R�((s/sys/lib/python/inspect.pyt
getargspec�s	


cCs+t|i�\}}}||||ifS(sWGet information about arguments passed into a particular frame.

    A tuple of four things is returned: (args, varargs, varkw, locals).
    'args' is a list of the argument names (it may contain nested lists).
    'varargs' and 'varkw' are the names of the * and ** arguments or None.
    'locals' is the locals dictionary of the given frame.(R�Rbtf_locals(tframeR�R�R�((s/sys/lib/python/inspect.pytgetargvalues�scCsCt|�djod|ddSndti|d�dSdS(Nit(is,)s, t)(RCRARR(tseq((s/sys/lib/python/inspect.pytjoinseq�scCsGt|�ttfjo |t||d�|��Sn||�SdS(s7Recursively walk a sequence, stringifying each element.cSst|||�S((tstrseq(toR�tj((s/sys/lib/python/inspect.pyRi�sN(R�R�R@Rm(RtconvertRR((s/sys/lib/python/inspect.pyR��s cCsd|S(t*((R6((s/sys/lib/python/inspect.pyRiscCsd|S(s**((R6((s/sys/lib/python/inspect.pyRiscCsdt|�S(t=(trepr(R'((s/sys/lib/python/inspect.pyRisc	
Cs�g}	|ot|�t|�}
nxmtt|��D]Y}t||||�}|o)||
jo|||||
�}n|	i|�q:W|dj	o|	i||��n|dj	o|	i||��ndti|	d�dS(sgFormat an argument spec from the 4 values returned by getargspec.

    The first four arguments are (args, varargs, varkw, defaults).  The
    other four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.R�s, R�N(RCRPR�R"R/RARR(
R�R�R�tdefaultst	formatargt
formatvarargstformatvarkwtformatvalueRRtspecstfirstdefaultRXtspec((s/sys/lib/python/inspect.pyt
formatargspecs

cCsd|S(R�((R6((s/sys/lib/python/inspect.pyRiscCsd|S(s**((R6((s/sys/lib/python/inspect.pyRiscCsdt|�S(R�(R�(R'((s/sys/lib/python/inspect.pyRi sc	Cs�|||d�}	g}
x7tt|��D]#}|
it|||	|��q+W|o%|
i||�|||��n|o%|
i||�|||��ndti|
d�dS(sfFormat an argument spec from the 4 values returned by getargvalues.

    The first four arguments are (args, varargs, varkw, locals).  The
    next four arguments are the corresponding optional formatting functions
    that are called to turn names and values into strings.  The ninth
    argument is an optional function to format the sequence of arguments.cSs||�|||�S(N((R6tlocalsR�R�((s/sys/lib/python/inspect.pyR�(sR�s, R�(RPRCR"R�RARR(R�R�R�RR�R�R�R�RRR�R�RX((s/sys/lib/python/inspect.pytformatargvaluess!%%c	Cs.t|�o|i}|i}n
|i}t|�ptd��nt|�p
t|�}|djo�|d|d}yt|�\}}Wnt	j
od}}qXt|d�}tdt|t
|�|��}||||!}|d|}nd}}|||ii||fS(s�Get information about a frame or traceback object.

    A tuple of five things is returned: the filename, the line number of
    the current line, the function name, a list of lines of context from
    the source code, and the index of the current line within that list.
    The optional second argument specifies the number of lines of context
    to return, which are centered around the current line.s&arg is not a frame or traceback objectiiiN(Rt	tb_linenoRatf_linenoRR[R{RdR�R�R/tmaxRORCRbtco_name(R�tcontexttlinenoRpR�RTR�tindex((s/sys/lib/python/inspect.pytgetframeinfo5s&
	
	

"
cCs|iS(sCGet the line number from a frame object, allowing for optimization.(R(R�((s/sys/lib/python/inspect.pyt	getlinenoVscCs?g}x2|o*|i|ft||��|i}q	W|S(s�Get a list of records for a frame and all higher (calling) frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.(R"Rtf_back(R�R	t	framelist((s/sys/lib/python/inspect.pytgetouterframes[s

cCsBg}x5|o-|i|ift||��|i}q	W|S(s�Get a list of records for a traceback's frame and all lower frames.

    Each record contains a frame object, filename, line number, function
    name, a list of lines of context, and index within the context.(R"RaRttb_next(ttbR	R((s/sys/lib/python/inspect.pytgetinnerframesfs

 cCsttid�|�S(s@Return a list of records for the stack above the caller's frame.i(RRMt	_getframe(R	((s/sys/lib/python/inspect.pyR�sscCstti�d|�S(sCReturn a list of records for the stack below the current exception.i(RRMtexc_info(R	((s/sys/lib/python/inspect.pyttracews((iiii(IRHt
__author__t__date__RMRjRRAR�R�RnR�R�toperatorRRR	RRRRRRRRRRRRR/R(R<R=R-RGRYRdRsRuR{RR�R�RzR�R�t	ExceptionR�R�R�R�R�R�R�tCO_OPTIMIZEDtCO_NEWLOCALSR�R�R�R�R�R�R�tstrRRRR
RRRtcurrentframeR�R(((s/sys/lib/python/inspect.pys<module>s�l					

	
		
	
						G		
		$		
			.	=	-'			
	
	
	;		
		!		

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].