赵走x博客
网站访问量:151582
首页
书籍
软件
工具
古诗词
搜索
登录
24、nonlocal
23、Python functools.wraps 深入理解
21、Image.rotate旋转90度图片被截取了
20、python的__get__方法看这一篇就足够了
19、结巴分词(自然语言处理之中文分词器)
18、virtualenv
17、Python string 去掉标点符号 最佳实践
16、python 字符串相似度
15、StringIO和BytesIO
14、基于Python __dict__与dir()的区别详解
13、 set()去重的底层原理
12、顺序表的原理与python中的list类型
11、psutil实现系统监控
10、NSQ
9、utf-8的中文是一个汉字占三个字节长度吗?
8、supervisor+gunicorn部署python web项目
7、socket编程
6、async
5、Python的共享经济
4、Python 内存分配时的小秘密
3、Python中的“特权种族”是什么?
2、装饰器
1、序列化与反序列化
24、nonlocal
资源编号:76672
Python 查缺补漏
Python
热度:108
# nonlocal nonlocal声明的变量不是局部变量,也不是全局变量,而是外部嵌套函数内的变量。 ``` def nonlocal_test(): count = 0 def test2(): nonlocal count count += 1 return count return test2 val = nonlocal_test() print(val()) print(val()) print(val()) ``` 以上输出为:1,2,3