Python 3.6 beta 1 was released on 12 Sep 2016, and a summary of the new features can be found here: https://docs.python.org/3.6/whatsnew/3.6.html . Being in beta stage means we can provide feedback on any of the new features/changes if we like.
(See #1329 for Python 3.5 support, which is still pending.)
New syntax features:
New built-in features:
Standard library changes:
- PEP 495 - Local Time Disambiguation
- PEP 506 - Adding A Secrets Module To The Standard Library [not relevant to uPy core]
- PEP 519 - Adding a file system path protocol
CPython internals (not exposed at the Python level so not relevant to uPy):
- PEP 509 - Add a private version to dict
- PEP 523 - Adding a frame evaluation API to CPython
Linux/Windows changes:
Other Language Changes
Changes to MicroPython built-in modules
- cmath
- collections
- hashlib
- json -
json.load() and json.loads() now support binary input. Encoded JSON should be represented using either UTF-8, UTF-16, or UTF-32.
- math - The tau (τ) constant has been added to the
math and cmath modules.
- os
- See the summary of PEP 519 for details on how the
os and os.path modules now support path-like objects.
- re
- socket
- ssl
(Changes to non-built-in modules will need to be documented elsewhere.)
Python 3.6 beta 1 was released on 12 Sep 2016, and a summary of the new features can be found here: https://docs.python.org/3.6/whatsnew/3.6.html . Being in beta stage means we can provide feedback on any of the new features/changes if we like.
(See #1329 for Python 3.5 support, which is still pending.)
New syntax features:
New built-in features:
Standard library changes:
CPython internals (not exposed at the Python level so not relevant to uPy):
Linux/Windows changes:
Other Language Changes
globalornonlocalstatement must now textually appear before the first use of the affected name in the same scope. Previously this was a SyntaxWarning.Noneto indicate that the corresponding operation is not available. For example, if a class sets__iter__()toNone, the class is not iterable."[Previous line repeated {count} more times]"ModuleNotFoundErrorwhen it cannot find a module. Code that currently checks for ImportError (in try-except) will still work.super()will now work correctly when called from metaclass methods during class creation.Changes to MicroPython built-in modules
array.arraywill now stay exhausted even if the iterated array is extended.b2a_base64()function now accepts an optional newline keyword argument to control whether the newline character is appended to the return value.cmath.tau(τ) constant has been added.cmath.infandcmath.nanto matchmath.infandmath.nan, and alsocmath.infjandcmath.nanjto match the format used by complex repr.Collectionabstract base class has been added to represent sized iterable container classes.Reversibleabstract base class represents iterable classes that also provide the__reversed__()method.AsyncGeneratorabstract base class represents asynchronous generatorsnamedtuple()function now accepts an optional keyword argument module, which, when specified, is used for the__module__attribute of the returned named tuple class.namedtuple()are now keyword-only.collections.dequeinstances can now be pickled.hashlibsupports OpenSSL 1.1.0. The minimum recommend version is 1.0.2.blake2b()andblake2s()are always available and support the full feature set of BLAKE2.sha3_224(),sha3_256(),sha3_384(),sha3_512(), and SHAKE hash functionsshake_128()andshake_256()were added.scrypt()is now available with OpenSSL 1.1.0 and newer.json.load()andjson.loads()now support binary input. Encoded JSON should be represented using either UTF-8, UTF-16, or UTF-32.mathandcmathmodules.osandos.pathmodules now support path-like objects.close()method allows explicitly closing ascandir()iterator. Thescandir()iterator now supports the context manager protocol.os.urandom()now blocks until the system urandom entropy pool is initialized to increase the security.getrandom()syscall (get random bytes) is now exposed as the newos.getrandom()function.'(?i:p)ython'matches'python'and'Python', but not'PYTHON';'(?i)g(?-i:v)r'matches'GvR'and'gvr', but not'GVR'.__getitem__, which is equivalent togroup(). Somo['name']is now equivalent tomo.group('name').ioctl()function now supports theSIO_LOOPBACK_FAST_PATHcontrol code.getsockopt()constantsSO_DOMAIN,SO_PROTOCOL,SO_PEERSEC, andSO_PASSSECare now supported.setsockopt()now supports thesetsockopt(level, optname, None, optlen: int)form.AF_ALGto interface with Linux Kernel crypto API.ALG_*,SOL_ALGandsendmsg_afalg()were added.TCP_USER_TIMEOUTandTCP_CONGESTIONwere added.sslsupports OpenSSL 1.1.0. The minimum recommend version is 1.0.2.SSLContexthas better default configuration for options and ciphers.SSLSessionclass. TLS session resumption can speed up the initial handshake, reduce latency and improve performance.get_ciphers()method can be used to get a list of enabled ciphers in order of cipher priority.IntEnumandIntFlags.SSLContextwere added.SSLContext.post_handshake_authto enable andssl.SSLSocket.verify_client_post_handshake()to initiate TLS 1.3 post-handshake authentication.'e'format specifier.getfilesystemencodeerrors()function returns the name of the error mode used to convert between Unicode filenames and bytes filenames.compress()anddecompress()functions now accept keyword arguments.(Changes to non-built-in modules will need to be documented elsewhere.)