【python】| python3.6新特性整理
2018-03-01 11:10
453 查看
1. 字典key值排序
PEP 468: Preserving keyword argument ordeIn [1]: def pep468(**kwargs): ...: print(list(kwargs.keys())) ...: In [2]: pep468(a=1, b=2, c=3) ['a', 'b', 'c']
2. 创建/定制类更简单
- PEP 487: Simpler customization of class creationIn [1]: class PEP487(object): ...: def __init_subclass__(cls, whom, **kwargs): ...: super().__init_subclass__(**kwargs) ...: cls.hello = lambda: print(f"hello, {whom}") ...: In [2]: class HelloWorld(PEP487, whom="World"): ...: pass ...: In [3]: HelloWorld.hello() hello, World
相关文章推荐
- Python 3.6部分新特性
- Atitit python3.0 3.3 3.5 3.6 新特性 Python2.7新特性1Python 3_x 新特性1python3.4新特性1python3.5新特性1值得关注的新特性1Pyth
- Python3.6正式版新特性预览
- python中常用__future__特性整理
- Python3.6新特性官方文档中文版
- Python3.6新特性
- Atitit python3.0 3.3 3.5 3.6 新特性 Python2.7新特性1Python 3_x 新特性1python3.4新特性1python3.5新特性1值得关注的新特性1Pyth
- Python3.6新特性
- Atitit python3.0 3.3 3.5 3.6 新特性 Python2.7新特性1Python 3_x 新特性1python3.4新特性1python3.5新特性1值得关注的新特性1Python3.6新特性2 Python2.7新特性Python 2.7的新特性 - 牛皮糖NewPtone - 博客园.html Python 3_x 新特性及10大变化_python_脚本之家.htm
- 【Pig】Python3.6/Django1.9.13/Bootstrap/AmazeUI/Echarts后台Web开发阶段记录
- python3.6 hrttp403无权限访问错误
- python 3.6中 wxPython 的下载和安装
- Python3.6 安装Tensorflow初体验
- ubuntu下python3.6安装Twisted失败解决
- 修复CentOS7升级Python到3.6版本后yum不能正确使用的解决方法
- 整理在ubuntu重装之后配置过程(6G内存,修改网卡物理地址,修改hosts,codeblocks,eclipse,jdk,配置eclipse编译python)
- Python中常见的报错整理
- TensorFlow 1.2.0新版本完美支持Python3.6,windows在cmd中输入pip install tensorflow就能下载应用最新tensorflow
- VS2017+python3.6+Tensorflow环境搭建
- 用python快速整理你的素材库