Python 3.5 正式释出

2015-09-13 23:34:31 +08:00
 Shared

又多了很多黑科技,比如之前讨论过的 PEP 0441

又比如 PEP 0448,扩展了 *** 语法,以后可以这么玩儿了:

ranges = [range (i ) for i in range (5 )]
[*item for item in ranges]
[0, 0, 1, 0, 1, 2, 0, 1, 2, 3]`

还可以这么玩儿:

f (*x for x in it ) == f ((*x for x in it ))

f (**x for x in it ) == f ({**x for x in it})

再比如 PEP 0492,万众期待的 asyncawait 语法来啦!

总之,赶快升级就是了 😄

下载地址:Python 3.5

7374 次点击
所在节点    Python
45 条回复
Shared
2015-09-14 00:17:35 +08:00
看了下讨论 http://bugs.python.org/issue24400 coroutine 和 generator 现在分成两种不同的 type 了
PythonAnswer
2015-09-14 00:51:50 +08:00
学的 go 玩的就是潮流。 coroutine 变一等公民了。

3.5 估计是和 2.5 一样意义重大的版本,很多顽固 2 货要慢慢接受 3 货咯。
yech1990
2015-09-14 00:54:14 +08:00
不是几个月前的事么?
感觉几个月前官网就贴公告了
Shared
2015-09-14 01:01:55 +08:00
@PythonAnswer

"We believe that the changes proposed here will help keep Python relevant and competitive in a quickly growing area of asynchronous programming, as many other languages have adopted, or are planning to adopt, similar features: [2] , [5] , [6] , [7] , [8] , [10] ."

主要学习对象是 Scala, ES6, C# ……等 XD

=================

@yech1990

Release Date: 2015-09-13
chengzhoukun
2015-09-14 01:27:25 +08:00
https://www.python.org/dev/peps/pep-0484/
类型提示也比较有意思
Shared
2015-09-14 01:32:23 +08:00
@chengzhoukun 这个已经提了蛮久了,不过只是给静态分析用的,议案里已经给定性啦:

"Python will remain a dynamically typed language, and the authors have no desire to ever make type hints mandatory, even by convention."
yech1990
2015-09-14 02:09:39 +08:00
Created: 29-Jun-2013
patrickstar
2015-09-14 06:42:30 +08:00
我用的很多的程序包还是 2.x 的,我还得必须安装 python2 的虚拟环境
knightdf
2015-09-14 08:52:06 +08:00
有卵用?身边就没用 3 的,更何况公司
Shared
2015-09-14 09:24:45 +08:00
@patrickstar 现在 Python 3 可以反向兼容的,不妨试试

@knightdf 你开心就好
chuan
2015-09-14 09:28:30 +08:00
还有矩阵乘运算符 @啊
Kilerd
2015-09-14 09:43:50 +08:00
还在用 2.7 , 3.X 跟我没关系
haogefeifei
2015-09-14 09:59:03 +08:00
依然默默用 2 、、、、
Shared
2015-09-14 10:06:57 +08:00
@Kilerd @haogefeifei 开心就好
honkew
2015-09-14 10:08:54 +08:00
正在学 python 求推荐快速上手 文档或者视频
chengzhoukun
2015-09-14 10:09:42 +08:00
Shared
2015-09-14 10:11:30 +08:00
@honkew Dive Into Python 3 —— 私认为最好的入门书
Lcys
2015-09-14 10:51:51 +08:00
用 2.7 ..
jjx
2015-09-14 10:55:04 +08:00
看来将来项目要同时兼容 pypy/python 2.7/python3.5 了
hantsy
2015-09-14 10:57:45 +08:00
很多项目依赖 2.7

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/220457

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX