Начать новую тему Ответить на тему
Статистика раздачи
Размер: 930.56 КБ | | Скачали: 10
Сидеров: 0  [0 байт/сек]    Личеров: 0  [0 байт/сек]
Пред. тема | След. тема 

Автор
Сообщение

Ответить с цитатой 

Mastering Object-oriented Python

Год издания: 2014
Автор: Steven F. Lott

Издательство: Packt Publishing
ISBN: 9781783280971
Язык: Английский

Формат: ePub
Качество: Изначально компьютерное (eBook)
Интерактивное оглавление: Да
Количество страниц: 652

Описание: This practical example-oriented guide will teach you advanced concepts of object-oriented programming in Python. This book will present detailed examples of almost all of the special method names that support creating classes that integrate seamlessly with Python's built-in features. It will show you how to use JSON, YAML, Pickle, CSV, XML, Shelve, and SQL to create persistent objects and transmit objects between processes. The book also covers logging, warnings, unit testing, configuration files, and how to work with the command line.
This book is broken into three major parts: Pythonic Classes via Special Methods; Persistence and Serialization; Testing, Debugging, Deploying, and Maintaining. The special methods are broken down into several focus areas: initialization, basics, attribute access, callables, contexts, containers, collections, numbers, and more advanced techniques such as decorators and mixin classes.
1: The __init__() Method
The implicit superclass – object
The base class object __init__() method
Implementing __init__() in a superclass
Using __init__() to create manifest constants
Leveraging __init__() via a factory function
Implementing __init__() in each subclass
Simple composite objects
Complex composite objects
Stateless objects without __init__()
Some additional class definitions
Multi-strategy __init__()
Yet more __init__() techniques
Summary
2: Integrating Seamlessly with Python Basic Special Methods
The __repr__() and __str__() methods
The __format__() method
The __hash__() method
The __bool__() method
The __bytes__() method
The comparison operator methods
The __del__() method
The __new__() method and immutable objects
The __new__() method and metaclasses
Summary
3: Attribute Access, Properties, and Descriptors
Basic attribute processing
Creating properties
Using special methods for attribute access
The __getattribute__() method
Creating descriptors
Summary, design considerations, and trade-offs
4: The ABCs of Consistent Design
Abstract base classes
Base classes and polymorphism
Callables
Containers and collections
Numbers
Some additional abstractions
The abc module
Summary, design considerations, and trade-offs
5: Using Callables and Contexts
Designing with ABC callables
Improving performance
Using functools for memoization
Complexities and the callable API
Managing contexts and the with statement
Defining the __enter__() and __exit__() methods
Context manager as a factory
Summary
6: Creating Containers and Collections
ABCs of collections
Examples of special methods
Using the standard library extensions
Creating new kinds of collections
Defining a new kind of sequence
Creating a new kind of mapping
Creating a new kind of set
Summary
7: Creating Numbers
ABCs of numbers
The arithmetic operator's special methods
Creating a numeric class
Computing a numeric hash
Implementing other special methods
Optimization with the in-place operators
Summary
8: Decorators and Mixins – Cross-cutting Aspects
Class and meaning
Using built-in decorators
Using standard library mixin classes
Writing a simple function decorator
Parameterizing a decorator
Creating a method function decorator
Creating a class decorator
Adding method functions to a class
Using decorators for security
Summary
9: Serializing and Saving – JSON, YAML, Pickle, CSV, and XML
Understanding persistence, class, state, and representation
Filesystem and network considerations
Defining classes to support persistence
Dumping and loading with JSON
Dumping and loading with YAML
Dumping and loading with pickle
Dumping and loading with CSV
Dumping and loading with XML
Summary
10: Storing and Retrieving Objects via Shelve
Analyzing persistent object use cases
Creating a shelf
Designing shelvable objects
Searching, scanning, and querying
Designing an access layer for shelve
Creating indexes to improve efficiency
Adding yet more index maintenance
The writeback alternative to index updates
Summary
11: Storing and Retrieving Objects via SQLite
SQL databases, persistence, and objects
Processing application data with SQL
Mapping Python objects to SQLite BLOB columns
Mapping Python objects to database rows manually
Improving performance with indices
Adding an ORM layer
Querying post objects given a tag string
Improving performance with indices
Summary
12: Transmitting and Sharing Objects
Class, state, and representation
Using HTTP and REST to transmit objects
Implementing a REST server – WSGI and mod_wsgi
Using Callable classes for WSGI applications
Creating a secure REST service
Implementing REST with a web application framework
Using a message queue to transmit objects
Summary
13: Configuration Files and Persistence
Configuration file use cases
Representation, persistence, state, and usability
Storing the configuration in the INI files
Handling more literals via the eval() variants
Storing the configuration in PY files
Why is exec() a nonproblem?
Using ChainMap for defaults and overrides
Storing the configuration in JSON or YAML files
Storing the configuration in property files
Storing the configuration in XML files – PLIST and others
Summary
14: The Logging and Warning Modules
Creating a basic log
Configuration gotcha
Specializing logging for control, debug, audit, and security
Using the warnings module
Advanced logging – the last few messages and network destinations
Summary
15: Designing for Testability
Defining and isolating units for testing
Using doctest to define test cases
Using setup and teardown
The TestCase class hierarchy
Using externally defined expected results
Automated integration or performance testing
Summary
16: Coping With the Command Line
The OS interface and the command line
Parsing the command line with argparse
Integrating command-line options and environment variables
Customizing the help output
Creating a top-level main() function
Programming In The Large
Additional composite command design patterns
Integrating with other applications
Summary
17: The Module and Package Design
Designing a module
Whole module versus module items
Designing a package
Designing a main script and the __main__ module
Designing long-running applications
Organizing code into src, bin, and test
Installing Python modules
Summary
18: Quality and Documentation
Writing docstrings for the help() function
Using pydoc for documentation
Better output via the RST markup
Writing effective docstrings
Writing file-level docstrings, including modules and packages
More sophisticated markup techniques
Using Sphinx to produce the documentation
Writing the documentation
Literate programming
Summary
Правила, инструкции, FAQ!!!
Торрент   Скачать торрент Магнет ссылка
Скачать торрент
[ Размер 775 байт / Просмотров 86 ]

Статус
Проверен 
 
Размер  930.56 КБ
Приватный: Нет (DHT включён)
.torrent скачан  10
Как залить торрент? | Как скачать Torrent? | Ошибка в торренте? Качайте магнет  


     Отправить личное сообщение
   
Страница 1 из 1
Показать сообщения за:  Поле сортировки  
Начать новую тему Ответить на тему


Сейчас эту тему просматривают: нет зарегистрированных пользователей и гости: 1


Вы не можете начинать темы
Вы не можете отвечать на сообщения
Вы не можете редактировать свои сообщения
Вы не можете удалять свои сообщения
Вы не можете добавлять вложения

Перейти:  
Ресурс не предоставляет электронные версии произведений, а занимается лишь коллекционированием и каталогизацией ссылок, присылаемых и публикуемых на форуме нашими читателями. Если вы являетесь правообладателем какого-либо представленного материала и не желаете чтобы ссылка на него находилась в нашем каталоге, свяжитесь с нами и мы незамедлительно удалим её. Файлы для обмена на трекере предоставлены пользователями сайта, и администрация не несёт ответственности за их содержание. Просьба не заливать файлы, защищенные авторскими правами, а также файлы нелегального содержания!