中图网(原中国图书网):网上书店,尾货特色书店,30万种特价书低至2折!

歡迎光臨中圖網 請 | 注冊
> >
Effective Python:改善Python程序的90個建議 (第2版)(英文版)

包郵 Effective Python:改善Python程序的90個建議 (第2版)(英文版)

出版社:電子工業出版社出版時間:2020-05-01
開本: 其他 頁數: 460
中 圖 價:¥70.4(5.5折) 定價  ¥128.0 登錄后可看到會員價
加入購物車 收藏
開年大促, 全場包郵
?新疆、西藏除外
本類五星書更多>

Effective Python:改善Python程序的90個建議 (第2版)(英文版) 版權信息

  • ISBN:9787121386930
  • 條形碼:9787121386930 ; 978-7-121-38693-0
  • 裝幀:平裝-膠訂
  • 冊數:暫無
  • 重量:暫無
  • 所屬分類:>

Effective Python:改善Python程序的90個建議 (第2版)(英文版) 本書特色

Brett Slatkin根據自己在Google公司多年開發Python基礎架構所積累的經驗,揭示了Python語言中一些鮮為人知的微妙特性,并給出了能夠改善代碼功能及運行效率的習慣用法。書中匯聚了90個優秀的實踐原則、開發技巧和便捷方案,并以實用的代碼范例來解釋它們。通過本書,你能夠了解到解決關鍵編程任務的實用技巧,并學會編寫易于理解、便于維護且利于改進的代碼。除此之外,本書第2版基本上修改了第1版中的所有條目,以反映Python實踐的演變歷程。

Effective Python:改善Python程序的90個建議 (第2版)(英文版) 內容簡介

Brett Slatkin根據自己在Google公司多年開發Python基礎架構所積累的經驗,揭示了Python語言中一些鮮為人知的微妙特性,并給出了能夠改善代碼功能及運行效率的習慣用法。書中匯聚了90個很好的實踐原則、開發技巧和便捷方案,并以實用的代碼范例來解釋它們。通過本書,你能夠了解到解決關鍵編程任務的實用技巧,并學會編寫易于理解、便于維護且利于改進的代碼。除此之外,本書第2版基本上修改了版中的所有條目,以反映Python實踐的演變歷程。

Effective Python:改善Python程序的90個建議 (第2版)(英文版) 目錄

Chapter 1 Pythonic Thinking 1
Item 1: Know Which Version of Python You’re Using 1
Item 2: Follow the PEP 8 Style Guide 2
Item 3: Know the Differences Between bytes and str 5
Item 4: Prefer Interpolated F-Strings Over C-style
Format Strings and str.format 11
Item 5: Write Helper Functions Instead of
Complex Expressions 21
Item 6: Prefer Multiple Assignment Unpacking
Over Indexing 24
Item 7: Prefer enumerate Over range 28
Item 8: Use zip to Process Iterators in Parallel 30
Item 9: Avoid else Blocks After for and while Loops 32
Item 10: Prevent Repetition with Assignment Expressions 35
Chapter 2 Lists and Dictionaries 43
Item 11: Know How to Slice Sequences 43
Item 12: Avoid Striding and Slicing in a Single Expression 46
Item 13: Prefer Catch-All Unpacking Over Slicing 48
Item 14: Sort by Complex Criteria Using the key Parameter 52
Item 15: Be Cautious When Relying on dict
Insertion Ordering 58
Item 16: Prefer get Over in and KeyError to
Handle Missing Dictionary Keys 65
Item 17: Prefer defaultdict Over setdefault to
Handle Missing Items in Internal State 70
Item 18: Know How to Construct Key-Dependent
Default Values with __missing__ 73
Chapter 3 Functions 77
Item 19: Never Unpack More Than Three Variables
When Functions Return Multiple Values 77
Item 20: Prefer Raising Exceptions to Returning None 80
Item 21: Know How Closures Interact with Variable Scope 83
Item 22: Reduce Visual Noise with Variable
Positional Arguments 87
Item 23: Provide Optional Behavior with Keyword Arguments 90
Item 24: Use None and Docstrings to Specify
Dynamic Default Arguments 94
Item 25: Enforce Clarity with Keyword-Only and
Positional-Only Arguments 97
Item 26: Define Function Decorators with functools.wraps 102
Chapter 4 Comprehensions and Generators 107
Item 27: Use Comprehensions Instead of map and filter 107
Item 28: Avoid More Than Two Control Subexpressions in
Comprehensions 109
Item 29: Avoid Repeated Work in Comprehensions by Using
Assignment Expressions 111
Item 30: Consider Generators Instead of Returning Lists 114
Item 31: Be Defensive When Iterating Over Arguments 117
Item 32: Consider Generator Expressions for Large List
Comprehensions 122
Item 33: Compose Multiple Generators with yield from 124
Item 34: Avoid Injecting Data into Generators with send 127
Item 35: Avoid Causing State Transitions in
Generators with throw 133
Item 36: Consider itertools for Working with Iterators
and Generators 138
Chapter 5 Classes and Interfaces 145
Item 37: Compose Classes Instead of Nesting
Many Levels of Built-in Types 145
Item 38: Accept Functions Instead of Classes for
Simple Interfaces 152
Item 39: Use @classmethod Polymorphism to
Construct Objects Generically 155
Item 40: Initialize Parent Classes with super 160
Item 41: Consider Composing Functionality
with Mix-in Classes 165
Item 42: Prefer Public Attributes Over Private Ones 170
Item 43: Inherit from collections.abc for
Custom Container Types 175
Chapter 6 Metaclasses and Attributes 181
Item 44: Use Plain Attributes Instead of Setter and
Getter Methods 181
Item 45: Consider @property Instead of
Refactoring Attributes 186
Item 46: Use Descriptors for Reusable @property Methods 190
Item 47: Use __getattr__, __getattribute__, and
__setattr__ for Lazy Attributes 195
Item 48: Validate Subclasses with __init_subclass__ 201
Item 49: Register Class Existence with __init_subclass__ 208
Item 50: Annotate Class Attributes with __set_name__ 214
Item 51: Prefer Class Decorators Over Metaclasses for
Composable Class Extensions 218
Chapter 7 Concurrency and Parallelism 225
Item 52: Use subprocess to Manage Child Processes 226
Item 53: Use Threads for Blocking I/O, Avoid for Parallelism 230
Item 54: Use Lock to Prevent Data Races in Threads 235
Item 55: Use Queue to Coordinate Work Between Threads 238
Item 56: Know How to Recognize When Concurrency
Is Necessary 248
Item 57: Avoid Creating New Thread Instances for
On-demand Fan-out 252
Item 58: Understand How Using Queue for
Concurrency Requires Refactoring 257
Item 59: Consider ThreadPoolExecutor When Threads
Are Necessary for Concurrency 264
Item 60: Achieve Highly Concurrent I/O with Coroutines 266
Item 61: Know How to Port Threaded I/O to asyncio 271
Item 62: Mix Threads and Coroutines to Ease the
Transition to asyncio 282
Item 63: Avoid Blocking the asyncio Event Loop to
Maximize Responsiveness 289
Item 64: Consider concurrent.futures for True Parallelism 292
Chapter 8 Robustness and Performance 299
Item 65: Take Advantage of Each Block in try/except
/else/finally 299
Item 66: Consider contextlib and with Statements
for Reusable try/finally Behavior 304
Item 67: Use datetime Instead of time for Local Clocks 308
Item 68: Make pickle Reliable with copyreg 312
Item 69: Use decimal When Precision Is Paramount 319
Item 70: Profile Before Optimizing 322
Item 71: Prefer deque for Producer?CConsumer Queues 326
Item 72: Consider Searching Sorted Sequences with bisect 334
Item 73: Know How to Use heapq for Priority Queues 336
Item 74: Consider memoryview and bytearray for
Zero-Copy Interactions with bytes 346
Chapter 9 Testing and Debugging 353
Item 75: Use repr Strings for Debugging Output 354
Item 76: Verify Related Behaviors in TestCase Subclasses 357
Item 77: Isolate Tests from Each Other with setUp,
tearDown, setUpModule, and tearDownModule 365
Item 78: Use Mocks to Test Code with
Complex Dependencies 367
Item 79: Encapsulate Dependencies to Facilitate
Mocking and Testing 375
Item 80: Consider Interactive Debugging with pdb 379
Item 81: Use tracemalloc to Understand Memory
Usage and Leaks 384
Chapter 10 Collaboration 389
Item 82: Know Where to Find Community-Built Modules 389
Item 83: Use Virtual Environments for Isolated and
Reproducible Dependencies 390
Item 84: Write Docstrings for Every Function,
Class, and Module 396
Item 85: Use Packages to Organize Modules and
Provide Stable APIs 401
Item 86: Consider Module-Scoped Code to
Configure Deployment Environments 406
Item 87: Define a Root Exception to Insulate
Callers from APIs 408
Item 88: Know How to Break Circular Dependencies 413
Item 89: Consider warnings to Refactor and Migrate Usage 418
Item 90: Consider Static Analysis via typing to Obviate Bugs 425
Index 435
展開全部

Effective Python:改善Python程序的90個建議 (第2版)(英文版) 作者簡介

Brett Slatkin,Gooqle公司不錯軟件工程師。他是Google消費者調查項目的工程主管及聯合創始人,曾從事Google App Engine的Python基礎架構工作,并利用Python來管理眾多的Google服務器。Slatkin也是PubSubHubbub協議的聯合創始人,還用Python為GoogIe實現了針對該協議的系統。他擁有哥倫比亞大學計算機工程專業學士學位。
Brett Slaktin,Google首席軟件工程師、Google消費者調查項目工程主管及聯合創始人、PubSubHubbub 協議聯合創始人。他啟動了Google第一個云計算產品App Engine。十四年前,他在實習時使用Python管理了Google大量的服務器。在日常工作之余,他喜歡彈鋼琴和沖浪。他也喜歡在自己的網站上發布一些編程相關的話題和文章。他擁有紐約市哥倫比亞大學計算機工程學士學位,F居舊金山。

商品評論(0條)
暫無評論……
書友推薦
本類暢銷
編輯推薦
返回頂部
中圖網
在線客服
主站蜘蛛池模板: 高温链条油|高温润滑脂|轴承润滑脂|机器人保养用油|干膜润滑剂-东莞卓越化学 | WF2户外三防照明配电箱-BXD8050防爆防腐配电箱-浙江沃川防爆电气有限公司 | 东莞韩创-专业绝缘骨架|马达塑胶零件|塑胶电机配件|塑封电机骨架厂家 | 「阿尔法设计官网」工业设计_产品设计_产品外观设计 深圳工业设计公司 | 铸铝门厂家,别墅大门庭院大门,别墅铸铝门铜门[十大品牌厂家]军强门业 | 企典软件一站式企业管理平台,可私有、本地化部署!在线CRM客户关系管理系统|移动办公OA管理系统|HR人事管理系统|人力 | 珠光砂保温板-一体化保温板-有釉面发泡陶瓷保温板-杭州一体化建筑材料 | 高压互感器,电流互感器,电压互感器-上海鄂互电气科技有限公司 | 电动百叶窗,开窗器,电动遮阳百叶,电动开窗机生产厂家-徐州鑫友工控科技发展有限公司 | 铝镁锰板_铝镁锰合金板_铝镁锰板厂家_铝镁锰金属屋面板_安徽建科 | 石膏基自流平砂浆厂家-高强石膏基保温隔声自流平-轻质抹灰石膏粉砂浆批发-永康市汇利建设有限公司 | 3A别墅漆/3A环保漆_广东美涂士建材股份有限公司【官网】 | 环球周刊网| 杭州月嫂技术培训服务公司-催乳师培训中心报名费用-产后康复师培训机构-杭州优贝姆健康管理有限公司 | 洗砂机械-球磨制砂机-洗沙制砂机械设备_青州冠诚重工机械有限公司 | 澳门精准正版免费大全,2025新澳门全年免费,新澳天天开奖免费资料大全最新,新澳2025今晚开奖资料,新澳马今天最快最新图库-首页-东莞市傲马网络科技有限公司 | 钢化玻璃膜|手机钢化膜|钢化膜厂家|手机保护膜-【东莞市大象电子科技有限公司】 | 手表腕表维修保养鉴定售后服务中心网点 - 名表维修保养 | 带式过滤机厂家_价格_型号规格参数-江西核威环保科技有限公司 | 中高频感应加热设备|高频淬火设备|超音频感应加热电源|不锈钢管光亮退火机|真空管烤消设备 - 郑州蓝硕工业炉设备有限公司 | 超声波清洗机_大型超声波清洗机_工业超声波清洗设备-洁盟清洗设备 | 货车视频监控,油管家,货车油管家-淄博世纪锐行电子科技 | 深圳市源和塑胶电子有限公司-首页 | 对夹式止回阀_对夹式蝶形止回阀_对夹式软密封止回阀_超薄型止回阀_不锈钢底阀-温州上炬阀门科技有限公司 | 中央空调温控器_风机盘管温控器_智能_液晶_三速开关面板-中央空调温控器厂家 | 耐热钢-耐磨钢-山东聚金合金钢铸造有限公司 | ISO9001认证咨询_iso9001企业认证代理机构_14001|18001|16949|50430认证-艾世欧认证网 | 耐力板-PC阳光板-PC板-PC耐力板 - 嘉兴赢创实业有限公司 | PAS糖原染色-CBA流式多因子-明胶酶谱MMP-上海研谨生物科技有限公司 | 工程管道/塑料管材/pvc排水管/ppr给水管/pe双壁波纹管等品牌管材批发厂家-河南洁尔康建材 | 走心机厂家,数控走心机-台州博城智能科技有限公司 | sfp光模块,高速万兆光模块工厂-性价比更高的光纤模块制造商-武汉恒泰通 | 除甲醛公司-甲醛检测-广西雅居环境科技有限公司 | 中天寰创-内蒙古钢结构厂家|门式刚架|钢结构桁架|钢结构框架|包头钢结构煤棚 | 安全光栅|射频导纳物位开关|音叉料位计|雷达液位计|两级跑偏开关|双向拉绳开关-山东卓信机械有限公司 | 外贸网站建设-外贸网站设计制作开发公司-外贸独立站建设【企术】 | 西安标准厂房_陕西工业厂房_西咸新区独栋厂房_长信科技产业园官方网站 | 健康管理师报名入口,2025年健康管理师考试时间信息网-网站首页 塑料造粒机「厂家直销」-莱州鑫瑞迪机械有限公司 | 电液推杆生产厂家|电动推杆|液压推杆-扬州唯升机械有限公司 | 茶叶百科网-茶叶知识与茶文化探讨分享平台| 阿里巴巴诚信通温州、台州、宁波、嘉兴授权渠道商-浙江联欣科技提供阿里会员办理 |