Python concurrent.futures 提供了一組高階 API 給使用者執行非同步的任務。透過 ThreadPoolExectuor 執行 thread 層級的非同步任務,或是使用 ProcessPoolExecutor 執行 process 層級的非同步任務。 …
分類: Python
linecache – Random access to text lines The linecache module allows one to get any line from a Python source file, while attempting to optimize internally, using a cache, the common case where ma …
weakref – Weak References The weakref module allows the Python programmer to create weak references to objects. 官方介紹文件:8.8. weakref — Weak references weakref 函式庫是用來建立對物件的弱引用 (weak reference)。弱引用並 …
abc — Abstract Base Classes This module provides the infrastructure for defining abstract base classes (ABCs) in Python, as outlined in PEP 3119; see the PEP for why this was added to Python. (See also …
How documentation works, and how to make it work for your project By Daniele Procida, video: youtube. article: What nobody tells you about documentation TL; DR: 4-dimensional goals. TUTORIALS HO …
random – 產生偽隨機亂數 This module implements pseudo-random number generators for various distributions. 官方介紹文件:9.6. random — Generate pseudo-random numbers 如果要產生亂數密碼或是 token,請使用 secrets 模組,絕對不要使用 rand …
sys — 系統相關的參數以及函式 This module provides access to some variables used or maintained by the interpreter and to functions that interact strongly with the interpreter. It is always available. 官方介紹文件:29.1 s …
CPython’s garbage collection relies on each object’s reference count. Each object has their own reference count, when the object is referenced by others, then we will need to increase objec …
本文將會探討 Python 內部的 Global Interpreter Lock,以及學習其如何影響 multi-threaded 程式。 原作者:A. Jesse,Twitter: @jessejiryudavis 原文:Grok the GIL: How to write fast and thread-safe Python Louie Lu 經作者同意[1][2]翻譯為正體中文。 當我6 …
PyCon US 2017 即將在美國奧瑞岡開始,快速瀏覽了一下 talk list,真不愧是 PyCon US,每個題目都看起來非常的高大上而且紮實。以下是我挑選 18 個我有興趣的主題,記錄下來。 完整的 talk list 可以參考這邊: PyCon US 2017 Talks Schedule: https://us.pycon.org/2017/schedule/talks/ PyCon …