1 PEP8风格
2、易读性:用辅助函数替代复制语句
3、切割:a[:5] a[5:]
4、反向输出
5、列表推导:[x * 2 for x in aa]
[x * 2 for x in aa if x>2 ]
map/filter
6 三级列表
7、大数据量用生成器来替代列表推导:
8、用enumerate代替range
9、zip可以平行遍历多个迭代器
10、抛出异常代替返回none
11、用迭代器yield生成list
12、使用args,keyargs
13、无法设定动态参数,需要用None来替换
14、OOP
15、@classmethod 类方法
16、super().init
17、__xx 私有属性
18、容器的继承,建议使用collections.abc
19、属性:@property
20、@staticmethod静态方法
21、weakkeydictionary??? set get ????
22 getattr setattr hasattr getattribute
23| 元类new会获得元类数据
做数据验证的元类
24 subprocess.Popen()
25 线程来执行阻塞式IO
26 协程!
27 concurrent.futures 平行计算,提高性能
28 copyreg???
29 datetime replace time