According to the development roadmap (PEP-478), Python 3.5 is scheduled for official release on 9/13 (probably US time). .. An additional release candidate (rc4) may have been [released] on 9/9 (https://www.python.org/downloads/release/python-350rc4/), which may be a bit late, but probably It will come out within a week. So, I made a Japanese summary of the changes in Python 3.5 + a comment. The original story is "Summary --Release Highlights" at the beginning of here.
To try Python3.5, download the latest release candidates from here. Or if you are using pyenv, you can easily install it with pyenv install
, but the latest version of pyenv v20150901 only supports up to rc2, so you have to put up with it or fetch pyenv from HEAD. If you are using homebrew, it looks like this.
brew uninstall pyenv #If already installed
brew install pyenv --HEAD
pyenv install 3.5.0rc4
As planned, 3.5.0 has been released. To be honest, I didn't expect to come so soon ..
pyenv was also updated immediately to 20150913, with 3.5.0 officially supported. It's already on Homebrew. Everyone works fast! So, if you want to try it, this is all right.
brew install pyenv #Or if you have installed it, brew upgrade
pyenv install 3.5.0
PEP-465 Proposed specification addition that allows matrix multiplication to be written in the form of ʻa @ b` .. The strange thing is that the standard library doesn't provide an implementation that uses it, just the spec. Instead, some external libraries, such as numpy, have announced support.
Added specifications for defining and using corroutines proposed in PEP-492. Until now, it was possible to create a corroutine using Generator, but in order to make it easier to understand, the keywords async and await were introduced and the specifications were expanded.
An extension of value expansion using *
and **
as proposed in PEP-448. It can be used multiple times as a function argument, such as print (* [1], * [2], 3)
, or it can be used in tuples, lists, and dictionaries, such as [* range (4), 4]
. Will be.
zipapp
Python has the ability to execute zipped python code. Moreover, since v2.6![PEP-441](https://www.python. The tool that was made in org / dev / peps / pep-0441 /) is zipapp. The Python code that has been zipped is called "Python Zip Application", and the functions for creating it are provided.
So far, I could do something like "% 04x "% 10
, but the result is str type. An extension that allows it to be a bytes type in the form of b"% 04x "% 10
.
You will be able to do things like b'\ xf0 \ x9f \ x90 \ x8d'.hex ()
.
It seems that tuples will be able to index to access the elements of a multidimensional array (matrix).
I didn't really understand the need for this ...
A type of RuntimeError that occurs when the maximum number of recursion is exceeded.
Exception raised at the end of a repeat with asynchronous Iterable created by async for.
When LC_TYPE is POSIX locale (C locale), sys.stdin and sys.stdout will now use the surrogate escape error handler instead of the strict error handler.
When I ran Python with the -O or -OO option, the optimized byte compilation results were stored in .pyo files instead of .pyc. From Python 3.5 we will deprecate it and store it in a .pyc file, with the optimization level in the filename (eg xxx.cpython-35.opt-1.pyc) (PEP-488)
Until now, built-in modules and extensions have been generated and initialized at once. As with other modules, this is changed to the form of generating all modules first and then executing the initialization code. (PEP-489)
collections.OrderedDict has been reimplemented in C, 4 to 100 times faster!
Bytes type can also be used with arguments that could only be passed with str type (prefix specification, etc.). You will also be able to specify None.
Added Memory BIO support. With this change, SSL protocol processing can be separated from the actual Socket I / O processing.
Added lighter TracebackException, StackSummary and FrameSummary classes
Functools.lru_cache was provided as a decorator to cache the results of function calls, but it has been reimplemented in C.
It can be made available using ssl.SSLContext, but it is completely removed from the standard library. This change has also been backported to v3.4 and v2.7. This would be a workaround for the SSLv3 vulnerability issue called POODLE Attack. ..
Strict cookie parsing to prevent injection attacks.
There are two types of installers: Web Installer, which downloads necessary files from a small installer at the time of installation, and Offline installer, which includes all standard components. There are 32bit version and 64bit version respectively.
Python 3.5 for Windows was built with MSVC ++ 14.0 and the extensions also need to be compiled with it.
In addition to the ones introduced above, What ’s New In Python 3.5 has various changes. If there is something that looks interesting or usable, I would love to pick it up.
Recommended Posts