资源详情

Python3面向对象编程(第2版 影印版 英文版)

Python3面向对象编程(第2版 影印版 英文版)-电子书下载


ISBN: 9787564170745

下载次数:0


本站推荐

书籍资料

  • 内容简介
  • 作者介绍
  • 书籍目录
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.
Preface
Chapter1:Object-orientedDesiqn
Introducingobject-oriented
Objectsandclasses
Specifyingattributesandbehaviors
Datadescribesobjects
Behaviorsareactions
Hidingdetailsandcreatingthepublicinterface
Composition
Inheritance
Inheritanceprovidesabstraction
Multipleinheritance
Casestudy
Exercises
Summary
Chapter2:ObjectsinPython
CreatingPythonclasses
Addingattributes
Makingitdosome

hing
Talkingtoyourself
Morearguments
Initializingtheobject
Explainingyourself
Modulesandpackages
Organizingthemodules
Absoluteimports
Relativeimports
Organizingmodulecontents
Whocanaccessmydata?
Third-partylibraries
Casestudy
Exercises
Summary
Chapter3:WhenObjectsAreAlike
Basicinheritance
Extendingbuilt-ins
Overridingandsuper
Multipleinheritance
Thediamondproblem
Differentsetsofarguments
Polymorphism
Abstractbaseclasses
Usinganabstractbaseclass
Creatinganabstractbaseclass
Demystifyingthemagic
Casestudy
Exercises
Summary
Chapter4:ExpectingtheUnexpected
Raisingexceptions
Raisinganexception
Theeffectsofanexception
Handlingexceptions
Theexceptionhierarchy
Definingourownexceptions
Casestudy
Exercises
Summary
Chapter5:WhentoUseObject-orientedProgramming
Treatobjectsasobjects
Addingbehaviortoclassdatawithproperties
Propertiesindetail
Decorators-anotherwaytocreateproperties
Decidingwhentouseproperties
Managerobjects
Removingduplicatecode
Inpractice
Casestudy
Exercises
Summary
Chapter6:PythonDataStructures
Emptyobjects
Tuplesandnamedtuples
Namedtuples
Dictionaries
Dictionaryusecases
Usingdefaultdict
Counter
Lists
Sortinglists
Sets
Extendingbuilt-ins
Queues
FIFOqueues
LIFOqueues
Priorityqueues
Casestudy
Exercises
Summary
Chapter7:PythonObject-orientedShortcuts
Pythonbuilt-infunctions
Thelen()function
Reversed
Enumerate
FileI/O
Placingitincontext
Analternativetomethodoverloading
Defaultarguments
Variableargumentlists
Unpackingarguments
Functionsareobjectstoo
Usingfunctionsasattributes
Callableobjects
Casestudy
Exercises
Summary
Chapter8:StringsandSerialization
Strings
Stringmanipulation
Stringformatting
Escapingbraces
Keywordarguments
ContainerIookups
ObjectIookups
Makingitlookright
StringsareUnicode
Convertingbytestotext
Convertingtexttobytes
Mutablebytestrings
Regularexpressions
Matchingpatterns
Matchingaselectionofcharacters
Escapingcharacters
Matchingmultiplecharacters
Groupingpatternstogether
Gettinginformationfromregularexpressions
Makingrepeatedregularexpressionsefficient
Serializingobjects
Customizingpickles
Serializingwebobjects
Casestudy
Exercises
Summary
Chapter9:TheIteratorPattern
Designpatternsinbrief
Iterators
Theiteratorprotocol
Comprehensions
Listcomprehensions
Setanddictionarycomprehensions
Generatorexpressions
Generators
Yielditemsfromanotheriterable
Coroutines
Backtologparsing
Closingcoroutinesandthrowingexceptions
Therelationshipbetweencoroutines,generators,andfunctions
Casestudy
Exercises
Summary
Chapter10:PythonDesignPatternsI
Thedecoratorpattern
Adecoratorexample
DecoratorsinPython
Theobserverpattern
Anobserverexample
Thestrategypattern
Astrategyexample
StrategyinPython
Thestatepattern
Astateexample
Stateversusstrategy
Statetransitionascoroutines
Thesingletonpattern
Singletonimplementation
Thetemplatepattern
Atemplateexample
Exercises
Summary
Chapter11:PythonDesignPatternsII
Theadapterpattern
Thefacadepattern
Theflyweightpattern
Thecommandpattern
Theabstractfactorypattern
Thecompositepattern
Exercises
Summary
Chapter12:TestingObject-orientedPrograms
Whytest?
Test-drivendevelopment
Unittesting
Assertionmethods
Reducingboilerplateandcleaningup
Organizingandrunningtests
Ignoringbrokentests
Testingwithpy.test
Onewaytodosetupandcleanup
Acompletelydifferentwaytosetupvariables
Skippingtestswithpy.test
Imitatingexpensiveobjects
Howmuchtestingisenough?
Casestudy
Implementingit
Exercises
Summary
Chapter13:Concurrency
Threads
Themanyproblemswiththreads
Sharedmemory
Theglobalinterpreterlock
Threadoverhead
Multiprocessing
Multiprocessingpools
Queues
Theproblemswithmultiprocessing
Futures
AsynclO
AsynclOinaction
ReadinganAsynclOfuture
AsynclOfornetworking
Usingexecutorstowrapblockingcode
Streams
Executors
Casestudy
Exercises
Summary
Index