The Best New
Features of Python 3.8
The Python 3.8 is the latest version and it used
for scripting and automation to machine learning and web development.
Let’s explains one-by-one the Python 3.8 new features -
=> Assignment expressions
if (n := len(a)) > 10:
print(f"List is too long ({n}
elements, expected <= 10)")
=> Positional-only parameters
def pow(x, y, z=None, /):
r = x**y
if z is not None:
r %= z
return r
=> Parallel filesystem cache for compiled bytecode files
=> Debug build uses the same ABI as release build
=> A fast calling protocol for CPython
=> The subprocess.Popen() can now use os.posix_spawn()
in some cases for better performance
=> The statistics.mode() function no longer raises an
exception when given multimodal data
=> f-strings now support = for quick and easy debugging
x = 3
print(f'{x*9 + 15=}')
=> Improved Modules - ast, asyncio, builtins,
collections, ctypes, functools, datetime, gettext, inspect, idlelib and IDLE,
and json.tool
=> Python Initialization providing finer control on the
whole configuration and better error reporting.
=> Python New Structures:
PyConfig
PyPreConfig
PyStatus
PyWideStringList
=> Python New functions:
PyConfig_Clear()
PyConfig_InitIsolatedConfig()
PyConfig_InitPythonConfig()
PyConfig_Read()
PyConfig_SetArgv()
PyConfig_SetBytesArgv()
PyConfig_SetBytesString()
PyConfig_SetString()
PyPreConfig_InitIsolatedConfig()
PyPreConfig_InitPythonConfig()
PyStatus_Error()
PyStatus_Exception()
PyStatus_Exit()
PyStatus_IsError()
PyStatus_IsExit()
PyStatus_NoMemory()
PyStatus_Ok()
PyWideStringList_Append()
PyWideStringList_Insert()
Py_BytesMain()
Py_ExitStatusException()
Py_InitializeFromConfig()
Py_PreInitialize()
Py_PreInitializeFromArgs()
Py_PreInitializeFromBytesArgs()
Py_RunMain()
=> The Py_DEPRECATED() macro has been implemented for
MSVC. The macro now must be placed before the symbol name.
Example:
Py_DEPRECATED(3.8) PyAPI_FUNC(int) Py_OldFunction(void);
Explore in detail -
https://docs.python.org/3.8/whatsnew/3.8.html
https://docs.python.org/3.8/whatsnew/3.8.html
0 comments:
Post a Comment