|
| 1 | +# What's New In Python 3.6 |
| 2 | + |
| 3 | +https://docs.python.org/3/whatsnew/3.6.html |
| 4 | + |
| 5 | +New Features |
| 6 | +============ |
| 7 | +- [x] [PEP 498][]: Formatted string literals |
| 8 | +- [ ] [PEP 526][]: Syntax for variable annotations |
| 9 | +- [ ] [PEP 515][]: Underscores in Numeric Literals |
| 10 | +- [ ] [PEP 525][]: Asynchronous Generators |
| 11 | +- [ ] [PEP 530][]: Asynchronous Comprehensions |
| 12 | +- [ ] [PEP 487][]: Simpler customization of class creation |
| 13 | +- [ ] [PEP 487][]: Descriptor Protocol Enhancements |
| 14 | +- [ ] [PEP 519][]: Adding a file system path protocol |
| 15 | +- [ ] [PEP 495][]: Local Time Disambiguation |
| 16 | +- [ ] [PEP 529][]: Change Windows filesystem encoding to UTF-8 |
| 17 | +- [ ] [PEP 528][]: Change Windows console encoding to UTF-8 |
| 18 | +- [ ] [PEP 520][]: Preserving Class Attribute Definition Order |
| 19 | +- [ ] [PEP 468][]: Preserving Keyword Argument Order |
| 20 | +- [ ] [PEP 523][]: Adding a frame evaluation API to CPython |
| 21 | + |
| 22 | +Other Language Changes |
| 23 | +====================== |
| 24 | +- [ ] A `global` or `nonlocal` statement must now textually appear before the first use of the affected name in the same scope. Previously this was a `SyntaxWarning`. |
| 25 | +- [ ] It is now possible to set a special method to `None` to indicate that the corresponding operation is not available. For example, if a class sets `__iter__()` to `None`, the class is not iterable. |
| 26 | +- [ ] Long sequences of repeated traceback lines are now abbreviated as `"[Previous line repeated {count} more times]"` (see traceback for an example). |
| 27 | +- [ ] Import now raises the new exception `ModuleNotFoundError` (subclass of `ImportError`) when it cannot find a module. Code that currently checks for `ImportError` (in try-except) will still work. |
| 28 | +- [ ] Class methods relying on zero-argument `super()` will now work correctly when called from metaclass methods during class creation. |
| 29 | + |
| 30 | +New Modules |
| 31 | +=========== |
| 32 | +- [ ] `secrets` |
| 33 | + |
| 34 | +Improved Modules |
| 35 | +================ |
| 36 | +- [ ] `array` |
| 37 | +- [ ] `ast` |
| 38 | +- [ ] `asyncio` |
| 39 | +- [ ] `binascii` |
| 40 | +- [ ] `cmath` |
| 41 | +- [ ] `collections` |
| 42 | +- [ ] `concurrent.futures` |
| 43 | +- [ ] `contextlib` |
| 44 | +- [ ] `datetime` |
| 45 | +- [ ] `decimal` |
| 46 | +- [ ] `distutils` |
| 47 | +- [ ] `email` |
| 48 | +- [ ] `encodings` |
| 49 | +- [ ] `enum` |
| 50 | +- [ ] `faulthandler` |
| 51 | +- [ ] `fileinput` |
| 52 | +- [ ] `hashlib` |
| 53 | +- [ ] `http.client` |
| 54 | +- [ ] `idlelib and IDLE` |
| 55 | +- [ ] `importlib` |
| 56 | +- [ ] `inspect` |
| 57 | +- [ ] `json` |
| 58 | +- [ ] `logging` |
| 59 | +- [ ] `math` |
| 60 | +- [ ] `multiprocessing` |
| 61 | +- [ ] `operator` |
| 62 | +- [ ] `os` |
| 63 | +- [ ] `pathlib` |
| 64 | +- [ ] `pdb` |
| 65 | +- [ ] `pickle` |
| 66 | +- [ ] `pickletools` |
| 67 | +- [ ] `pydoc` |
| 68 | +- [ ] `random` |
| 69 | +- [ ] `re` |
| 70 | +- [ ] `readline` |
| 71 | +- [ ] `rlcompleter` |
| 72 | +- [ ] `shlex` |
| 73 | +- [ ] `site` |
| 74 | +- [ ] `sqlite3` |
| 75 | +- [ ] `socket` |
| 76 | +- [ ] `socketserver` |
| 77 | +- [ ] `ssl` |
| 78 | +- [ ] `statistics` |
| 79 | +- [ ] `struct` |
| 80 | +- [ ] `subprocess` |
| 81 | +- [ ] `sys` |
| 82 | +- [ ] `telnetlib` |
| 83 | +- [ ] `time` |
| 84 | +- [ ] `timeit` |
| 85 | +- [ ] `tkinter` |
| 86 | +- [ ] `traceback` |
| 87 | +- [ ] `tracemalloc` |
| 88 | +- [ ] `typing` |
| 89 | +- [ ] `unicodedata` |
| 90 | +- [ ] `unittest.mock` |
| 91 | +- [ ] `urllib.requests` |
| 92 | +- [ ] `urllib.robotparser` |
| 93 | +- [ ] `venv` |
| 94 | +- [ ] `warnings` |
| 95 | +- [ ] `winreg` |
| 96 | +- [ ] `winsound` |
| 97 | +- [ ] `xmlrpc.client` |
| 98 | +- [ ] `zipfile` |
| 99 | +- [ ] `zlib` |
| 100 | + |
| 101 | +Other Improvements |
| 102 | +================== |
| 103 | +- [x] When `--version` (short form: `-V`) is supplied twice, Python prints `sys.version` for detailed information. |
| 104 | + |
| 105 | +Deprecated |
| 106 | +========== |
| 107 | + |
| 108 | +New Keywords |
| 109 | +------------ |
| 110 | +- [ ]`async` and `await` are not recommended to be used as variable, class, function or module names. Introduced by PEP 492 in Python 3.5, they will become proper keywords in Python 3.7. Starting in Python 3.6, the use of `async` or `await` as names will generate a `DeprecationWarning`. |
| 111 | + |
| 112 | +Deprecated Python Behavior |
| 113 | +-------------------------- |
| 114 | +- [ ] Raising the `StopIteration` exception inside a generator will now generate a `DeprecationWarning` and will trigger a `RuntimeError` in Python 3.7. See PEP 479: Change StopIteration handling inside generators for details. |
| 115 | +- [ ] The `__aiter__()` method is now expected to return an asynchronous iterator directly instead of returning an awaitable as previously. Doing the former will trigger a `DeprecationWarning`. Backward compatibility will be removed in Python 3.7. |
| 116 | +- [ ] A backslash-character pair that is not a valid escape sequence now generates a `DeprecationWarning`. Although this will eventually become a `SyntaxError`, that will not be for several Python releases. |
| 117 | +- [ ] When performing a relative import, falling back on `__name__` and `__path__` from the calling module when `__spec__` or `__package__` are not defined now raises an `ImportWarning`. |
| 118 | + |
| 119 | +Deprecated Python modules, functions and methods |
| 120 | +------------------------------------------------ |
| 121 | +- [ ] The `asynchat` has been deprecated in favor of `asyncio`. |
| 122 | +- [ ] The `asyncore` has been deprecated in favor of `asyncio`. |
| 123 | +- [ ] Unlike other `dbm` implementations, the `dbm.dumb` module creates databases with the `'rw'` mode and allows modifying the database opened with the `'r'` mode. This behavior is now deprecated and will be removed in 3.8. |
| 124 | +- [ ] The undocumented `extra_path` argument to the `Distribution` constructor is now considered deprecated and will raise a warning if set. Support for this parameter will be removed in a future Python release. See bpo-27919 for details. |
| 125 | +- [ ] The support of non-integer arguments in `getgrgid()` has been deprecated. |
| 126 | +- [ ] The `importlib.machinery.SourceFileLoader.load_module()` and `importlib.machinery.SourcelessFileLoader.load_module()` methods are now deprecated. They were the only remaining implementations of `importlib.abc.Loader.load_module()` in `importlib` that had not been deprecated in previous versions of Python in favour of `importlib.abc.Loader.exec_module()`. |
| 127 | +- [ ] The `importlib.machinery.WindowsRegistryFinder` class is now deprecated. As of 3.6.0, it is still added to `sys.meta_path` by default (on Windows), but this may change in future releases. |
| 128 | +- [ ] Undocumented support of general bytes-like objects as paths in `os` functions, `compile()` and similar functions is now deprecated. |
| 129 | +- [ ] Support for inline flags `(?letters)` in the middle of the regular expression has been deprecated and will be removed in a future Python version. Flags at the start of a regular expression are still allowed. |
| 130 | +- [ ] OpenSSL 0.9.8, 1.0.0 and 1.0.1 are deprecated and no longer supported. In the future the `ssl` module will require at least OpenSSL 1.0.2 or 1.1.0.. |
| 131 | +- [ ] SSL-related arguments like `certfile`, `keyfile` and `check_hostname` in `ftplib`, `http.client`, `imaplib`, `poplib`, and `smtplib` have been deprecated in favor of `context`. |
| 132 | +- [ ] A couple of protocols and functions of the `ssl` module are now deprecated. Some features will no longer be available in future versions of OpenSSL. Other features are deprecated in favor of a different API. |
| 133 | +- [ ] The `tkinter.tix` module is now deprecated. `tkinter` users should use `tkinter.ttk` instead. |
| 134 | +- [ ] The `pyvenv` script has been deprecated in favour of `python3 -m venv`. This prevents confusion as to what Python interpreter `pyvenv` is connected to and thus what Python interpreter will be used by the virtual environment. |
| 135 | + |
| 136 | +Removed |
| 137 | +======= |
| 138 | +- [ ] Unknown escapes consisting of `'\'` and an ASCII letter in regular expressions will now cause an error. In replacement templates for `re.sub()` they are still allowed, but deprecated. The `re.LOCALE` flag can now only be used with binary patterns. |
| 139 | +- [ ] `inspect.getmoduleinfo()` was removed (was deprecated since CPython 3.3). `inspect.getmodulename()` should be used for obtaining the module name for a given path. |
| 140 | +- [ ] `traceback.Ignore` class and `traceback.usage`, `traceback.modname`, `traceback.fullmodname`, `traceback.find_lines_from_code`, `traceback.find_lines`, `traceback.find_strings`, `traceback.find_executable_lines` methods were removed from the `traceback` module. They were undocumented methods deprecated since Python 3.2 and equivalent functionality is available from private methods. |
| 141 | +- [ ] The `tk_menuBar()` and `tk_bindForTraversal()` dummy methods in `tkinter` widget classes were removed (corresponding Tk commands were obsolete since Tk 4.0). |
| 142 | +- [ ] The `open()` method of the `zipfile.ZipFile` class no longer supports the `'U'` mode (was deprecated since Python 3.4). Use `io.TextIOWrapper` for reading compressed text files in universal newlines mode. |
| 143 | +- [ ] The undocumented `IN`, `CDROM`, `DLFCN`, `TYPES`, `CDIO`, and `STROPTS` modules have been removed. They had been available in the platform specific `Lib/plat-*/` directories, but were chronically out of date, inconsistently available across platforms, and unmaintained. The script that created these modules is still available in the source distribution at Tools/scripts/h2py.py. |
| 144 | +- [ ] The deprecated `asynchat.fifo` class has been removed. |
| 145 | + |
| 146 | +[PEP 498]: https://www.python.org/dev/peps/pep-0498 |
| 147 | +[PEP 526]: https://www.python.org/dev/peps/pep-0526 |
| 148 | +[PEP 515]: https://www.python.org/dev/peps/pep-0515 |
| 149 | +[PEP 525]: https://www.python.org/dev/peps/pep-0525 |
| 150 | +[PEP 530]: https://www.python.org/dev/peps/pep-0530 |
| 151 | +[PEP 487]: https://www.python.org/dev/peps/pep-0487 |
| 152 | +[PEP 487]: https://www.python.org/dev/peps/pep-0487 |
| 153 | +[PEP 519]: https://www.python.org/dev/peps/pep-0519 |
| 154 | +[PEP 495]: https://www.python.org/dev/peps/pep-0495 |
| 155 | +[PEP 529]: https://www.python.org/dev/peps/pep-0529 |
| 156 | +[PEP 528]: https://www.python.org/dev/peps/pep-0528 |
| 157 | +[PEP 520]: https://www.python.org/dev/peps/pep-0520 |
| 158 | +[PEP 468]: https://www.python.org/dev/peps/pep-0468 |
| 159 | +[PEP 523]: https://www.python.org/dev/peps/pep-0523 |
0 commit comments