Remoção pendente no Python 3.16¶
O sistema de importação:
A definição de
__loader__
em um módulo enquanto falha na definição de__spec__.loader
está descontinuado. No Python 3.16,__loader__
deixará de ser definido ou levado em consideração pelo sistema de importação ou pela biblioteca padrão.
-
O código de formato
'u'
(wchar_t
) foi descontinuado na documentação desde o Python 3.3 e em tempo de execução desde o Python 3.13. Use o código de formato'w'
(Py_UCS4
) para caracteres Unicode.
-
asyncio.iscoroutinefunction()
is deprecated and will be removed in Python 3.16; useinspect.iscoroutinefunction()
instead. (Contributed by Jiahao Li and Kumar Aditya in gh-122875.)asyncio
policy system is deprecated and will be removed in Python 3.16. In particular, the following classes and functions are deprecated:Users should use
asyncio.run()
orasyncio.Runner
with loop_factory to use the desired event loop implementation.For example, to use
asyncio.SelectorEventLoop
on Windows:import asyncio async def main(): ... asyncio.run(main(), loop_factory=asyncio.SelectorEventLoop)
(Contributed by Kumar Aditya in gh-127949.)
-
A inversão bit a bit em tipos booleanos,
~True
ou~False
foi descontinuada desde o Python 3.12, pois produz resultados surpreendentes e não intuitivos (-2
e-1
). Usenot x
em vez disso para a negação lógica de um Booleano. No caso raro de você precisar da inversão bit a bit do inteiro subjacente, converta paraint
explicitamente (~int(x)
).
-
Calling the Python implementation of
functools.reduce()
with function or sequence as keyword arguments has been deprecated since Python 3.14.
-
A exceção
ExecError
foi descontinuada desde o Python 3.14. Ela não foi usada por nenhuma função emshutil
desde o Python 3.4, e agora é um alias deRuntimeError
.
-
O método
Class.get_methods
foi descontinuado desde o Python 3.14.
sys
:A função
_enablelegacywindowsfsencoding()
foi descontinuada desde o Python 3.13. Use a variável de ambientePYTHONLEGACYWINDOWSFSENCODING
.
-
The
sysconfig.expand_makefile_vars()
function has been deprecated since Python 3.14. Use thevars
argument ofsysconfig.get_paths()
instead.
-
O atributo não documentado e não utilizado
TarFile.tarfile
foi descontinuado desde o Python 3.13.