![]() įor those 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 ). The interpreter itself pays no attention to these annotations at runtime, just as it doesn’t check function annotations.įor developers writing internationalized applications, the Unicode database has been updated to 9.0.0. This allows asynchronous code access to many more of the niceties developers are accustomed to when working with purely synchronous code.įor developers 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 new os.getrandom() API, to use the non-blocking variant of the syscall.įor 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.the random module, if it doesn’t need cryptographic grade randomness, or.This means code that needs to run when the system entropy pool hasn’t been initialized yet should switch to use either: Other notable changesįrom a security perspective, os.urandom() now also provides a guarantee to either block or return a result suitable for cryptographic use. OpenSSL 1.1.0 is supported, along with additional hashing (BLAKE2, SHA-3, SHAKE) and key derivation (scrypt) algorithms. This change also means many third party libraries also indirectly gain support for these protocols, since they implicitly delegate the task of opening a path to a standard library API. M any more standard library APIs, including the builtin open(), now support pathlib.Path and pathlib.PurePath objects through the new os.fspath() protocol. U nderscores in numeric literals let you break up magic constants to make them easier to read. bytes, hex strings, base64 strings) with a reasonable default amount of entropy. T he new secrets module provides handy helpers for secure token generation in various formats (e.g. Previously the apparent key order in the source code would be lost in the process of calling the constructor. So collections.OrderedDict(first=1, second=2, third=2) finally works the way you would expect it to work. K eyword arguments now preserve their order. ![]() The literals are especially helpful for scripting use cases. They are also easier to read, since you don’t need to mentally map expressions to their corresponding fields. This results in zero runtime string parsing overhead. The new literals are faster than runtime formatting, since the string gets broken up into text segments and field expressions at compile time. Python 3.6 offers compile time processing of format strings with the new f-string literals: print(f"There were. M ajor changes Formatted string literals (f-strings) For a full list of new features check out the upstream docs. This article gives a quick overview of what to expect. Python 3.6 comes with many new enhancements and optimizations. Type "help", "copyright", "credits" or "license" for more information. You can then invoke the new version’s shell with the command python36 or python3.6. ![]() For those who want to experience the new Python features in Fedora 25 or Fedora 24, a python36 package is now available. Users running Fedora R awhide already e njoy Python 3.6. The upcoming Fedora 26 release will include Python 3.6.0. On December 23, 2016, the Python community released Python 3.6.0, the latest version of the popular programming language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |