100% found this document useful (2 votes)
306 views

Python 3 Object Oriented Programming 3rd Edition Dusty Phillips [Dusty Phillips] 2024 Scribd Download

Oriented

Uploaded by

darlinmiksaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
306 views

Python 3 Object Oriented Programming 3rd Edition Dusty Phillips [Dusty Phillips] 2024 Scribd Download

Oriented

Uploaded by

darlinmiksaj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 55

Experience Seamless Full Ebook Downloads for Every Genre at textbookfull.

com

Python 3 Object Oriented Programming 3rd Edition


Dusty Phillips [Dusty Phillips]

https://textbookfull.com/product/python-3-object-oriented-
programming-3rd-edition-dusty-phillips-dusty-phillips/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://textbookfull.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Swift 3 Object Oriented Programming Gaston C. Hillar

https://textbookfull.com/product/swift-3-object-oriented-programming-
gaston-c-hillar/

textboxfull.com

Deep Learning in Python An Object Oriented Programming 1st


Edition Hong M. Lei [Lei

https://textbookfull.com/product/deep-learning-in-python-an-object-
oriented-programming-1st-edition-hong-m-lei-lei/

textboxfull.com

Android Programming The Big Nerd Ranch Guide 2nd Edition


Bill Phillips

https://textbookfull.com/product/android-programming-the-big-nerd-
ranch-guide-2nd-edition-bill-phillips/

textboxfull.com

Programming In C Object Oriented Features 1st Edition


Laxmisha Rai

https://textbookfull.com/product/programming-in-c-object-oriented-
features-1st-edition-laxmisha-rai/

textboxfull.com
Surgical Instrumentation Nancymarie Phillips

https://textbookfull.com/product/surgical-instrumentation-nancymarie-
phillips/

textboxfull.com

Astrophysics For Dummies Cynthia Phillips

https://textbookfull.com/product/astrophysics-for-dummies-cynthia-
phillips/

textboxfull.com

C++ Programming: An Object-Oriented Approach, 1e ISE


Behrouz A. Forouzan

https://textbookfull.com/product/c-programming-an-object-oriented-
approach-1e-ise-behrouz-a-forouzan/

textboxfull.com

The American Challenge Reader Michael Phillips

https://textbookfull.com/product/the-american-challenge-reader-
michael-phillips/

textboxfull.com

Object Oriented Programming with SIMOTION Fundamentals


Program Examples and Software Concepts According to IEC
61131 3 1st Edition Michael Braun
https://textbookfull.com/product/object-oriented-programming-with-
simotion-fundamentals-program-examples-and-software-concepts-
according-to-iec-61131-3-1st-edition-michael-braun/
textboxfull.com
Python 3 Object-Oriented Programming
Third Edition

Build robust and maintainable software with object-oriented design


patterns in Python 3.8

Dusty Phillips
BIRMINGHAM - MUMBAI
Python 3 Object-Oriented
Programming Third Edition
Copyright © 2018 Packt Publishing

All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, without the prior written permission of the publisher, except in the case of brief
quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express or implied.
Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages
caused or alleged to have been caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the
accuracy of this information.

Commissioning Editor: Richa Tripathi


Acquisition Editor: Chaitanya Nair
Content Development Editor: Rohit Kumar Singh
Technical Editor: Ketan Kamble
Copy Editor: Safis Editing
Project Coordinator: Vaidehi Sawant
Proofreader: Safis Editing
Indexer: Mariammal Chettiyar
Graphics: Alishon Mendonsa
Production Coordinator: Aparna Bhagat

First published: July 2010


Second edition: August 2015
Third edition: October 2018

Production reference: 2051118

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78961-585-2

www.packt.com
mapt.io

Mapt is an online digital library that gives you full access to over
5,000 books and videos, as well as industry leading tools to help you
plan your personal development and advance your career. For more
information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Mapt is fully searchable

Copy and paste, print, and bookmark content


Packt.com
Did you know that Packt offers eBook versions of every book
published, with PDF and ePub files available? You can upgrade to the
eBook version at www.packt.com and as a print book customer, you are
entitled to a discount on the eBook copy. Get in touch with us at
customercare@packtpub.com for more details.

At www.packt.com, you can also read a collection of free technical


articles, sign up for a range of free newsletters, and receive
exclusive discounts and offers on Packt books and eBooks.
Contributors
About the author
Dusty Phillips is a Canadian software developer and author
currently living in New Brunswick. He has been active in the open
source community for two decades and has been programming in
Python for nearly as long. He holds a master's degree in computer
science and has worked for Facebook, the United Nations, and
several start-ups. He's currently researching privacy-preserving
technology at beanstalk.network.

Python 3 Object-Oriented Programming was his first book. He has


also written Creating Apps in Kivy, and self-published Hacking
Happy, a journey to mental wellness for the technically inclined. A
work of fiction is coming as well, so stay tuned!
About the reviewers
Yogendra Sharma is a developer with experience of the
architecture, design, and development of scalable and distributed
applications. He was awarded a bachelor's degree from Rajasthan
Technical University in computer science. With a core interest in
microservices and Spring, he also has hands-on experience
technologies such as AWS Cloud, Python, J2EE, Node.js, JavaScript,
Angular, MongoDB, and Docker. Currently, he works as an IoT and
cloud architect at Intelizign Engineering Services, Pune.

Josh Smith has been coding professionally in Python, JavaScript,


and C# for over 5 years, but has loved programming since learning
Pascal over 20 years ago. Python is his default language for personal
and professional projects. He believes code should be simple, goal-
oriented, and maintainable. Josh works in data automation and lives
in St. Louis, Missouri, with his wife and two children.
Packt is searching for authors
like you
If you're interested in becoming an author for Packt, please visit autho
rs.packtpub.com and apply today. We have worked with thousands of

developers and tech professionals, just like you, to help them share
their insight with the global tech community. You can make a
general application, apply for a specific hot topic that we are
recruiting an author for, or submit your own idea.
Table of Contents
Title Page

Copyright and Credits

Python 3 Object-Oriented Programming Third Edition

Packt Upsell

Why subscribe?

Packt.com

Contributors

About the author

About the reviewers

Packt is searching for authors like you


Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Conventions used

Get in touch

Reviews

1. Object-Oriented Design

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

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 modules

Absolute imports

Relative imports

Organizing module content

Who can access my data?

Third-party libraries

Case study

Exercises

Summary

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

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

5. When to Use Object-Oriented Programming


Treat objects as objects

Adding behaviors 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

6. Python Data Structures


Empty objects

Tuples and named tuples


Named tuples

Dataclasses
Dictionaries

Dictionary use cases


Using defaultdict

Counter
Lists

Sorting lists
Sets

Extending built-in functions


Case study

Exercises
Summary
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
8. Strings and Serialization
Strings

String manipulation
String formatting
Escaping braces
f-strings can contain Python code

Making it look right


Custom formatters
The format method
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
Filesystem paths

Serializing objects
Customizing pickles
Serializing web objects

Case study
Exercises
Summary
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

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
Module variables can mimic singletons

The template pattern


A template example
Exercises
Summary

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
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 pytest
One way to do setup and cleanup
A completely different way to set up variables

Skipping tests with pytest


Imitating expensive objects
How much testing is enough?
Case study

Implementing it
Exercises
Summary
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

AsyncIO

AsyncIO in action
Reading an AsyncIO Future

AsyncIO for networking

Using executors to wrap blocking code


Streams

Executors
AsyncIO clients

Case study

Exercises
Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think


Preface
This book introduces the terminology of the object-oriented
paradigm. It focuses on object-oriented design with step-by-step
examples. It guides us from simple inheritance, one of the most
useful tools in the object-oriented programmer's toolbox, through
exception handling to design patterns, an object-oriented way of
looking at object-oriented concepts.

Along the way, we'll learn how to integrate the object-oriented and
the not-so-object-oriented aspects of the Python programming
language. We will learn the complexities of string and file
manipulation, emphasizing the difference between binary and textual
data.

We'll then cover the joys of unit testing, using not one, but two unit
testing frameworks. Finally, we'll explore, through Python's various
concurrency paradigms, how to make objects work well together at
the same time.

Each chapter includes relevant examples and a case study that


collects the chapter's contents into a working (if not complete)
program.
Who this book is for
This book specifically targets people who are new to object-oriented
programming. It assumes you have basic Python skills. You'll learn
object-oriented principles in depth. It is particularly useful for system
administrators who have used Python as a glue language and would
like to improve their programming skills.

Alternatively, if you are familiar with object-oriented programming in


other languages, then this book will help you understand the
idiomatic ways to apply your knowledge in the Python ecosystem.
What this book covers
This book is loosely divided into four major parts. In the first four
chapters, we will dive into the formal principles of object-oriented
programming and how Python leverages them. In Chapter 5, When to
Use Object-Oriented Programming, through Chapter 8, Strings and
Serialization, we will cover some of Python's idiosyncratic
applications of these principles by learning how they are applied to a
variety of Python's built-in functions. Chapter 9, The Iterator Pattern,
through Chapter 11, Python Design Patterns II, cover design patterns,
and the final two chapters discuss two bonus topics related to
Python programming that may be of interest.

, Object-Oriented Design, covers important object-oriented


Chapter 1

concepts. It deals mainly with terminology such as abstraction,


classes, encapsulation, and inheritance. We also briefly look at UML
to model our classes and objects.

, Objects in Python, discusses classes and objects as they are


Chapter 2

used in Python. We will learn about attributes and behaviors of


Python objects, and the organization of classes into packages and
modules. Lastly, we will see how to protect our data.

, When Objects Are Alike, gives us a more in-depth look into


Chapter 3

inheritance. It covers multiple inheritance and shows us how to


extend built-in. This chapter also covers how polymorphism and
duck typing work in Python.

, Expecting the Unexpected, looks into exceptions and


Chapter 4

exception handling. We will learn how to create our own exceptions


and how to use exceptions for program flow control.

, When to Use Object-Oriented Programming, deals with


Chapter 5

creating and using objects. We will see how to wrap data using
properties and restrict data access. This chapter also discusses the
DRY principle and how not to repeat code.

, Python Data Structures, covers the object-oriented features


Chapter 6

of Python's built-in classes. We'll cover tuples, dictionaries, lists, and


sets, as well as a few more advanced collections. We'll also see how
to extend these standard objects.

, Python Object-Oriented Shortcuts, as the name suggests,


Chapter 7

deals with time-savers in Python. We will look at many useful built-in


functions, such as method overloading using default arguments.
We'll also see that functions themselves are objects and how this is
useful.

, Strings and Serialization, looks at strings, files, and


Chapter 8

formatting. We'll discuss the difference between strings, bytes, and


byte arrays, as well as various ways to serialize textual, object, and
binary data to several canonical representations.

, The Iterator Pattern, introduces the concept of design


Chapter 9

patterns and covers Python's iconic implementation of the iterator


pattern. We'll learn about list, set, and dictionary comprehensions.
We'll also demystify generators and coroutines.

, Python Design Patterns I, covers several design patterns,


Chapter 10
including the decorator, observer, strategy, state, singleton, and
template patterns. Each pattern is discussed with suitable examples
and programs implemented in Python.

, Python Design Patterns II, wraps up our discussion of


Chapter 11

design patterns with coverage of the adapter, facade, flyweight,


command, abstract, and composite patterns. More examples of how
idiomatic Python code differs from canonical implementations are
provided.

, Testing Object-Oriented Programs, opens with why testing


Chapter 12

is so important in Python applications. It focuses on test-driven


development and introduces two different testing suites: unittest and
py.test. Finally, it discusses mocking test objects and code coverage.

, Concurrency, is a whirlwind tour of Python's support (and


Chapter 13

lack thereof) of concurrency patterns. It discusses threads,


multiprocessing, futures, and the modern AsyncIO library.
To get the most out of this
book
All the examples in this book rely on the Python 3 interpreter. Make
sure you are not using Python 2.7 or earlier. At the time of writing,
Python 3.7 was the latest release of Python. Many examples will
work on earlier revisions of Python 3, but you'll likely experience a
lot of frustration if you're using anything older than 3.5.

All of the examples should run on any operating system supported


by Python. If this is not the case, please report it as a bug.

Some of the examples need a working internet connection. You'll


probably want to have one of these for extracurricular research and
debugging anyway!

In addition, some of the examples in this book rely on third-party


libraries that do not ship with Python. They are introduced within the
book at the time they are used, so you do not need to install them in
advance.
Download the example code
files
You can download the example code files for this book from your
account at www.packt.com. If you purchased this book elsewhere, you
can visit www.packt.com/support and register to have the files emailed
directly to you.

You can download the code files by following these steps:

1. Log in or register at www.packt.com.


2. Select the SUPPORT tab.
3. Click on Code Downloads & Errata.
4. Enter the name of the book in the Search box and follow the
onscreen instructions.

Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:

WinRAR/7-Zip for Windows


Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://githu

. In case
b.com/PacktPublishing/Python-3-Object-Oriented-Programming-Third-Edition

there's an update to the code, it will be updated on the existing


GitHub repository.

We also have other code bundles from our rich catalog of books and
videos available at https://github.com/PacktPublishing/. Check them out!
Conventions used
There are a number of text conventions used throughout this book.

: Indicates code words in text, database table names, folder


CodeInText

names, filenames, file extensions, pathnames, dummy URLs, user


input, and Twitter handles. Here is an example: "Mount the
downloaded WebStorm-10*.dmg disk image file as another disk in your
system."

A block of code is set as follows:


class Point: def __init__(self, x=0, y=0): self.move(x, y)

When we wish to draw your attention to a particular part of a code


block, the relevant lines or items are set in bold:
import database
db = database.Database()
# Do queries on db

Any command-line input or output is written as follows:


>>> print(secret_string._SecretString__plain_string)
ACME: Top Secret

Bold: Indicates a new term, an important word, or words that you


see onscreen. For example, words in menus or dialog boxes appear
in the text like this. Here is an example: "Most object-oriented
programming languages have the concept of a constructor."
Warnings or important notes appear like this.

Tips and tricks appear like this.


Get in touch
Feedback from our readers is always welcome.

General feedback: Email feedback@packtpub.com and mention the book


title in the subject of your message. If you have questions about any
aspect of this book, please email us at questions@packtpub.com.

Errata: Although we have taken every care to ensure the accuracy


of our content, mistakes do happen. If you have found a mistake in
this book, we would be grateful if you would report this to us. Please
visit www.packt.com/submit-errata, selecting your book, clicking on the
Errata Submission Form link, and entering the details.

Piracy: If you come across any illegal copies of our works in any
form on the Internet, we would be grateful if you would provide us
with the location address or website name. Please contact us at
copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic


that you have expertise in and you are interested in either writing or
contributing to a book, please visit authors.packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why
not leave a review on the site that you purchased it from? Potential
readers can then see and use your unbiased opinion to make
purchase decisions, we at Packt can understand what you think
about our products, and our authors can see your feedback on their
book. Thank you!

For more information about Packt, please visit packt.com .


Another Random Scribd Document
with Unrelated Content
418
Even after the disasters of 1813 Napoleon wrote: “Holland is
a French country and will remain so for ever” (“Lettres
inédites,” 6th November 1813).
419
See Colenbrander, “De Patriottentijd,” i, 415, for the Prince’s
difficulty in forming (February 1784) a permanent force of
8,000 sailors subject to the Council of War and not to the
provincial Estates; also “A View of the Policy ... of the United
Provinces” (Dublin, 1787). As Grenville wrote to Pitt from The
Hague on 31st July 1787, that the Dutch understood their
Constitution very imperfectly (“Dropmore P.,” iii, 410), I may
be pardoned for not seeking to unravel it here.
420
“Malmesbury Diaries,” ii, 92–4, 222–4.
421
B.M. Add. MSS., 28060, Letter of 23rd August 1785. These
“private” letters are often more interesting and important than
those printed in the “Malmesbury Diaries,” which form but a
small portion of the whole.
422
B.M. Add. MSS., 28060.
423
B.M. Add. MSS., 28060.
424
Ibid.
425
See the conversation of Joseph II with Sir R. M. Keith at
Vienna in December 1785, on French designs on Egypt, as
given in chap. xxi, ad init.
426
Salomon, “Pitt,” 309, 310; also Martens, iv, 133–9, for the
treaty closing this dispute.
427
B.M. Add. MSS., 28060.
428
“Malmesbury Mems.,” ii, 113–21.
429
“Leeds Mem.” 111–13.
430
Wittichen, op. cit., 8, 25 et seq., and 173, 174; “Malmesbury
Mems.,” 131.
431
Ibid., 118.
432
Tomline, ii, 108; “Leeds Mem.,” 116.
433
Colenbrander, iii, 16, quoted by Wittichen, 173.
434
Joseph Ewart had been secretary to Sir John Stepney, then
was Secretary of the Berlin Embassy in 1785–7. In 1788–91
he was ambassador. For Anglo-Prussian relations and
Ewart’s work, see Dr. Luckwaldt’s excellent monograph, “Die
englisch-preussische Allianz von 1788,” 51 et seq. (Leipzig,
1902). By the kindness of General Sir Spencer Ewart, I was
able to transcribe several of the letters of his forefather,
Joseph Ewart. Some of them are published in an article in the
“Edinburgh Review” for July 1909.
435
Luckwaldt, 52, 53.
436
“Cornwallis Corresp.,” i, 202–11.
437
“Malmesbury Diaries,” i, 157.
438
I disagree with Herr Salomon (“Pitt”) on this point. It seems to
me that Pitt’s policy was essentially tentative, and remained
so up to the year 1788.
439
B.M. Add. MSS., 28060. George III showed more sagacity
than his Ministers, witness the phrase in his letter of 7th
August to Pitt: “An experience of twenty years has taught me
not to expect any return for the great assistance she
[Catharine] has received from this country.”
440
As late as 5th February 1786 he wrote to Harris: “We are on
more friendly terms with Russia than for a long time” (B.M.
Add. MSS., 28061).
441
I have published this Memorandum along with other
documents bearing on the years 1785–7 in the “Eng. Hist.
Rev.” for 1909.
442
Garden, “Traités,” v, 60–72.
443
“Malmesbury Diaries,” ii, 175.
444
On 7th March 1786 Harris reported to Carmarthen joint
actions of the Dutch and French in the East, and that eight
Dutch warships were to sail thither with troops on board.
(B.M. Add. MSS., 28061.) The possession of the Cape of
Good Hope by the Dutch rendered our communications with
India precarious.
445
“Dropmore P.,” i, 258.
446
“Pitt-Rutland Corresp.,” 111.
447
“Malmesbury Diaries,” ii, 172.
448
The Grand-Duke of Tuscany was a Hapsburg prince.
449
Pitt MSS., 332.
450
Dr. Cunningham, “Eng. Industry and Commerce” (pt. ii, 546).
451
B.M. Add. MSS., 28063. Eden to Carmarthen, 10th January
1788.
452
“F. O.,” France, 18.
453
Ibid.
454
“Wealth of Nations,” bk. iv, ch. iii.
455
“Politique de tous les Cabinets de l’Europe ...,” ii, 402–3. It
contains some “Mémoires” of Vergennes.
456
Fitzmaurice, “Shelburne,” iii, 260.
457
“Précis du Traité de Commerce de 1786,” by Count His de
Butenval (Paris, 1869), 25.
458
“Wealth of Nations,” bk iv, ch. iii.
459
Butenval, 23.
460
B.M. Add. MSS., 28060.
461
“F. O.,” France, 14, Dorset to Carmarthen, 31st March 1785.
See, too, L. Pingaud Choiseul-Gouffier, “La France en Orient
sous Louis XVI” (Paris, 1887).
462
Pitt MSS., 337.
463
Ibid., 333. Hailes to Fraser, 26th January 1786.
464
“Malmesbury Diaries,” ii, 112.
465
“Malmesbury Diaries,” ii, 157.
466
“F. O.,” France, 16.
467
Ibid. The British Parliament in 1716 abrogated these clauses
in favour of earlier and less liberal arrangements. Louis XIV
consented to this.
468
“F. O.,” France, 16. Hailes to Carmarthen, 4th August 1785.
469
Ibid., Hailes to Carmarthen, 1st December 1785. The
Chambers of Commerce at Paris, Versailles, and Montpellier
protested against the arrêts. See Butenval, op. cit., 36.
470
Pitt MSS., 110. Eden to Pitt, 12th October 1785. See, too,
“Carlisle Papers,” 644.
471
B.M. Add. MSS., 34420.
472
Butenval, 39
473
Carmarthen to Eden, 9th December 1785 (B.M. Add. MSS.,
34420).
474
Pitt MSS., 333.
475
Pitt to Eden, 4th December 1785, in “Auckland Journals,” i,
87.
476
Vergennes to Carmarthen, 14th December 1785, in Pitt MSS.,
333.
477
B.M. Add. MSS., 34420. Letter of John Lees, 1st April 1785.
478
“Auckland Journals,” i, 89; Wraxall, iv, 229.
479
J. Flammermont, “Correspondances des Agents
diplomatiques étrangers avant la Révolution,” 508.
480
“Auckland Journals,” i, 106.
481
Pitt MSS., 110. I quote fully only from those letters which have
not been published.
482
“Auckland Journals,” i, 112.
483
B.M. Add. MSS., 28061. Letter of 19th May 1786.
484
Ibid. Letter of 12th December 1786.
485
Ibid.
486
Pitt MSS., 333.
487
This letter of 6th June has no date of the year, and it has been
bound up in vol. 28064 of the Add. MSS. in the British
Museum for the year 1789 of the Auckland MSS. Internal
evidence shows that the year should be 1786.
488
Their memorial, dated 22nd February 1786, is from the
London silk trade (B.M. Add. MSS., 34420). It states that “no
alteration or modification whatsoever, short of the present
prohibition of all foreign wrought silks, can ensure the silk
trade to this country.”
489
Pitt MSS., 110.
490
“Pitt-Rutland Corresp.,” 158; “Beaufort Papers” (Hist. MSS.
Commission), 353.
491
Pitt MSS., 110. Eden to Pitt, 23rd August.
492
Ibid. Pitt to Eden, 12th September.
493
“F. O.,” France, 20. For further details see my article in the
“Eng. Hist. Rev.” for October 1908.
494
“Parl. Hist.,” xxvi, 233–54; “Auckland Corresp.,” i, 495–515;
Martens, “Traités,” iv, 155–80.
495
Pitt MSS., 169.
496
“F. O.,” France, 18.
497
“Auckland Journals,” i, 392, 6th October 1786.
498
“Dropmore P.,” i, 274.
499
“Auckland Journals,” i, 404.
500
“Auckland Journals,” i, 404; “Parl. Hist.,” xxvi, 342–78.
501
Ibid., 392, 394.
502
Ibid., 397, 398, 402, 424, 595. Mr. J. L. le B. Hammond in his
able work, “Charles James Fox” (1903), defends his hero on
the ground that monarchical France was the enemy of
England.
503
Pitt MSS., 110. Eden to Pitt, 13th April 1786.
504
“F. O.,” France, 18.
505
“F. O.,” France, 18. Hailes to Carmarthen, 25th October 1786.
The Duke of Dorset thought very little of Hailes, but Hailes’s
despatches show far more knowledge of France than the
Duke’s.
506
Flammermont, op. cit., 125.
507
See summaries of both in Butenval, op. cit., chs. xv, xvi.
508
Arthur Young’s “Travels in France” (Bohn edit., 1889), 8, 9, 69,
107, 284.
509
Levasseur, “Hist. des Classes ouvrières,” ii, 776.
510
This is the judgement of R. Stourm, “Les Finances de l’Ancien
Régime et de la Révolution,” 59.
511
“Cambridge Mod. Hist.,” viii, 74.
512
“Auckland Journals,” i, 127. Pitt to Eden, 10th June 1786.
513
Martens, “Traites,” iv, 196–223. For these negotiations with
Spain and Russia, see Salomon’s “Pitt,” 237–44. A little later
Pitt started commercial negotiations with Prussia and Holland,
but nothing came of them. It is clear, however, that he sought
to revise the whole of our commercial relations.
514
The contributions of the Provinces to the needs of the Union
show their respective resources. Out of every 100 florins of
federal revenue, Holland contributed 57¾, Friesland 11½,
Zealand 9, Groningen 5¾, Utrecht 5¾, Guelderland 5½,
Overyssel 3½, Drent 1.
515
For details see Luckwaldt, op. cit. On a similar plan, Harris
had written to Carmarthen on 3rd January 1786 that the idea
of France keeping the Stadholder in his position and England
then aiding him is so monstrous that Frederick “must think us
mere novices in politicks” (B.M. Add. MSS., 28061).
516
B.M. Add. MSS., 28061 and 28062. Dalrymple to Carmarthen,
20th October 1786, 23rd January 1787.
517
“F. O.,” Prussia, 11. So Luckwaldt, op. cit., 52–7.
518
B.M. Add. MSS., 28061. See, too, “Malmesbury Diaries,” ii,
212, for Carmarthen’s view. “I never desire a connexion with
Prussia unless Russia, and of course, Denmark, are
included.”
519
All the despatches of this time serve to refute the statement of
Lecky (v, 80) that the accession of Frederick William “greatly
changed the situation” for the Princess of Orange.
520
Wittichen, op. cit., 63–5.
521
“F. O.,” Prussia, 11. Dalrymple to Carmarthen, 21st April 1787.
522
B.M. Add. MSS, 28060.
523
“F. O.,” France, 18.
524
Pitt MSS., 110.
525
Bouillé, “Mems.,” ch. i.
526
Grenville during his mission to The Hague in August 1787 got
an inkling of the wider scheme described above, as appears
in his phrase “One’s mind at once runs to Trincomale.” So late
as August 1788 Pitt was nervous about the fate of that port.
See his letter to Grenville as to the rumour of 800 French
troops sailing thither (“Dropmore P.,” ii, 280, 353).
527
“Dropmore P.,” ii, 251–5.
528
Ibid., 267, 268; “Leeds Memoranda,” 117.
529
Pitt MSS., 151.
530
“Malmesbury Diaries,” ii, 299. “I am certain if we begin to roar,
France will shrink before us” (Harris to Carmarthen, 5th May).
See, too, Wittichen, 67.
531
“Malmesbury Diaries,” ii, 303–6.
532
“F. O.,” Holland, 14.
533
“F. O.,” Prussia, 11. Ewart to Carmarthen, 19th and 22nd May
1787.
534
“F. O.,” Holland, 14. Harris to Carmarthen, 1st June.
535
“Malmesbury Diaries,” ii, 322.
536
“Auckland Journals,” i, 521; Oscar Browning, “The Flight to
Varennes and other Essays,” 163.
537
“Malmesbury Diaries,” ii, 329.
538
“F. O.,” Prussia, 11. Ewart to Carmarthen, 6th June 1787.
Ewart was now chargé d’affaires at Berlin, Dalrymple having
gone home on furlough. He did not return, and Ewart became
ambassador in August 1788.
539
Ibid. Ewart’s note of 30th June.
540
“F. O.,” Holland, 15.
541
“F. O.,” Holland, 15; “F. O.,” Prussia, 11.
542
Luckwaldt, op. cit., 66, 67.
543
Wittichen (78, 79) holds that Frederick William’s hesitation
came from concern about the Fürstenbund or the hope that
France would join in a peaceful mediation in Holland.
544
Lusi’s report of 17th July 1787. Luckwaldt, op. cit., 68.
545
“F. O.,” Prussia, 11. Carmarthen to Ewart, 17th July. There is
nothing in this despatch which warrants the statement of the
editor of the “Malmesbury Diaries” (ii, 339 n.) that we then
offered Prussia armed support if France attacked her, and
promised to make a demonstration with forty ships of the line.
That was not proposed until the middle of September, in reply
to French threats.
546
“F. O.,” Austria, 14. Keith on 3rd August stated that the
Emperor was friendly to us, but he was the ally of France,
though he would not act with her in the Dutch Question.
547
“F. O.,” Prussia, 11. Carmarthen to Ewart, 27th July.
548
Wittichen, 81, shows that Wilhelmina herself worked hard to
dissuade her brother from a mediation conjointly with France.
549
“F. O.,” France, 25. Eden to Carmarthen, 4th August 1787.
550
Ibid., 8th August.
551
“F. O.,” France, 25.
552
“Auckland Journals,” i, 520. Lord Loughborough, in a letter of
13th October 1787 to Lord Carlisle stated that Grenville’s
mission was not due to distrust of Harris (“Carlisle P.,” 652).
But this seems to me very doubtful in view of the letters
between Pitt and Grenville.
553
“Dropmore P.,” iii, 408–15. For the missions of Grenville to
The Hague and Paris, see my article in the “Eng. Hist. Rev.”
for April 1909.
554
Pitt MSS., 102.
555
“F. O.,” France, 25. Eden to Carmarthen, 16th August 1787.
556
Ibid. Carmarthen to Eden, 24th August.
557
Pitt MSS., 102; and “Cornwallis Corresp.,” i, 333–7.
558
“Malmesbury Diaries,” ii, 371.
559
“Méms. du Comte de Portes,” (1904), 92.
560
“Auckland Journals,” i, 234, 259.
561
B.M. Add. MSS., 28061.
562
“Dropmore P.,” iii, 418.
563
“F. O.,” France, 25, 26. Eden to Carmarthen, 29th August and
11th September.
564
The feuds in his Ministry, and his consistently peaceful
attitude, seem to absolve him from the charge of duplicity.
French troops, disguised as Free Corps, were afterwards
captured in Holland and had on them orders and instructions
written by de Ségur, the French War Minister, who resigned in
August 1787 (“Auckland Journals,” i, 259). It seems probable
therefore that some Ministers egged on the French agents
and the Patriots, while Montmorin strove to hold them in
check. Louis XVI also used his influence to prevent a war with
Prussia, which he disliked (see Garden, “Traités,” v, 85 n.).
The appointment of Loménie de Brienne to a kind of
dictatorship seems also to have made for peace; it coincides
with the resolve, formed about 20th August (see Barral de
Montferrat, op. cit., 214), to recall Vérac from The Hague; and
on 31st August Montmorin signed with Eden a convention for
ending irritating disputes in East Indian affairs. I have no
space to go into that question; but it had been reported (e.g.,
by Eden on 9th November 1786, Pitt MSS., 110) that the
French were about to gain control over Dutch East India
ports. Rumours to that effect had embittered the contest in
Holland, and they were laid to rest by that convention.
565
See the MSS. of P. V. Smith in the “Beaufort P.” (Hist. MSS.
Commission) 357, for the parts of Pitt’s letter of 8th
September, omitted, very strangely, by the editor of the
“Auckland Journals” (i, 191–2), also ibid., i, 198.
566
Luckwaldt, 71.
567
“F. O.,” Holland, 17.
568
“F. O.,” Prussia, 11. Carmarthen to Ewart, 24th August.
569
Luckwaldt, 80 n., here corrects one of many mis-statements
in P. de Witt’s “Une Invasion prussienne en Hollande,” 285,
that the Prussians were ready to march by 20th July.
570
Hertzberg, “Recueil des Traités,” ii, 428–30; “F. O.,” Prussia,
12. Ewart to Carmarthen, 4th and 8th September.
571
Ibid. 8th September.
572
“The prevailing opinion of this Court is the Emperor will ...
sacrifice his alliance with Russia to that of 1756 [with France]”
(Ewart to Keith, 11th September 1787. B.M. Add. MSS.,
35539).
573
Wittichen, 92–4; also ibid., 97, for the Anglo-Prussian
Convention of 2nd October.
574
“Auckland Journals,” i, 192.
575
Ibid., 195.
576
“F. O.,” France, 26. Eden to Carmarthen, 11th and 13th
September.
577
The original, in Pitt’s handwriting, is in “F. O.,” Russia, 15,
dated 21st September, and inscribed “To all the King’s
Ministers abroad except Paris and The Hague.”
578
“Dropmore P.,” iii, 426–36; E. D. Adams, op. cit., 6, 7;
“Buckingham P.,” i, 326–31.
579
Ibid. Eden to Carmarthen, 20th September.
580
“Dropmore P.,” iii, 435; “Méms. de Dedem de Gelder,” 7.
581
Ibid., iii, 435.
582
“F. O.,” Holland, 19. Carmarthen to Harris, 12th October;
“Auckland Journals,” i, 234.
583
B.M. Add. MSS., 29475.
584
“F. O.,” Austria, 14. Keith to Carmarthen, 24th October 1787.
On 14th November Joseph II informed Keith that he
thoroughly approved of the Dutch settlement.
585
“Auckland Journals,” i, 217, 221.
586
Ibid., 227, 228.
587
Ibid., 255–8; “Ann. Reg.” (1787), 283.
588
“Auckland Journals,” i, 264.
589
Ibid., 263.
590
B.M. Add. MSS., 28063. Harris to Pitt, 22nd February 1788.
591
Martens, iv, 372–7; Garden, v, 89–92.
592
“F. O.,” Prussia, 12. Ewart to Carmarthen, 27th September
1787.
593
Pitt MSS., 119.
594
Pitt MSS., 119. Carmarthen to Ewart, 2nd December 1787.
Fraser, our envoy at St. Petersburg, reported on 1st
November that Austria was proposing there a Triple Alliance,
but it was coolly received (“F. O.,” Russia, 15).
595
Ibid. Carmarthen to Ewart, 26th December.
596
See Ewart’s masterly Memorandum in “Dropmore P.,” ii, 44–9.
597
Luckwaldt, 100 et seq. Ewart found out the secret instructions
issued to Dietz, and forwarded them to London on 8th April.
They show that Prussia sought by all means to encourage the
Turks, but laid her plans so as to get an indemnity in land in
case Austria gained land in the south-east.
598
“F. O.,” Prussia, 13. Ewart to Carmarthen, 15th March 1788.
599
Ibid. Ewart to Carmarthen, 15th January 1788. Lecky (v, 232)
assigns the first rumours of Prussian indemnities in land to
January 1789; but Ewart reported the beginnings of
Hertzberg’s plan in January 1788.
600
Ibid. Carmarthen to Ewart, 2nd April.
601
See his letter of 24th November 1787 to Dietz at
Constantinople in Häusser, “Deutsche Geschichte,” i, 225–6.
602
“F. O.,” Prussia, 13. Carmarthen to Ewart, 14th May 1788.
603
Ibid. Ewart to Carmarthen, 27th and 31st May 1788;
Wittichen, ch. xx.
604
B.M. Add. MSS., 28063.
605
“Malmesbury Diaries,” ii, 421.
606
The secret articles are in Ranke’s “Fürstenbund,” ii, 358; for
the published treaties of 13th June and 13th August see
Martens, iv, 382–5, 390–3; for the negotiations, Luckwaldt,
114–16, Salomon, “Pitt,” 344–51. The accounts of these
important events given by Tomline, Stanhope, and Lecky are
brief and unsatisfactory.
607
So Wittichen, 148.
608
“Records of Stirring Times,” 58, by the authoress of “Old Days
in Diplomacy.”
609
Certain letters of the Earl of Liverpool recently sold in London
show that there was an open breach between King and
Queen in 1804, and that Pitt helped to patch it up.
610
Huish, “Mems. of George IV,” i, 60–2.
611
H. Walpole’s “Last Journals,” ii, 480–1.
612
Fox does not seem to have introduced the prince into bad
company. See Jesse, ii, 367–9, and Huish, i, 122–4.
613
“Malmesbury Diaries,” ii, 125.
614
Pitt MSS., 228.
615
“Malmesbury Diaries,” ii, 129–31.
616
Pitt MSS., 105.
617
W. H. Wilkins, “Mrs. Fitzherbert and George IV,” i, 81–105.
618
Ibid., i, 135–7; Langdale, “Mems. of Mrs. Fitzherbert,” 127–8,
141, 142; Jesse, ii, 512, 513.
619
Pitt MSS., 122. Sir Carnaby is Sir Carnaby Haggerston, who
married Frances, the youngest sister of Mrs. Fitzherbert (née
Smythe). Her mother was a daughter of John Errington of the
Northumberland family of that name. His brother was the
confidante of the Prince, as described above.
620
W. H. Wilkins, op. cit., i, 97.
621
Wraxall, iv, 306.
622
“Parl. Hist.,” xxv, 1348–56; Wraxall, iv, 304–6.
623
Pitt MSS., 103. For other references see the King’s letters to
Pitt in “Pitt and Napoleon Miscellanies.”
624
The King altered this to “written message.”
625
Pitt MSS., 105.
626
W. H. Wilkins, op. cit., i, 161.
627
This letter refutes the statement of Huish (op. cit., i, 169) that
Pitt was as pertinacious as the King in refusing to help the
Prince.
628
“Dropmore P.,” i, 362.
629
Major-General Smith, M.P., was twice unseated for bribery.
His nickname was “Hyder Ali.”
630
“Cornwallis Corresp.,” i, 374, 375. Payne was a confidential
friend of the Prince, who made him Comptroller of his
Household and Lord Warden of the Stanneries in Cornwall.
631
“Buckingham P.” i, 363, 364.
In the Pitt MSS., 228, is a Memorandum, endorsed
January 1794, entitled “Heads of a Plan for a new
Arrangement of the Prince of Wales’s Affairs.” It states that
his debts then amounted to £412,511 5s. 8d. he owed
£60,000 to Mr. Coutts the banker (Pitt’s banker); and he might
at any time be called on to pay as much as £170,000. It would
be difficult to induce Parliament to pay any part of these
debts. Moreover, such a demand “would afford a fresh topic
of declamation to those who already use the expenses of
Royalty as an engine to operate upon weak minds in order to
effectuate their ultimate purpose, the overthrow of everything
dignified, everything sacred, everything valuable and
respectable in social life.” The anonymous compiler therefore
suggests the raising of a loan at 3½ per cent., so as to cover
the “urgent” debts amounting to £349,511. Creditors would
probably consent to the “defalcation” of 20 per cent. from
what was owed them and be content with 3½ per cent.
interest on the remainder.
A Mr. W. Fitzwilliam, of 45, Sloane Street, in May 1795
suggested a lottery for raising £2,100,000, of which £650,000
should go to the discharge of the Prince’s debts, £1,000,000
to the archbishops for the forming of a fund for raising the
stipend of every clergyman to £100 a year; £100,000 to be
reserved as prizes in the lottery; and £50,000 to be set apart
for expenses.
632
“Buckingham P.,” i, 361; Wraxall, iv, 458; v, 77–9.
633
“Dropmore P.,” i, 353. Grenville replied on 1st September that
he thought the frequent changes in France would undermine
her power and so check “that sort of intrigue and restlessness
which keeps us in hot water even while we are most confident
of the impossibility of any serious effect from their schemes.”
He then suggests an agreement as to the forces to be kept by
the two Powers in the East (Pitt MSS., 140).
634
G. Rose, “Diaries,” i, 86. The date of this interview is probably
between 10th and 24th October 1788.
635
“Fanny Burney’s Diary,” iv, 122. In a rare pamphlet, “A History
of the Royal Malady,” by a Page of the Presence (1789), it is
stated that the King, while driving in Windsor Park, alighted
and shook hands with a branch of an oak tree, asserting it to
be the King of Prussia, and was with difficulty persuaded to
remount.
636
“Court and Private Life in the Time of Queen Charlotte,” by
Mrs. Papendiek. 2 vols. (1887); vol. ii, ad init.
637
“Buckingham P.,” i, 342.
638
G. Rose, “Diaries,” i, 87.
639
T. Moore, “Life of Sheridan,” ii, 27, where Payne also
suggests that Sheridan should question Pitt about the public
amusements, as it would embarrass him “either way.”
640
W. Sichel, “Sheridan,” ii, 400.
641
T. Moore, “Life of Sheridan,” ii, 31–5; Campbell, “Lives of the
Lord Chancellors,” vii, 248, 239 (edit. of 1857).
642
T. Moore, op. cit., p. 29.
643
Campbell, op. cit., p. 251, who had the story from Thomas
Grenville. See, too, Wilberforce, i, 386, 387.
644
Dr. W. Hunt, “Political Hist. of England,” x, 64–5.
645
This letter fixes the date of Pitt’s letter to Grenville, headed
merely “Tuesday morning,” in “Dropmore P.” (i, 361). Pitt
quotes the phrase “perfectly maniacal,” and adds “I begin to
fear the physicians have been more in the right than we
thought.”
646
Pretyman MSS.
647
Chevening MSS.
648
“Buckingham P.,” ii, 9.
649
G. Rose, “Diaries,” i, 87.
650
G. Rose, “Diaries,” i, 90.
651
Ibid., 94; “Buckingham P.,” i, 446; “Quarterly Rev.,” cv, 490.
652
“Bland Burges Papers,” 118.
653
See his private reports to Pitt in “Pitt and Napoleon
Miscellanies.”
654
“Parl. Hist.,” xxvii, 697, gives the period as three months;
“Buckingham P.,” ii, 47, gives it (erroneously, I think) as five
months.
655
Wraxall, v, 243.
656
May, “Constitutional Hist.,” i, 148.
657
“Parl. Hist.,” xxvii, 709.
658
“Buckingham P.,” ii, 71.
659
Sichel, “Sheridan,” ii, 415.
660
So thought the Duchess of Devonshire’s friends. Sichel,
“Sheridan,” ii, 416.
661
T. Moore, “Life of Sheridan,” ii, 42, 43; “Parl. Hist.,” xxvii, 730,
731.
662
Lecky, v, 148.
663
“Parl. Hist.,” xxvii, 705–13.
664
Tomline, “Life of Pitt,” ii, 388–92. There is a copy of this in the
Pretyman archives at Orwell Park.
665
“Parl. Hist.,” xxvii, 732–47. The date is given wrongly as 1st
December; it should be 16th December. So, too, on p. 778,
are the numbers in the division, which should be: for
Government, 268, Opposition, 204.
666
Ibid., 678.
667
“Parl. Hist.,” xxvii, 680. That Thurlow or his friends expected
his dismissal, even late in the year 1789, appears from a
letter of Pitt to George Rose contradicting a rumour to that
effect (G. Rose, “Diaries,” i, 98, 99).
668
W. Sichel, “Sheridan,” ii, 421–3. I cannot agree with Mr. Sichel
(ibid., ii, 192) that the letter was Sheridan’s. The Duchess’s
diary shows it to have been a joint production. For the so-
called Prince’s letter see “Parl. Hist.,” xxvii, 909–912, or “Ann.
Reg.” (1789), 298–302. For Pitt’s reply see Stanhope, ii, 18–
20.
669
“Parl. Hist.,” xxvii, 946–7. Able speeches on the Government
side were made by the Speaker (Grenville) and the Solicitor-
General, Sir John Scott, the future Lord Eldon. See Twiss,
“Life of Lord Eldon,” i, ch. ix.
670
See May, “Constitutional Hist.,” i, 155, 156, for the arguments
for and against this proposal.
671
For the intrigues and corruption at Dublin see “Dropmore P.,”
i, 385, 389, 395, et seq. The majority at Dublin dwindled away
as soon as the King’s recovery was known (ibid., i, 417–25), a
fact which damages Lecky’s case.
672
“Bland Burges P.,” 116, 117; Wraxall, v, 242, 243.
673
B.M. Add. MSS., 28064.
674
“Reflections on the Formation of a Regency” (Debrett, 1788),
17.
675
“Thoughts on the present Proceedings of the House of
Commons” (Debrett, 1788), 18.
676
“Answer to the Considerations on ... a Regency” (Debrett,
1788), 21.
677
“A short View of the present Great Question” (Debrett, 1788),
11–15.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like