On 4 November 2016 at 04:44, Justin W. Flory <jflo...@gmail.com> wrote:
> Whoops, missed this reply! Even if the specific minor version of 3.6 is to
> be determined, if there's new major features to highlight in Python 3.6, we
> could get started with writing the article draft and write how to get
> started using it. Once it's actually available, we can double-check for
> accuracy and push it out quickly after it's available. :)
>
> Would there be anyone who might be interested in helping lead on this? It
> shouldn't have to be too extravagant, but a short overview and introduction
> about the latest and greatest in Python on Fedora would be amazing.

Some initial highlights from
https://docs.python.org/dev/whatsnew/3.6.html for folks that can just
roll forward to the new release:

- compile time processing of format strings with the new f-string
literals: print(f"There were {len(docs)} found. First title:
{docs[0].title}". These have the dual benefit of being both faster
than runtime formatting (since the string gets broken up into text
segments and field expressions at compile time, so there's zero
runtime string parsing overhead), while also being easier to read
(since you don't need to mentally map expressions to their
corresponding fields - they're right there in the string). Especially
helpful for scripting use cases.
- keyword arguments now preserve their order, so
"collections.OrderedDict(first=1, second=2, third=2)" finally works
the way you would expect it to work (previously the apparent key order
in the source code would be lost in the process of calling the
constructor)
- the new secrets module provides handy helpers for secure token
generation in various formats (e.g. bytes, hex strings, base64
strings) with a reasonable default amount of entropy
- underscores in numeric literals mean you can now break up magic
constants to make them easier to read (e.g. 10_000_000.0, 0xCAFE_F00D,
0b_0011_1111_0100_1110)
- many more standard library APIs, including the builtin open(), now
support pathlib.Path and pathlib.PurePath objects through the new
os.fspath() protocol. This change also means many third party
libraries will also indirectly gain support for these protocols (since
they implicitly delegate the task of opening a path to a standard
library API
- OpenSSL 1.1.0 is supported, along with additional hashing (BLAKE2,
SHA-3, SHAKE) and key derivation (scrypt) algorithms

From a security perspective, os.urandom() now also provides a
guarantee that it will either block or return a result suitable for
cryptographic use - this means that code that needs to run when the
system entropy pool hasn't been initialised yet should either switch
to using the random module (if it doesn't need cryptographic grade
randomness) or the new os.getrandom() API (in order to use the
non-blocking variant of the syscall).

For folks using the new native async/await syntax for coroutine based
service development, that syntax has been extended with provisional
support for asynchronous comprehensions, generator definitions, and
generation functions, allowing asynchronous code access to many more
of the niceties developers are accustomed to when working with purely
synchronous code.

For folks using mypy or one of the other type inference engines for
Python, provisional support has been added for declarative variable
annotations that allow inference engines to complain when values bound
to the variable don't abide by the expected constraint (the
interpreter itself pays no attention to these annotations at runtime,
just as it doesn't check function annotations)

For folks writing internationalised applications, the Unicode database
has been updated to 9.0.0

For folks debugging more complex applications, the new PYTHONMALLOC
environment variable lets you either switch the runtime's memory
allocator into debug mode ("PYTHONMALLOC=debug") or bypass it entirely
("PYTHONMALLOC=malloc"). Details in
https://docs.python.org/dev/whatsnew/3.6.html#pythonmalloc-environment-variable

Also related to application debugging, the "-X tracemalloc" option now
provides a resource allocation traceback when printing ResourceWarning
for resources that are cleaned up non-deterministically.

There have also been a range of performance improvement made to
CPython, aided significantly by Victor Stinner's work in putting
together a new benchmarking utility ("perf") and a new benchmark suite
for Python interpreters ("performance":
https://pypi.python.org/pypi/performance ). (He doesn't have 3.5 vs
3.6 performance data yet, but hopefully that will be available on
speed.python.org by the time of the actual 3.6 release in December)

Cheers,
Nick.

-- 
Nick Coghlan   |   ncogh...@gmail.com   |   Brisbane, Australia
_______________________________________________
python-devel mailing list -- python-devel@lists.fedoraproject.org
To unsubscribe send an email to python-devel-le...@lists.fedoraproject.org

Reply via email to