博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python3 AttributeError: 'function' object has no attribute 'func_name'
阅读量:4299 次
发布时间:2019-05-27

本文共 508 字,大约阅读时间需要 1 分钟。

AttributeError: 'function' object has no attribute 'func_name'

python2升级到python3报的错,

python3.0的函数没有func_name属性了,改成了__name__.

详见 官方文档:

  • The function attributes named func_X have been renamed to use the __X__ form, freeing up these names in the function attribute namespace for user-defined attributes. To wit, func_closurefunc_codefunc_defaultsfunc_dictfunc_docfunc_globalsfunc_name were renamed to __closure____code____defaults__, , __doc____globals__, , respectively.

  • __nonzero__() is now .

转载地址:http://nkxws.baihongyu.com/

你可能感兴趣的文章
apache+nginx 实现动静分离
查看>>
通过Navicat远程连接MySQL配置
查看>>
phpstorm开发工具的设置用法
查看>>
Linux 系统挂载数据盘
查看>>
Git基础(三)--常见错误及解决方案
查看>>
Git(四) - 分支管理
查看>>
PHP Curl发送数据
查看>>
HTTP协议
查看>>
HTTPS
查看>>
git add . git add -u git add -A区别
查看>>
apache下虚拟域名配置
查看>>
session和cookie区别与联系
查看>>
PHP 实现笛卡尔积
查看>>
Laravel中的$loop
查看>>
CentOS7 重置root密码
查看>>
Centos安装Python3
查看>>
PHP批量插入
查看>>
laravel连接sql server 2008
查看>>
Laravel 操作redis的各种数据类型
查看>>
Laravel框架学习笔记之任务调度(定时任务)
查看>>