查看threading 有如下表达式
_start_new_thread = thread.start_new_thread
_allocate_lock = thread.allocate_lock
_get_ident = thread.get_ident
ThreadError = thread.error
del thread
 
为什么要del thread,删除这个变量的目的是为什么?脚本运行完后应该会自动将变量清除。这样显式清除有什么特殊目的?如果不显式del会有什么后果?
 
原来是目的是为了避免threading.thread的用法吧,为什么呢???因为有人喜欢dir(threading)然后看到了个thread而没看到Thread就直接拿来用了。

相关文章:

  • 2022-01-17
  • 2021-07-01
  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2021-04-18
  • 2022-02-16
猜你喜欢
  • 2021-06-05
  • 2021-12-02
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案