99999久久久久久亚洲,欧美人与禽猛交狂配,高清日韩av在线影院,一个人在线高清免费观看,啦啦啦在线视频免费观看www

熱線電話:13121318867

登錄
首頁精彩閱讀python幕后解釋器:一系列的學(xué)習(xí)資源
python幕后解釋器:一系列的學(xué)習(xí)資源
2020-11-12
收藏

作者:豌豆花下貓

來源:Python貓

花下貓語:最近我發(fā)現(xiàn)了一個《Python behind the scenes》系列文章,它計劃深度地剖析python 幕后的 CPython 解釋器的工作原理。作者專門建了一個網(wǎng)站來發(fā)布該系列文章,目前已發(fā)布 4 篇。這些文章都挺長的,想要翻譯好,并不容易。而本文接下來的內(nèi)容,是該作者分享的一篇簡短的參考材料,我先翻譯出來熱熱身~~


原文:https://tenthousandmeters.com/materials/python-behind-the-scenes-a-list-of-resources

作者:Victor Skvortsov

譯者:豌豆花下貓(“Python貓”公眾號作者)

聲明:本翻譯是出于交流學(xué)習(xí)的目的,基于 CC BY-NC-SA 4.0 授權(quán)協(xié)議。為便于閱讀,內(nèi)容略有改動。

在研究 CPython 以及寫作《CPython behind the scenes》系列時,我發(fā)現(xiàn)了一些很有用的文檔、帖子和演講。它們確實是一些非常好的資源,但是并不能回答我的太多問題。這就是為什么我最終決定要分享自己在學(xué)習(xí) CPython 源代碼時的經(jīng)驗。

>> Python 文檔。在所有與 Python 相關(guān)的主題上,Python 文檔幾乎都是第一的查閱選擇。雖然它缺少涵蓋解釋器原理的特殊內(nèi)容,但是 Python/C API 文檔描述了 CPython 的公共接口和一些實現(xiàn)細節(jié)。它附錄了一份《the tutorial for C programmers》,該教程展示了如何使用 C 語言來擴展 Python 程序,或者將 Python 嵌入到 C 應(yīng)用程序中。我敢打賭,只要認真地完成這些閱讀內(nèi)容,你就會對 CPython 的工作原理相當(dāng)?shù)亓私狻?

>> PEP。雖然沒有哪個 PEP 描述了解釋器的總體設(shè)計,但是對 Python 的大多數(shù)主要更改,都有相應(yīng)的提案。PEP 很贊。它們提供了技術(shù)和歷史的背景。文檔的作者們習(xí)慣于適當(dāng)?shù)匾孟嚓P(guān)的 PEP。例如,Python/C API 的參考內(nèi)容中至少提到了一次 PEP-432,描述了 CPython 新的初始化序列的轉(zhuǎn)變,以及 PEP-587(這是其部分的實現(xiàn))。

>> Obi Ike-Nwosu 寫的《 Inside The Python Virtual Machine》一書。在我看來,它是關(guān)于 CPython 內(nèi)部原理的最全面、最準(zhǔn)確的資料。

>> Anthony Shaw 寫的《Your Guide to the CPython Source Code》。這個標(biāo)題不言而喻。如果想直接研究源代碼,你應(yīng)該選擇它!

>> Philip Guo 寫的《CPython internals: A ten-hour codewalk through the Python interpreter source code》。如果你想要更為簡單的介紹,那么這些講座視頻可能是最好的開始。它們基于 CPython 2.7,但是原理保持不變。

>> Yaniv Aknin 寫的《Python’s Innards series》,介紹的是 CPython 3 VM 的早期版本,但仍然非常有用。

>> Eli Bendersky 寫的《Python internals》文章。關(guān)于符號表(symbol table)的帖子特別好。

>> Stupid Python Ideas 博客。有各種 Python 相關(guān)主題的文章。有些涉及 CPython 內(nèi)部原理。強烈推薦,但可能不好檢索。

>> Allison Kaptur 寫的《A Python Interpreter Written in Python》。它介紹了一個玩具版 Python VM,能夠執(zhí)行真正的 Python 字節(jié)碼。這作為解釋器的入門介紹,可能會很有用。但是,我覺得不必要花大量時間研究一個玩具示例,因為 CPython 本身并沒有那么復(fù)雜。

>> Eric Snow 的演講《To GIL or not to GIL》。它的主題是子解釋過程。我喜歡它的地方是 Eric 在開頭描述 CPython 架構(gòu)的方式。

參考材料:

1、Python behind the scenes (https://tenthousandmeters.com/)

2、the tutorial for C programmers (https://docs.python.org/3.9/extending/index.html#extending-index)

3、Inside The Python Virtual Machine (https://leanpub.com/insidethepythonvirtualmachine)

4、Your Guide to the CPython Source Code (https://realpython.com/cpython-source-code-guide/)

5、CPython internals: A ten-hour codewalk through the Python interpreter source code (https://www.youtube.com/playlist?list=PLzV58Zm8FuBL6OAv1Yu6AwXZrnsFbbR0S)

6、Python’s Innards series (https://tech.blog.aknin.name/category/my-projects/pythons-innards/)

7、Python internals (https://eli.thegreenplace.net/tag/python-internals)

8、Stupid Python Ideas (http://stupidpythonideas.blogspot.com/)

9、A Python Interpreter Written in Python (http://aosabook.org/en/500L/a-python-interpreter-written-in-python.html)

10、To GIL or not to GIL (https://www.youtube.com/watch?v=7RlqbHCCVyc)


——熱門課程推薦:

想學(xué)習(xí)PYTHON數(shù)據(jù)分析與金融數(shù)字化轉(zhuǎn)型精英訓(xùn)練營,您可以點擊>>>“人才轉(zhuǎn)型”了解課程詳情;

想從事業(yè)務(wù)型數(shù)據(jù)分析師,您可以點擊>>>“數(shù)據(jù)分析師”了解課程詳情;

想從事大數(shù)據(jù)分析師,您可以點擊>>>“大數(shù)據(jù)就業(yè)”了解課程詳情;

想成為人工智能工程師,您可以點擊>>>“人工智能就業(yè)”了解課程詳情;

想了解Python數(shù)據(jù)分析,您可以點擊>>>“Python數(shù)據(jù)分析師”了解課程詳情;

想咨詢互聯(lián)網(wǎng)運營,你可以點擊>>>“互聯(lián)網(wǎng)運營就業(yè)班”了解課程詳情; 

想了解更多優(yōu)質(zhì)課程,請點擊>>>

數(shù)據(jù)分析咨詢請掃描二維碼

若不方便掃碼,搜微信號:CDAshujufenxi

數(shù)據(jù)分析師資訊
更多

OK
客服在線
立即咨詢
客服在線
立即咨詢
') } function initGt() { var handler = function (captchaObj) { captchaObj.appendTo('#captcha'); captchaObj.onReady(function () { $("#wait").hide(); }).onSuccess(function(){ $('.getcheckcode').removeClass('dis'); $('.getcheckcode').trigger('click'); }); window.captchaObj = captchaObj; }; $('#captcha').show(); $.ajax({ url: "/login/gtstart?t=" + (new Date()).getTime(), // 加隨機數(shù)防止緩存 type: "get", dataType: "json", success: function (data) { $('#text').hide(); $('#wait').show(); // 調(diào)用 initGeetest 進行初始化 // 參數(shù)1:配置參數(shù) // 參數(shù)2:回調(diào),回調(diào)的第一個參數(shù)驗證碼對象,之后可以使用它調(diào)用相應(yīng)的接口 initGeetest({ // 以下 4 個配置參數(shù)為必須,不能缺少 gt: data.gt, challenge: data.challenge, offline: !data.success, // 表示用戶后臺檢測極驗服務(wù)器是否宕機 new_captcha: data.new_captcha, // 用于宕機時表示是新驗證碼的宕機 product: "float", // 產(chǎn)品形式,包括:float,popup width: "280px", https: true // 更多配置參數(shù)說明請參見:http://docs.geetest.com/install/client/web-front/ }, handler); } }); } function codeCutdown() { if(_wait == 0){ //倒計時完成 $(".getcheckcode").removeClass('dis').html("重新獲取"); }else{ $(".getcheckcode").addClass('dis').html("重新獲取("+_wait+"s)"); _wait--; setTimeout(function () { codeCutdown(); },1000); } } function inputValidate(ele,telInput) { var oInput = ele; var inputVal = oInput.val(); var oType = ele.attr('data-type'); var oEtag = $('#etag').val(); var oErr = oInput.closest('.form_box').next('.err_txt'); var empTxt = '請輸入'+oInput.attr('placeholder')+'!'; var errTxt = '請輸入正確的'+oInput.attr('placeholder')+'!'; var pattern; if(inputVal==""){ if(!telInput){ errFun(oErr,empTxt); } return false; }else { switch (oType){ case 'login_mobile': pattern = /^1[3456789]\d{9}$/; if(inputVal.length==11) { $.ajax({ url: '/login/checkmobile', type: "post", dataType: "json", data: { mobile: inputVal, etag: oEtag, page_ur: window.location.href, page_referer: document.referrer }, success: function (data) { } }); } break; case 'login_yzm': pattern = /^\d{6}$/; break; } if(oType=='login_mobile'){ } if(!!validateFun(pattern,inputVal)){ errFun(oErr,'') if(telInput){ $('.getcheckcode').removeClass('dis'); } }else { if(!telInput) { errFun(oErr, errTxt); }else { $('.getcheckcode').addClass('dis'); } return false; } } return true; } function errFun(obj,msg) { obj.html(msg); if(msg==''){ $('.login_submit').removeClass('dis'); }else { $('.login_submit').addClass('dis'); } } function validateFun(pat,val) { return pat.test(val); }