Why was the 'thread' module renamed to '_thread' in Python 3.x?

有些话、适合烂在心里 提交于 2021-02-07 12:08:49

问题


Python 3.x renamed the low-level module 'thread' to '_thread' -- I don't see why in the documentation. Does anyone know?


回答1:


It looks like the thread module became obsolete in 3.x in favor of the threading module. See PEP 3108.




回答2:


It's been quite a long time since the low-level thread module was informally deprecated, with all users heartily encouraged to use the higher-level threading module instead; now with the ability to introduce backwards incompatibilities in Python 3, we've made that deprecation rather more than just "informal", that's all!-)




回答3:


I think the old thread module is deprecated in favour of the higher level threading module.



来源:https://stackoverflow.com/questions/1141047/why-was-the-thread-module-renamed-to-thread-in-python-3-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!