久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <tfoot id='y6b4O'></tfoot>

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

      1. <legend id='y6b4O'><style id='y6b4O'><dir id='y6b4O'><q id='y6b4O'></q></dir></style></legend>
          <bdo id='y6b4O'></bdo><ul id='y6b4O'></ul>
      2. <i id='y6b4O'><tr id='y6b4O'><dt id='y6b4O'><q id='y6b4O'><span id='y6b4O'><b id='y6b4O'><form id='y6b4O'><ins id='y6b4O'></ins><ul id='y6b4O'></ul><sub id='y6b4O'></sub></form><legend id='y6b4O'></legend><bdo id='y6b4O'><pre id='y6b4O'><center id='y6b4O'></center></pre></bdo></b><th id='y6b4O'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='y6b4O'><tfoot id='y6b4O'></tfoot><dl id='y6b4O'><fieldset id='y6b4O'></fieldset></dl></div>

        何時或為什么在 Python 中使用相對導入

        When or why to use relative imports in Python(何時或為什么在 Python 中使用相對導入)

            <tbody id='yp60L'></tbody>

          1. <legend id='yp60L'><style id='yp60L'><dir id='yp60L'><q id='yp60L'></q></dir></style></legend>
              <bdo id='yp60L'></bdo><ul id='yp60L'></ul>
              <i id='yp60L'><tr id='yp60L'><dt id='yp60L'><q id='yp60L'><span id='yp60L'><b id='yp60L'><form id='yp60L'><ins id='yp60L'></ins><ul id='yp60L'></ul><sub id='yp60L'></sub></form><legend id='yp60L'></legend><bdo id='yp60L'><pre id='yp60L'><center id='yp60L'></center></pre></bdo></b><th id='yp60L'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='yp60L'><tfoot id='yp60L'></tfoot><dl id='yp60L'><fieldset id='yp60L'></fieldset></dl></div>
            • <small id='yp60L'></small><noframes id='yp60L'>

              <tfoot id='yp60L'></tfoot>
                  本文介紹了何時或為什么在 Python 中使用相對導入的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  是否有任何關于何時在 Python 中使用相對導入的規則或指南?我一直在使用它們,就像在 Flask Web 框架中一樣.在搜索這個主題時,我只看到有關如何使用相對導入的文章,而沒有看到為什么.

                  Is there any rules or guidelines concerning when to use relative imports in Python? I see them in use all the time like in the Flask web framework. When searching for this topic, I only see articles on how to use relative imports, but not why.

                  那么使用有什么特別的好處:

                  So is there some special benefit to using:

                  from . import x
                  

                  而不是:

                  from package import x
                  

                  此外,我注意到相關的 SO 帖子 提到不鼓勵相對導入.然而人們仍在繼續使用它們.

                  Moreover, I noticed that a related SO post mentions that relative imports are discouraged. Yet people still continue to use them.

                  推薦答案

                  查看 PEP 328 關于相對進口的部分

                  理由似乎是這樣寫的:

                  展示了幾個用例,其中最重要的是能夠重新排列大型包的結構,而無需編輯子包.此外,包內的模塊在沒有相對導入的情況下無法輕松導入自身.

                  Several use cases were presented, the most important of which is being able to rearrange the structure of large packages without having to edit sub-packages. In addition, a module inside a package can't easily import itself without relative imports.

                  這篇關于何時或為什么在 Python 中使用相對導入的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                  【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                  相關文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復導入頂級名稱的情況下構造python包)
                  Install python packages on OpenShift(在 OpenShift 上安裝 python 包)
                  How to refresh sys.path?(如何刷新 sys.path?)
                  Distribute a Python package with a compiled dynamic shared library(分發帶有已編譯動態共享庫的 Python 包)
                  <i id='XQsrI'><tr id='XQsrI'><dt id='XQsrI'><q id='XQsrI'><span id='XQsrI'><b id='XQsrI'><form id='XQsrI'><ins id='XQsrI'></ins><ul id='XQsrI'></ul><sub id='XQsrI'></sub></form><legend id='XQsrI'></legend><bdo id='XQsrI'><pre id='XQsrI'><center id='XQsrI'></center></pre></bdo></b><th id='XQsrI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='XQsrI'><tfoot id='XQsrI'></tfoot><dl id='XQsrI'><fieldset id='XQsrI'></fieldset></dl></div>
                • <tfoot id='XQsrI'></tfoot>

                    <bdo id='XQsrI'></bdo><ul id='XQsrI'></ul>
                        <legend id='XQsrI'><style id='XQsrI'><dir id='XQsrI'><q id='XQsrI'></q></dir></style></legend>

                              <tbody id='XQsrI'></tbody>

                          1. <small id='XQsrI'></small><noframes id='XQsrI'>

                          2. 主站蜘蛛池模板: 午夜www | 亚洲精品国产一区 | 天天干天天干天天 | 在线欧美 | 亚洲欧美精品一区 | 国产片一区二区 | 999国产视频| 国产小视频在线播放 | 134vcc影院免费观看 | igao在线观看| 触手繁殖の地狱3d啪啪 | 手机看片福利永久 | 日韩美女在线观看 | 成人伊人网 | 在线观看的av | 精品一区二区免费视频 | 明日边缘| 午夜在线免费视频 | 激情五月综合网 | 亚洲少妇一区 | 成人午夜网| 天天看片天天爽 | 蜜桃视频成人 | 日本免费在线观看 | 日韩在线视频网站 | 欧美揉bbbbb揉bbbbb| 看免费毛片| 91亚色视频 | 日韩欧美自拍 | 九九热在线播放 | 不卡av在线播放 | 亚洲激情五月 | 欧美一级特黄视频 | 午夜国产在线 | 综合二区 | 欧美在线中文字幕 | 亚洲日本精品 | 亚洲欧美精品在线 | 欧美在线一级 | 天天视频国产 | av不卡一区|