@@ -264,11 +264,16 @@ def isfunction(object):
264
264
Function objects provide these attributes:
265
265
__doc__ documentation string
266
266
__name__ name with which this function was defined
267
+ __qualname__ qualified name of this function
268
+ __module__ name of the module the function was defined in or None
267
269
__code__ code object containing compiled function bytecode
268
270
__defaults__ tuple of any default values for arguments
269
271
__globals__ global namespace in which this function was defined
270
272
__annotations__ dict of parameter annotations
271
- __kwdefaults__ dict of keyword only parameters with defaults"""
273
+ __kwdefaults__ dict of keyword only parameters with defaults
274
+ __dict__ namespace which is supporting arbitrary function attributes
275
+ __closure__ a tuple of cells or None
276
+ __type_params__ tuple of type parameters"""
272
277
return isinstance (object , types .FunctionType )
273
278
274
279
def _has_code_flag (f , flag ):
@@ -333,17 +338,18 @@ def isgenerator(object):
333
338
"""Return true if the object is a generator.
334
339
335
340
Generator objects provide these attributes:
336
- __iter__ defined to support iteration over container
337
- close raises a new GeneratorExit exception inside the
338
- generator to terminate the iteration
339
341
gi_code code object
340
342
gi_frame frame object or possibly None once the generator has
341
343
been exhausted
342
344
gi_running set to 1 when generator is executing, 0 otherwise
343
- next return the next item from the container
344
- send resumes the generator and "sends" a value that becomes
345
+ gi_yieldfrom object being iterated by yield from or None
346
+
347
+ __iter__() defined to support iteration over container
348
+ close() raises a new GeneratorExit exception inside the
349
+ generator to terminate the iteration
350
+ send() resumes the generator and "sends" a value that becomes
345
351
the result of the current yield-expression
346
- throw used to raise an exception inside the generator"""
352
+ throw() used to raise an exception inside the generator"""
347
353
return isinstance (object , types .GeneratorType )
348
354
349
355
def iscoroutine (object ):
@@ -378,7 +384,11 @@ def isframe(object):
378
384
f_lasti index of last attempted instruction in bytecode
379
385
f_lineno current line number in Python source code
380
386
f_locals local namespace seen by this frame
381
- f_trace tracing function for this frame, or None"""
387
+ f_trace tracing function for this frame, or None
388
+ f_trace_lines is a tracing event triggered for each source line?
389
+ f_trace_opcodes are per-opcode events being requested?
390
+
391
+ clear() used to clear all references to local variables"""
382
392
return isinstance (object , types .FrameType )
383
393
384
394
def iscode (object ):
@@ -403,7 +413,12 @@ def iscode(object):
403
413
co_names tuple of names other than arguments and function locals
404
414
co_nlocals number of local variables
405
415
co_stacksize virtual machine stack space required
406
- co_varnames tuple of names of arguments and local variables"""
416
+ co_varnames tuple of names of arguments and local variables
417
+ co_qualname fully qualified function name
418
+
419
+ co_lines() returns an iterator that yields successive bytecode ranges
420
+ co_positions() returns an iterator of source code positions for each bytecode instruction
421
+ replace() returns a copy of the code object with a new values"""
407
422
return isinstance (object , types .CodeType )
408
423
409
424
def isbuiltin (object ):
0 commit comments