On this page
  1. types.FunctionType
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from types import FunctionType
help(FunctionType)

Linked from

Related notes