On this page
types.FunctionType
Prev: types.FrameType | Up: types | Next: types.GeneratorType
Rel: types.AsyncGeneratorType, types.BuiltinFunctionType, types.BuiltinMethodType, types.CapsuleType
Ref: docs.python.org — types.FunctionType
Tags: #public #python3 #stdlib #types
Import
import types
from types import FunctionType
Signature & Overview
types.FunctionType(code, globals, name=None, argdefs=None, closure=None, kwdefaults=None)
Create a function object.
Usage
import types
def f(): pass
assert isinstance(f, types.FunctionType)
Gotchas
- Matches Python
deffunctions andlambdas (not C built-ins likelen).
REPL Inspect
from types import FunctionType
help(FunctionType)
Linked from
Related notes
- tuts/python3/stdlib_module/types/FrameType Linked here; links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/GeneratorType Linked here; links to this page; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/types/AsyncGeneratorType Linked here; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/BuiltinFunctionType Linked here; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/BuiltinMethodType Linked here; shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/CapsuleType Linked here; shared tags: #stdlib, #types
- tuts/c/stdlib/stdint_stdbool_and_limits shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/CellType shared tags: #stdlib, #types
- tuts/python3/stdlib_module/types/ClassMethodDescriptorType shared tags: #stdlib, #types