Python 3面向對象編程第2版

Python 3面向對象編程第2版

《Python 3面向對象編程第2版》是2017年東南大學出版社出版的圖書。

基本介紹

  • 中文名:Python 3面向對象編程第2版
  • 作者:Dusty Phillips
  • 出版時間:2017年4月
  • 出版社:東南大學出版社
  • ISBN:9787564170745
  • 開本:16 開
  • 裝幀:平裝
內容簡介,圖書目錄,作者簡介,

內容簡介

《Python3面向對象編程(第2版 影印版 英文版)》講解了類、數據封裝、繼承、多態、抽象和異常,著重強調了在一款設計良好的軟體開發過程中使用每個原則的時機。除了學習如何利用高層次的設計模式來創建可維護的應用程式,你還可以了解到字元串和檔案處理的複雜性以及Python區分二進制數據和文本數據的方法。另外,單元測試的樂趣以及並發編程的難題也是少不了的。
  書中更新了大量的內容,以反映出近來核心Python庫的變化,這些新的特性在《Python3面向對象編程(第2版 影印版 英文版)》備受讚譽的第1版面世時還無法使用。除此之外,全書的結構也進行了重新調整和組織,提升了知識量,增強了閱讀體驗。
  目標讀者如果你是初次接觸面向對象編程技術,或是只具備基本的Python技能,希望能夠深入學習如何正確地使用Python面向對象編程技術來設計軟體,那么《Python3面向對象編程(第2版 影印版 英文版)》就是為你準備的。
  你將從《Python3面向對象編程(第2版 影印版 英文版)》中學到什麼通過創建類和定義方法來實現Python對象。
  將相關的對象劃分成不同的類,通過類接口來描述這些對象的屬性和行為。
  使用繼承來擴展類的功能。
  明白什麼時候使用面向對象特性,什麼時候不使用(後者更重要)。
  了解什麼是設計模式,為什麼在Python中有這些不同的設計模式。
  揭示單元測試的簡潔性及其在Python中的重要性。
  理解Python3中常見的並發編程技術和陷阱。
  探究用於開發大規模並發網路系統的新模組Async10。

圖書目錄

Preface
Chapter 1: Object-oriented Desiqn
Introducing object-oriented
Objects and classes
Specifying attributes and behaviors
Data describes objects
Behaviors are actions
Hiding details and creating the public interface
Composition
Inheritance
Inheritance provides abstraction
Multiple inheritance
Case study
Exercises
Summary
Chapter 2: Objects in Python
Creating Python classes
Adding attributes
Making it do something
Talking to yourself
More arguments
Initializing the object
Explaining yourself
Modules and packages
Organizing the modules
Absolute imports
Relative imports
Organizing module contents
Who can access my data?
Third-party libraries
Case study
Exercises
Summary
Chapter 3: When Objects Are Alike
Basic inheritance
Extending built-ins
Overriding and super
Multiple inheritance
The diamond problem
Different sets of arguments
Polymorphism
Abstract base classes
Using an abstract base class
Creating an abstract base class
Demystifying the magic
Case study
Exercises
Summary
Chapter 4: Expecting the Unexpected
Raising exceptions
Raising an exception
The effects of an exception
Handling exceptions
The exception hierarchy
Defining our own exceptions
Case study
Exercises
Summary
Chapter 5: When to Use Object-oriented Programming
Treat objects as objects
Adding behavior to class data with properties
Properties in detail
Decorators - another way to create properties
Deciding when to use properties
Manager objects
Removing duplicate code
In practice
Case study
Exercises
Summary
Chapter 6: Python Data Structures
Empty objects
Tuples and named tuples
Named tuples
Dictionaries
Dictionary use cases
Using defaultdict
Counter
Lists
Sorting lists
Sets
Extending built-ins
Queues
FIFO queues
LIFO queues
Priority queues
Case study
Exercises
Summary
Chapter 7: Python Object-oriented Shortcuts
Python built-in functions
The len function
Reversed
Enumerate
File I/O
Placing it in context
An alternative to method overloading
Default arguments
Variable argument lists
Unpacking arguments
Functions are objects too
Using functions as attributes
Callable objects
Case study
Exercises
Summary
Chapter 8: Strings and Serialization
Strings
String manipulation
String formatting
Escaping braces
Keyword arguments
Container Iookups
Object Iookups
Making it look right
Strings are Unicode
Converting bytes to text
Converting text to bytes
Mutable byte strings
Regular expressions
Matching patterns
Matching a selection of characters
Escaping characters
Matching multiple characters
Grouping patterns together
Getting information from regular expressions
Making repeated regular expressions efficient
Serializing objects
Customizing pickles
Serializing web objects
Case study
Exercises
Summary
Chapter 9: The Iterator Pattern
Design patterns in brief
Iterators
The iterator protocol
Comprehensions
List comprehensions
Set and dictionary comprehensions
Generator expressions
Generators
Yield items from another iterable
Coroutines
Back to log parsing
Closing coroutines and throwing exceptions
The relationship between coroutines, generators, and functions
Case study
Exercises
Summary
Chapter 10: Python Design Patterns I
The decorator pattern
A decorator example
Decorators in Python
The observer pattern
An observer example
The strategy pattern
A strategy example
Strategy in Python
The state pattern
A state example
State versus strategy
State transition as coroutines
The singleton pattern
Singleton implementation
The template pattern
A template example
Exercises
Summary
Chapter 11: Python Design Patterns II
The adapter pattern
The facade pattern
The flyweight pattern
The command pattern
The abstract factory pattern
The composite pattern
Exercises
Summary
Chapter 12: Testing Object-oriented Programs
Why test?
Test-driven development
Unit testing
Assertion methods
Reducing boilerplate and cleaning up
Organizing and running tests
Ignoring broken tests
Testing with py.test
One way to do setup and cleanup
A completely different way to set up variables
Skipping tests with py.test
Imitating expensive objects
How much testing is enough?
Case study
Implementing it
Exercises
Summary
Chapter 13: Concurrency
Threads
The many problems with threads
Shared memory
The global interpreter lock
Thread overhead
Multiprocessing
Multiprocessing pools
Queues
The problems with multiprocessing
Futures
AsynclO
AsynclO in action
Reading an AsynclO future
AsynclO for networking
Using executors to wrap blocking code
Streams
Executors
Case study
Exercises
Summary
Index

作者簡介

 Dusty Phillips,is a Canadian software developer and author currently living in Seattle, Washington. He has been active in the open source community for a decade and a half and programming in Python for nearly all of it. He cofounded the popular Puget Sound Programming Python meetup group; drop by and say hi if you're in the area.

熱門詞條

聯絡我們