Pythonic Programming: Tips for Becoming an Idiomatic Python Programmer
暫譯: Pythonic 程式設計:成為地道 Python 程式設計師的技巧
Zinoviev, Dmitry
- 出版商: Pragmatic Bookshelf
- 出版日期: 2021-11-02
- 售價: $1,050
- 貴賓價: 9.5 折 $998
- 語言: 英文
- 頁數: 152
- 裝訂: Quality Paper - also called trade paper
- ISBN: 168050861X
- ISBN-13: 9781680508611
-
相關分類:
Python、程式語言
立即出貨 (庫存 < 4)
商品描述
Make your good Python code even better by following proven and effective pythonic programming tips. Avoid logical errors that usually go undetected by Python linters and code formatters, such as frequent data look-ups in long lists, improper use of local and global variables, and mishandled user input. Discover rare language features, like rational numbers, set comprehensions, counters, and pickling, that may boost your productivity. Discover how to apply general programming patterns, including caching, in your Python code. Become a better-than-average Python programmer, and develop self-documented, maintainable, easy-to-understand programs that are fast to run and hard to break.
Python is one of the most popular and rapidly growing modern programming languages. With more than 200 standard libraries and even more third-party libraries, it reaches into the software development areas as diverse as artificial intelligence, bioinformatics, natural language processing, and computer vision. Find out how to improve your understanding of the spirit of the language by using one hundred pythonic tips to make your code safer, faster, and better documented.
This programming style manual is a quick reference of helpful hints and a random source of inspiration. Choose the suitable data structures for searching and sorting jobs and become aware of how a wrong choice may cause your application to be completely ineffective. Understand global and local variables, class and instance attributes, and information-hiding techniques. Create functions with flexible interfaces. Manage intermediate computation results by caching them in files and memory to improve performance and reliability. Polish your documentation skills to make your code easy for other programmers to understand. As a bonus, discover Easter eggs cleverly planted in the standard library by its developers.
Polish, secure, and speed-up your Python applications, and make them easier to maintain by following pythonic programming tips.
What You Need:
You will need a Python interpreter (ideally, version 3.4 or above) and the standard Python library that usually comes with the interpreter.
商品描述(中文翻譯)
使您的 Python 程式碼更上一層樓,遵循經過驗證且有效的 Pythonic 程式設計技巧。避免邏輯錯誤,這些錯誤通常不會被 Python 的靜態檢查工具和程式碼格式化工具檢測到,例如在長列表中頻繁查找資料、不當使用區域變數和全域變數,以及錯誤處理使用者輸入。發現一些罕見的語言特性,如有理數、集合推導式、計數器和序列化,這些特性可能會提升您的生產力。了解如何在您的 Python 程式碼中應用一般的程式設計模式,包括快取。成為一位超越平均水平的 Python 程式設計師,開發自我文件化、可維護且易於理解的程式,這些程式執行快速且不易出錯。
Python 是當今最受歡迎且快速成長的現代程式語言之一。擁有超過 200 個標準庫以及更多的第三方庫,它涵蓋了人工智慧、生物資訊學、自然語言處理和計算機視覺等多樣的軟體開發領域。透過使用一百個 Pythonic 提示來改善您對語言精神的理解,使您的程式碼更安全、更快速且更具文件化。
這本程式設計風格手冊是有用提示的快速參考和隨機靈感的來源。選擇適合的資料結構來進行搜尋和排序工作,並意識到錯誤的選擇可能會使您的應用程式完全無效。了解全域變數和區域變數、類別和實例屬性,以及資訊隱藏技術。創建具有靈活介面的函數。通過將中間計算結果快取到檔案和記憶體中來管理它們,以提高性能和可靠性。提升您的文件撰寫技巧,使您的程式碼易於其他程式設計師理解。作為額外獎勵,發現開發者巧妙植入標準庫中的彩蛋。
潤飾、安全性和加速您的 Python 應用程式,並通過遵循 Pythonic 程式設計技巧使其更易於維護。
您需要的:
您需要一個 Python 解譯器(理想情況下,版本 3.4 或以上)和通常隨解譯器附帶的標準 Python 庫。
作者簡介
Dmitry Zinoviev is a professor of Computer Science at Suffolk University in Boston and has a dual degree in Physics and Computer Science. He is passionate about C and Python programming, complex network analysis, computational social science, and digital humanities.
作者簡介(中文翻譯)
德米特里·齊諾維耶夫(Dmitry Zinoviev)是波士頓薩福克大學(Suffolk University)計算機科學的教授,擁有物理學和計算機科學的雙學位。他對 C 和 Python 程式設計、複雜網絡分析、計算社會科學以及數位人文學科充滿熱情。