• <i id='G258t'><tr id='G258t'><dt id='G258t'><q id='G258t'><span id='G258t'><b id='G258t'><form id='G258t'><ins id='G258t'></ins><ul id='G258t'></ul><sub id='G258t'></sub></form><legend id='G258t'></legend><bdo id='G258t'><pre id='G258t'><center id='G258t'></center></pre></bdo></b><th id='G258t'></th></span></q></dt></tr></i><div id='G258t'><tfoot id='G258t'></tfoot><dl id='G258t'><fieldset id='G258t'></fieldset></dl></div>

        <bdo id='G258t'></bdo><ul id='G258t'></ul>
      <legend id='G258t'><style id='G258t'><dir id='G258t'><q id='G258t'></q></dir></style></legend>
    1. <small id='G258t'></small><noframes id='G258t'>

      <tfoot id='G258t'></tfoot>

        如何在python中深度复制队列

        时间:2023-08-31
      1. <i id='D0kzr'><tr id='D0kzr'><dt id='D0kzr'><q id='D0kzr'><span id='D0kzr'><b id='D0kzr'><form id='D0kzr'><ins id='D0kzr'></ins><ul id='D0kzr'></ul><sub id='D0kzr'></sub></form><legend id='D0kzr'></legend><bdo id='D0kzr'><pre id='D0kzr'><center id='D0kzr'></center></pre></bdo></b><th id='D0kzr'></th></span></q></dt></tr></i><div id='D0kzr'><tfoot id='D0kzr'></tfoot><dl id='D0kzr'><fieldset id='D0kzr'></fieldset></dl></div>

          <tbody id='D0kzr'></tbody>

        <small id='D0kzr'></small><noframes id='D0kzr'>

          • <legend id='D0kzr'><style id='D0kzr'><dir id='D0kzr'><q id='D0kzr'></q></dir></style></legend>
          • <tfoot id='D0kzr'></tfoot>

              <bdo id='D0kzr'></bdo><ul id='D0kzr'></ul>

                  本文介绍了如何在python中深度复制队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  如何在 python 中深度复制队列?谢谢

                  Hi How to deepcopy a Queue in python? Thanks

                  推荐答案

                  queue 模块 用于同步线程之间的共享数据.它不是打算用作数据结构,并且不支持复制(甚至不支持浅复制).

                  The queue module in Python is used for synchronizing shared data between threads. It is not intended as a data structure and it doesn't support copying (not even shallow copy).

                  (.get.put可以对一个Queue进行多次deepcopy,但是原来的Queue会被销毁.)

                  (It is possible to construct many deepcopy's of a Queue by .get and .put, but the original Queue will be destroyed.)

                  如果您想将队列(或堆栈)作为数据结构,使用 collections.deque.如果您想要优先级队列,请使用 heapq 模块.deque 支持 deepcopy.heapq 由列表支持,因此也支持 deepcopy.

                  If you want to have a queue (or stack) as a data structure, use a collections.deque. If you want a priority queue, use the heapq module. The deque supports deepcopy. heapq is backed by a list, so deepcopy is also supported.

                  这篇关于如何在python中深度复制队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                    <bdo id='vN1jV'></bdo><ul id='vN1jV'></ul>
                      <tbody id='vN1jV'></tbody>

                    <small id='vN1jV'></small><noframes id='vN1jV'>

                        <tfoot id='vN1jV'></tfoot>
                      • <i id='vN1jV'><tr id='vN1jV'><dt id='vN1jV'><q id='vN1jV'><span id='vN1jV'><b id='vN1jV'><form id='vN1jV'><ins id='vN1jV'></ins><ul id='vN1jV'></ul><sub id='vN1jV'></sub></form><legend id='vN1jV'></legend><bdo id='vN1jV'><pre id='vN1jV'><center id='vN1jV'></center></pre></bdo></b><th id='vN1jV'></th></span></q></dt></tr></i><div id='vN1jV'><tfoot id='vN1jV'></tfoot><dl id='vN1jV'><fieldset id='vN1jV'></fieldset></dl></div>
                          <legend id='vN1jV'><style id='vN1jV'><dir id='vN1jV'><q id='vN1jV'></q></dir></style></legend>