久久久久久久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>

        何時(shí)或?yàn)槭裁丛?Python 中使用相對(duì)導(dǎo)入

        When or why to use relative imports in Python(何時(shí)或?yàn)槭裁丛?Python 中使用相對(duì)導(dǎo)入)

            <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>
                  本文介紹了何時(shí)或?yàn)槭裁丛?Python 中使用相對(duì)導(dǎo)入的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  是否有任何關(guān)于何時(shí)在 Python 中使用相對(duì)導(dǎo)入的規(guī)則或指南?我一直在使用它們,就像在 Flask Web 框架中一樣.在搜索這個(gè)主題時(shí),我只看到有關(guān)如何使用相對(duì)導(dǎo)入的文章,而沒有看到為什么.

                  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
                  

                  此外,我注意到相關(guān)的 SO 帖子 提到不鼓勵(lì)相對(duì)導(dǎo)入.然而人們?nèi)栽诶^續(xù)使用它們.

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

                  推薦答案

                  查看 PEP 328 關(guān)于相對(duì)進(jìn)口的部分

                  理由似乎是這樣寫的:

                  展示了幾個(gè)用例,其中最重要的是能夠重新排列大型包的結(jié)構(gòu),而無需編輯子包.此外,包內(nèi)的模塊在沒有相對(duì)導(dǎo)入的情況下無法輕松導(dǎo)入自身.

                  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.

                  這篇關(guān)于何時(shí)或?yàn)槭裁丛?Python 中使用相對(duì)導(dǎo)入的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  python: Two modules and classes with the same name under different packages(python:不同包下同名的兩個(gè)模塊和類)
                  Configuring Python to use additional locations for site-packages(配置 Python 以使用站點(diǎn)包的其他位置)
                  How to structure python packages without repeating top level name for import(如何在不重復(fù)導(dǎo)入頂級(jí)名稱的情況下構(gòu)造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(分發(fā)帶有已編譯動(dòng)態(tài)共享庫(kù)的 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. 主站蜘蛛池模板: 欧美亚洲视频在线观看 | 国产成人99久久亚洲综合精品 | 91视频网 | 91免费在线视频 | 中文字幕av色| 亚洲免费在线 | 男人的天堂亚洲 | 日本精品一区二区三区视频 | 日本a级大片| 日本精品一区二区三区四区 | 日本一区不卡 | 91久久视频 | 日韩国产在线 | 国产精品伦一区二区三级视频 | 国产中文字幕在线 | 国内精品视频一区二区三区 | 91伊人 | 国产伦一区二区三区视频 | 久久99精品久久久久婷婷 | 91在线视频观看 | 成人不卡| 精品一区二区三区在线观看 | 国产91丝袜在线播放 | 久久中文字幕一区 | 亚洲国产视频一区二区 | 成人做爰www免费看 午夜精品久久久久久久久久久久 | 懂色av蜜桃av | 午夜天堂精品久久久久 | 中文字幕一区二区三区在线视频 | 97精品国产一区二区三区 | 欧美激情精品久久久久久变态 | 狠狠操狠狠操 | 鸳鸯谱在线观看高清 | 国产专区在线 | 三区四区在线观看 | 国产精品久久久久久久久久久久冷 | 日本手机看片 | 成人在线免费观看 | 毛片高清 | 国际精品久久 | 久久久久久久久久久一区二区 |