Pending Removal in Python 3.16¶
- 
- Bitwise inversion on boolean types, - ~Trueor- ~Falsehas been deprecated since Python 3.12, as it produces surprising and unintuitive results (- -2and- -1). Use- not xinstead for the logical negation of a Boolean. In the rare case that you need the bitwise inversion of the underlying integer, convert to- intexplicitly (- ~int(x)).
 
- 
- The - 'u'format code (- wchar_t) has been deprecated in documentation since Python 3.3 and at runtime since Python 3.13. Use the- 'w'format code (- Py_UCS4) for Unicode characters instead.
 
- 
- The - ExecErrorexception has been deprecated since Python 3.14. It has not been used by any function in- shutilsince Python 3.4, and is now an alias of- RuntimeError.
 
- 
- The - Class.get_methodsmethod has been deprecated since Python 3.14.
 
- sys:- The - _enablelegacywindowsfsencoding()function has been deprecated since Python 3.13. Use the- PYTHONLEGACYWINDOWSFSENCODINGenvironment variable instead.
 
- 
- The undocumented and unused - TarFile.tarfileattribute has been deprecated since Python 3.13.