MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / iscode

Function iscode

tools/python-3.11.9-amd64/Lib/inspect.py:480–503  ·  view source on GitHub ↗

Return true if the object is a code object. Code objects provide these attributes: co_argcount number of arguments (not including *, ** args or keyword only arguments) co_code string of raw compiled bytecode co_cellva

(object)

Source from the content-addressed store, hash-verified

478 return isinstance(object, types.FrameType)
479
480def iscode(object):
481 """Return true if the object is a code object.
482
483 Code objects provide these attributes:
484 co_argcount number of arguments (not including *, ** args
485 or keyword only arguments)
486 co_code string of raw compiled bytecode
487 co_cellvars tuple of names of cell variables
488 co_consts tuple of constants used in the bytecode
489 co_filename name of file in which this code object was created
490 co_firstlineno number of first line in Python source code
491 co_flags bitmap: 1=optimized | 2=newlocals | 4=*arg | 8=**arg
492 | 16=nested | 32=generator | 64=nofree | 128=coroutine
493 | 256=iterable_coroutine | 512=async_generator
494 co_freevars tuple of names of free variables
495 co_posonlyargcount number of positional only arguments
496 co_kwonlyargcount number of keyword only arguments (not including ** arg)
497 co_lnotab encoded mapping of line numbers to bytecode indices
498 co_name name with which this code object was defined
499 co_names tuple of names other than arguments and function locals
500 co_nlocals number of local variables
501 co_stacksize virtual machine stack space required
502 co_varnames tuple of names of arguments and local variables"""
503 return isinstance(object, types.CodeType)
504
505def isbuiltin(object):
506 """Return true if the object is a built-in function or method.

Callers 3

getfileFunction · 0.85
findsourceFunction · 0.85
getargsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected