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)
| 478 | return isinstance(object, types.FrameType) |
| 479 | |
| 480 | def 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 | |
| 505 | def isbuiltin(object): |
| 506 | """Return true if the object is a built-in function or method. |
no outgoing calls
no test coverage detected