python function类型是什么

您所在的位置:网站首页 python中的function类型 python function类型是什么

python function类型是什么

2024-07-08 14:58| 来源: 网络整理| 查看: 265

你应该能用

types.FunctionType

做你想做的:

Python 2.6.1 (r261:67515, Jul 7 2009, 23:51:51)

[GCC 4.2.1 (Apple Inc. build 5646)] on darwin

Type "help", "copyright", "credits" or "license" for more information.

>>> import types

>>> help(types.FunctionType)

Help on class function in module __builtin__:

class function(object)

| function(code, globals[, name[, argdefs[, closure]]])

|

| Create a function object from a code object and a dictionary.

| The optional name string overrides the name from the code object.

| The optional argdefs tuple specifies the default argument values.

| The optional closure tuple supplies the bindings for free variables.

但一般来说,

def

被视为

function

类型。



【本文地址】


今日新闻


推荐新闻


CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3