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

Dead Simple Python Idiomatic Python for the Impatient Programmers 1st Edition Jason C Mcdonald pdf download

The document provides information about the book 'Dead Simple Python: Idiomatic Python for the Impatient Programmers' by Jason C. McDonald, including links for downloading the book and related resources. It outlines the book's structure, covering various Python programming concepts and best practices. Additionally, it lists other recommended books and resources available for download.

Uploaded by

meshewalex
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
25 views

Dead Simple Python Idiomatic Python for the Impatient Programmers 1st Edition Jason C Mcdonald pdf download

The document provides information about the book 'Dead Simple Python: Idiomatic Python for the Impatient Programmers' by Jason C. McDonald, including links for downloading the book and related resources. It outlines the book's structure, covering various Python programming concepts and best practices. Additionally, it lists other recommended books and resources available for download.

Uploaded by

meshewalex
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 42

Dead Simple Python Idiomatic Python for the

Impatient Programmers 1st Edition Jason C


Mcdonald pdf download

https://ebookmeta.com/product/dead-simple-python-idiomatic-
python-for-the-impatient-programmers-1st-edition-jason-c-
mcdonald-2/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Dead Simple Python Idiomatic Python for the Impatient


Programmers 1st Edition Jason C Mcdonald

https://ebookmeta.com/product/dead-simple-python-idiomatic-
python-for-the-impatient-programmers-1st-edition-jason-c-
mcdonald-2/

Python for Programmers 1st Edition Oswald Campesato

https://ebookmeta.com/product/python-for-programmers-1st-edition-
oswald-campesato/

C++ Software Interoperability for Windows Programmers:


Connecting to C#, R, and Python Clients Gladstone

https://ebookmeta.com/product/c-software-interoperability-for-
windows-programmers-connecting-to-c-r-and-python-clients-
gladstone/

The Beginning The Life 1 1st Edition Jordan Silver

https://ebookmeta.com/product/the-beginning-the-life-1-1st-
edition-jordan-silver/
Software Testing Foundations A Study Guide for the
Certified Tester Exam Andreas Spillner

https://ebookmeta.com/product/software-testing-foundations-a-
study-guide-for-the-certified-tester-exam-andreas-spillner/

Moon Anchorage, Denali & the Kenai Peninsula: National


Parks Road Trips, Outdoor Adventures, Wildlife
Excursions 4th Edition Don Pitcher

https://ebookmeta.com/product/moon-anchorage-denali-the-kenai-
peninsula-national-parks-road-trips-outdoor-adventures-wildlife-
excursions-4th-edition-don-pitcher/

The Global Educational Policy Environment in the Fourth


Industrial Revolution Gated Regulated and Governed 1st
Edition Tavis D. Jules

https://ebookmeta.com/product/the-global-educational-policy-
environment-in-the-fourth-industrial-revolution-gated-regulated-
and-governed-1st-edition-tavis-d-jules/

A Song of Salvation 1st Edition Alechia Dow

https://ebookmeta.com/product/a-song-of-salvation-1st-edition-
alechia-dow/

A Companion to the Global Renaissance English


Literature and Culture in the Era of Expansion Second
Edition Jyotsna G. Singh

https://ebookmeta.com/product/a-companion-to-the-global-
renaissance-english-literature-and-culture-in-the-era-of-
expansion-second-edition-jyotsna-g-singh/
NFPA 37 : Standard for the Installation and Use of
Stationary Combustion Engines and Gas Turbines 2021
National Fire Protection Association

https://ebookmeta.com/product/nfpa-37-standard-for-the-
installation-and-use-of-stationary-combustion-engines-and-gas-
turbines-2021-national-fire-protection-association/
CONTENTS IN DETAIL

TITLE PAGE

COPYRIGHT

DEDICATION

ABOUT THE AUTHOR

FOREWORD

ACKNOWLEDGMENTS

INTRODUCTION
Who Is This Book For?
What Does “Simple” Mean?
What’s in This Book?
What’s NOT in This Book
How to Read This Book
About the Vocabulary
Theory Recaps
Objective or Opinionated?
The Examples
What About a Project?
Prerequisites
PART I: THE PYTHON ENVIRONMENT
CHAPTER 1: THE PYTHON PHILOSOPHY
What Is Python, Exactly?
Myths: What Python Isn’t
Myth #1: Python Is Merely a Scripting Language
Myth #2: Python Is Slow
Myth #3: Python Cannot Be Compiled
Myth #4: Python Gets Compiled Behind the Scenes
Myth #5: Python Is Unsuitable for Large Projects
Python 2 vs. Python 3
Defining “Pythonic” Code
The Zen of Python
Documentation, PEPs, and You
Who Calls the Shots?
The Python Community
The Pursuit of the One Obvious Way
Wrapping Up

CHAPTER 2: YOUR WORKBENCH


Installing Python
Installing on Windows
Installing on macOS
Installing on Linux
Installing from Source
Meet the Interpreter
Interactive Session
Running Python Files
Packages and Virtual Environments
Creating a Virtual Environment
Activating a Virtual Environment
Leaving a Virtual Environment
Introducing pip
System-Wide Packages
Installing Packages
requirements.txt
Upgrading Packages
Removing Packages
Finding Packages
One Warning About pip . . .
Virtual Environments and Git
The Whole Shebang
File Encoding
A Few Extra Virtual Environment Tricks
Using a Virtual Environment Without Activating
The Alternatives
The Line Limit Debate
Tabs or Spaces?
Quality Control: Static Analyzers
Pylint
Flake8
Mypy
Style Janitors: Autoformatting Tools
autopep8
Black
Testing Frameworks
An Exhibition of Code Editors
IDLE
Emacs and Vim
PyCharm
Visual Studio Code
Sublime Text
Spyder
Eclipse + PyDev/LiClipse
The Eric Python IDE
Wrapping Up

CHAPTER 3: SYNTAX CRASH COURSE


Hello, World!
Statements and Expression
The Importance of Whitespace
Doing Nothing
Comments and Docstrings
Docstrings
Declaring Variables
What About Constants?
Mathematics
Meet the Number Types
Operators
The math Module
Logic
Conditionals
Comparison Operators
Boolean, None, and Identity Operators
Truthiness
Logical Operators
The Walrus Operator
Ellipsis
Strings
String Literals
Raw Strings
Formatted Strings
Template Strings
String Conversion
A Note on String Concatenation
Functions
Classes and Objects
Error Handling
Tuples and Lists
Loops
while Loop
Loop Control
for Loop
Structural Pattern Matching
Literal Patterns and Wildcards
Or Patterns
Capture Patterns
Guard Statements
More About Structural Pattern Matching
Wrapping Up
CHAPTER 4: PROJECT STRUCTURE AND IMPORTS
Setting Up the Repository
Modules and Packages
PEP 8 and Naming
Project Directory Structure
How import Works
Import Dos and Don’ts
Importing Functions from Modules
The Problem of Shadowing
The Trouble with Nested Packages
Beware of Importing All
Importing Within Your Project
Absolute Imports
Relative Imports
Importing from the Same Package
Entry Points
Module Entry Points
Package Entry Points
Controlling Package Imports
Program Entry Points
The Python Module Search Path
What Really Happens
Wrapping Up

PART II: ESSENTIAL STRUCTURES


CHAPTER 5: VARIABLES AND TYPES
Variables According to Python: Names and Values
Assignment
Data Types
The type() Function
Duck Typing
Scope and Garbage Collection
Local Scope and the Reference-Counting Garbage Collector
Interpreter Shutdown
Global Scope
The Dangers of Global Scope
The nonlocal Keyword
Scope Resolution
The Curious Case of the Class
Generational Garbage Collector
The Immutable Truth
Passing by Assignment
Collections and References
Shallow Copy
Deep Copy
Coercion and Conversion
A Note About Systems Hungarian Notation
Terminology Review
Wrapping Up

CHAPTER 6: FUNCTIONS AND LAMBDAS


Python Function Essentials
Recursion
Default Argument Values
Keyword Arguments
On Overloaded Functions
Variadic Arguments
Keyword Variadic Arguments
Keyword-Only Parameters
Positional-Only Parameters
Argument Types: All Together Now!
Nested Functions
Closures
Recursion with Closures
Stateful Closures
Lambdas
Why Lambdas Are Useful
Lambdas as Sorting Keys
Decorators
Type Hints and Function Annotations
Duck Typing and Type Hints
Should You Use Type Hinting?
Wrapping Up

CHAPTER 7: OBJECTS AND CLASSES


Declaring a Class
The Initializer
The Constructor
The Finalizer
Attributes
Instance Attributes
Class Attributes
Scope-Naming Conventions
Nonpublic
Public
Name Mangling
Public, Nonpublic, or Name Mangled?
Methods
Instance Methods
Class Methods
Static Methods
Properties
Setting Up the Scenario
Defining a Property
Property with Decorators
When Not to Use Properties
Special Methods
Scenario Setup
Conversion Methods
Comparison Methods
Binary Operator Support
Unary Operator Support
Making Callable
More Special Methods: Looking Ahead
Class Decorators
Structural Pattern Matching with Objects
Functional Meets Object Oriented
When to Use Classes
Classes Aren’t Modules
Single Responsibility
Sharing State
Are Objects Right for You?
Wrapping Up

CHAPTER 8: ERRORS AND EXCEPTIONS


Exceptions in Python
Reading Tracebacks
Catching Exceptions: LBYL vs. EAFP
Multiple Exceptions
Beware the Diaper Anti-pattern
Raising Exceptions
Using Exceptions
Exceptions and Logging
Bubbling Up
Exception Chaining
Else and Finally
Else: “If All Goes Well”
Finally: “After Everything”
Creating Exceptions
A Gallery of Exceptions
Wrapping Up

PART III: DATA AND FLOW


CHAPTER 9: COLLECTIONS AND ITERATION
Loops
while Loops
for Loops
Collections
Tuples
Named Tuples
Lists
Deques
Sets
frozenset
Dictionaries
Check or Except?
Dictionary Variants
Unpacking Collections
Starred Expressions
Unpacking Dictionaries
Structural Pattern Matching on Collections
Accessing by Index or Key
Slice Notation
Start and Stop
Negative Indices
Steps
Copy with Slice
Slice Objects
Slicing on Custom Objects
Using islice
The in Operator
Checking Collection Length
Iteration
Iterables and Iterators
Manually Using Iterators
Iterating with for Loops
Sorting Collections in Loops
Enumerating Loops
Mutation in Loops
Loop Nesting and Alternatives
Iteration Tools
Basic Built-in Tools
Filter
Map
Zip
Itertools
Custom Iterable Classes
Wrapping Up

CHAPTER 10: GENERATORS AND COMPREHENSIONS


Lazy Evaluation and Eager Iterables
Infinite Iterators
Generators
Generators vs. Iterator Classes
Closing Generators
Behavior on Close
Throwing Exceptions
yield from
Generator Expressions
Generator Objects Are Lazy
Generator Expressions with Multiple Loops
Conditionals in Generator Expressions
Nested Generator Expressions
List Comprehensions
Set Comprehensions
Dictionary Comprehensions
Hazards of Generator Expressions
They Quickly Become Unreadable
They Don’t Replace Loops
They Can Be Hard to Debug
When to Use Generator Expressions
Simple Coroutines
Returning Values from a Coroutine
Sequence of Behavior
What About Async?
Wrapping Up

CHAPTER 11: TEXT IO AND CONTEXT MANAGERS


Standard Input and Output
Revisiting print()
Revisiting input()
Streams
Context Manager Basics
File Modes
Reading Files
The read() Method
The readline() Method
The readlines() Method
Reading with Iteration
Stream Position
Writing Files
The write() Method
The writelines() Method
Writing Files with print()
Line Separators
Context Manager Details
How Context Managers Work
Using Multiple Context Managers
Implementing the Context Management Protocol
The __enter__() Method
The __exit__() Method
Using the Custom Class
Paths
Path Objects
Parts of a Path
Creating a Path
Relative Paths
Paths Relative to Package
Path Operations
Out-of-Place File Writes
The os Module
File Formats
JSON
Other Formats
Wrapping Up

CHAPTER 12: BINARY AND SERIALIZATION


Another Random Scribd Document
with Unrelated Content
PRINCE CHARLES'S FAREWELL OF THE INFANTA. (See p. 496.)
Buckingham was impatient to be in England, from news which he
had received that certain courtiers were busily at work in
endeavouring to undermine his credit with the king. Behind him he
left nothing but detestation, which Olivarez, the chief minister, took
no pains to conceal. When the prince and he set out they were
attended by the king himself, and a brilliant assemblage of the
nobles, who added to the prince's presents a number of fine
Andalusian horses and mules. They halted for several days at the
Escurial, where they were splendidly entertained, and then the king
rode on with them as far as Campillo. The parting of the affianced
brothers-in-law was of the most affectionate kind, and the king
ordered a column to be erected on the spot, as a lasting monument
of it. So Charles rode on, attended by several nobles and entertained
most honourably at their castles. He visited the cell of a celebrated
nun at Carrion, who was held to be a saint, and to whom Donna
Maria had given him a letter.
Arrived at the port where the English fleet was waiting for him, he
no sooner stepped on board than he laughed at the credulity of the
Spaniards, called them fools, and wondered at his easy escape from
them. They landed at Portsmouth on the 5th of October, and there
and all the way to and through London their reception was one piece
of exultation at the safe return of the prince from the clutches of the
dreaded Spaniards. The country resounded with the ringing of bells,
the firing of cannon, the whizzing of fireworks, and the shouts of the
people. The clergy, without waiting for royal orders, put up
thanksgiving in the churches for the prince's happy arrival.
Meanwhile, the prince's perfidy was awaking the Spaniards from a
trance of astonishment to a tempest of rage. From Segovia, he had
sent back Clerk, a creature of Buckingham's, to the Earl of Bristol.
Calculating that the Papal dispensation would by that time have
arrived, Clerk was to hand to Bristol an order from the prince not to
present the proxies left in his hands—which were to be given up
immediately after the delivery of the dispensation—till he received
further orders from home. The reason alleged by Charles was that
he feared on the marriage by proxy the Infanta would retire into a
convent. The idea was so absurd that Bristol saw at once that it was
a mere pretence to break off the match. As his honour as well as the
honour of the nation was implicated, he at once hastened to the
king and laid the doubts of the prince before him. The astonishment
of the king may be conceived. He had fixed the 29th of November
for the espousals, the 29th of December for the marriage: orders for
public rejoicings were already issued, a platform covered with
tapestry was erected from the palace to the church, and the nobility
had been summoned to attend. He gave Bristol every assurance that
the princess should be delivered to the English without delay, and
Bristol despatched these assurances in all haste to James.
Meanwhile, the Countess Olivarez communicated privately to the
Infanta the prince's message, at which she laughed heartily, saying
that she never, in all her life, had a mind to be a nun, and thought
she should hardly turn one now merely to avoid the Prince of Wales.
Only four days before the one appointed for the espousals, three
couriers on the heels of each other arrived from England, bearing
from James the message that he was perfectly willing for the
marriage to proceed, on condition that the King of Spain pledged
himself, under his own hand, to take up arms for the restoration of
the Palatine and to fix the day for hostilities to commence. At an
early period of the negotiation, Philip had declared that on the
completion of the agreement for the marriage, he would give James
a carte blanche regarding the affairs of the Elector Palatine, and
whatever terms James required, he pledged himself to accede to.
Now he repeated that although he could not in honour proclaim war
against his nephew the Emperor—being engaged as mediator
between him and the Palsgrave, at the instance of James—yet he
would pledge himself in writing never to cease, by intercession or by
warfare, till he had restored the Palatine to his hereditary dominion.
Bristol and his fellow ambassador thought this assurance amply
satisfactory; they sent off a messenger in hot haste, bearing their
assurances that all possible difficulty was removed; and they went
on putting their households into velvet and silver lace, to do honour
to the marriage ceremony, as if it were really to take place. Bristol
wrote more earnestly to the king, reminding him that the honour of
king, prince, and ambassadors was most solemnly pledged; that the
matters of the Palsgrave had been treated of separately, and that his
majesty had always represented to Bristol himself that he regarded
the marriage as a certain pledge of the Palatine's restoration. He
added that the prince and my lord duke had also acted entirely on
that opinion during their stay there. Charles and Buckingham, in
fact, seem to have taken very little trouble about the ex-King and
Queen of Bohemia.
But all was in vain; the prince had determined not to complete the
marriage. It was believed that the view which he had had of the
Princess Henrietta at Paris had, even before his reaching Spain,
changed his intentions; and a courier brought from James an order
for Bristol not to deliver the proxy till Christmas, "because that holy
and joyful time was best fitting so notable and blessed an action as
the marriage." When we add that the proxy was well known to the
king and prince to expire before Christmas, we can duly estimate
this awful language of hypocrisy. The King of Spain saw at once that
he had been imposed upon; he gave instant orders to stop the
preparations for the marriage, for the Infanta to drop the title of
Princess of England, which she is said to have done with tears, and
to return to her usual state. The fury of indignation against the
English in Spain may readily be conceived.
The Earl of Bristol had acted too much the part of a faithful and
honourable servant of the Crown to escape the censure of such a
Court, and the vengeance of such a man as Buckingham. He had not
hesitated, in spite of the remonstrances of the prince, to represent
to James, during their sojourn in Madrid, the disgraceful conduct of
that despicable libertine. James had the folly or the wickedness to
show to the favourite these letters, and Bristol received his recall.
The ambassador wrote to James requesting a remittance sufficient
to bear him home, having pledged all his lady's jewels, and incurred
a debt of fifty thousand crowns for Prince Charles, so that he had
not funds even for his journey.
It does not appear that James or Charles took any notice of this
most reasonable appeal; but Philip not only exonerated Bristol from
any share in the disgraceful proceedings, but warned him of the
danger which threatened him at home, and offered to make him one
of the most distinguished men of his own realm, if he would take up
his abode in Spain. Bristol, however, declined the noble offer, saying
that he would rather lose his head in England, conscious as he was
of innocence, than live a duke or Infantado in Spain with the
imputation of treason, which was sure in such a case to be cast on
him. Though he was ordered to quit Spain without delay, he was
instructed to travel slowly, and on his landing he was commanded to
retire to his house in the country, and consider himself a prisoner.
The malicious Buckingham did his best to have him committed to the
Tower, but the Duke of Richmond and the Earl of Pembroke opposed
this injustice with effect.
James had got his baby Charles and his dog Steenie home again,
but he soon found that they had involved him in troubles and debts,
which very much abated the pleasure of their company. They had
brought home neither wife nor her much desired money; on the
contrary, they had spent his last shilling, increased his debts, thrown
away the greater part of his jewels, had left the cause of his
daughter and son-in-law in a worse position than before, and now
were vehement to engage him in a war with Spain. Under the
gloomy oppression of these embarrassments, he lost even his
appetite for hunting and hawking, shut himself up alone at
Newmarket, and wrote to the Palatine, recommending him to make
his submission to the Emperor; to offer his eldest son, who was to
be educated in England, to him for his daughter; to accept the
administration of his hereditary territory, and to allow the Duke of
Bavaria the title of Elector for life. Under the advice of Charles and
Buckingham the Palsgrave positively declined any such arrangement.
The only resource now was to call a Parliament, but this was a step
which had rarely brought him satisfaction. Before doing this he took
the opinion of the Privy Council during the Christmas holidays on
these points:—Whether the King of Spain had acted sincerely in the
negotiations for the marriage? and whether he had given sufficient
provocation to call for war? The Council unanimously supported the
idea of the King of Spain's sincere dealing, and a majority declared
that there was no just cause for war.
This result, so hostile to the wishes of Buckingham, filled him with
chagrin, and his wrath fell with especial weight on Williams the Lord
Keeper, and Cranfield the Treasurer. These men had been his most
servile creatures; they were, in fact, altogether his creatures; but
during his absence they had seen such evidence of displeasure in
the king towards him, that they imagined his power was about at an
end and they were emboldened to oppose him. But his fierce
displeasure and the symptoms of even growing popularity which
showed themselves round him, terrified them and they made the
most humble submission.
On the 2nd of February, 1624, Williams wrote a most abject letter to
Buckingham, begging him to forgive his past conduct, "to receive his
soul in gage and pawn:" they were reconciled. People who before
hated Buckingham now looked upon him as a patriot, for having
broken off the Papist match, and for seeking to punish Spain by war.
The heads of the Opposition in the House of Commons, the Earl of
Southampton, the Lord Say and Sele, and others came over to him;
and through Preston, a Puritan minister and chaplain to the prince,
he was brought in favour with many other members of the country
party. Buckingham and Charles assured James that the demand of
war with Spain was the only cry for him, as nothing would so readily
draw money from the Commons. Accordingly, though trembling and
reluctant, James summoned Parliament, which met on the 19th of
February.
THE ROYAL PALACE, MADRID. (From a photograph by Frith, Reigate.)
He opened it in much humbler tones than ever before. He expressed
a great desire to manifest his love for his people. He then informed
them that he had long been engaged in treaties with different
countries for the public good, and had actually sent his son and the
man whom he most trusted to Spain, and all that had passed there
should be laid before them; and he asked them to judge him
charitably, and to give him their advice on the whole matter. One
thing he begged to assure them of, that in everything, public and
private, he had always made a reservation for the cause of religion;
and though he had occasionally relaxed the penal statutes against
Catholics a little, yet as to suspending or altering any of them, "I
never," he exclaimed, "promised or yielded; I never thought it with
my heart or spoke it with my mouth!" And this notwithstanding that
on the 20th of July previous, he had sworn in the Spanish treaty to
procure the abolition of all those laws from Parliament; a fact
notorious not only to Charles, Buckingham, and Bristol, but to all the
Lords of the Council, and the Spanish ambassadors still in London.
He concluded by begging them to remember that time was precious,
and to avoid all impertinent and irritating inquiries.
On the 24th of February, a conference of both Houses was held at
Whitehall, at which Buckingham went into the detail of the journey
of the prince and himself to Spain. Bristol was prohibited from
attending Parliament, and the duke gave his own version of the
affair. According to him—for he produced only such despatches as
had been in a private conference with the Lord Keeper Williams
deemed safe; "his highness wishing," says Williams, "to draw on a
breach with Spain without ripping up of private despatches"—the
Spaniards behaved in a most treacherous manner. He asserted that
after long years of negotiation the king could bring the court of
Spain to nothing; that the Earl of Bristol had merely got from them
professions and declarations; that though the prince had gone
himself to test their sincerity, he had met with nothing but falsehood
and deceit; and that as to the restitution of the Palatinate, he had
found it hopeless from that quarter.
Perhaps no minister bronzed in impudence by years of crooked
dealing ever presented such a tissue of base and arrant fictions to
the Commons of England. The despatches, had they been produced,
would have covered the king, the prince, and the favourite, with
confusion. Bristol could have proved, had he been allowed, that he
had actually completed the treaty when the prince and Buckingham
came and put an end to it. So indignant were the Spanish
ambassadors at this shameful misrepresentation of the real facts,
that they protested vehemently against the whole of the statement,
and declared that had any nobleman in Spain spoken thus of the
King of England, he should have paid with his head for the slander.
Buckingham was not only defended but applauded. The prince
during the whole time stood at his elbow, and aided his memory or
his ingenuity. Coke declared that Buckingham was the saviour of his
country; and out of doors the people kindled bonfires in his honour,
sung songs to his glory, and insulted the Spanish ambassadors. The
two Houses, in an address to the Throne, declared that neither the
treaty with Spain for the marriage, nor that for the restitution of the
Palatinate, could be continued with honour or safety.
Of all things James dreaded war: he complained of his poverty, his
debts, of his desire of quietness at his years; but he had not the
resolution to resist the importunities of Buckingham and the prince,
backed by a strong cry from the deluded people, especially as he
saw no other mode of obtaining the money so necessary to him. In
addressing Parliament, he stated candidly the many reasons against
the war; the emptiness of his exchequer and the impoverished
condition of his allies; that Ireland would demand large sums, and
the repairs of the navy more; and then he put to them these
questions—whether he could with honour engage in a war which
concerned his own family exclusively? and whether the means would
be found for prosecuting it vigorously?
A deputation from both Houses answered these queries by calling
for war, and offering to support him in it with their persons and
fortunes. This address was read by Abbot, the Archbishop of
Canterbury, who but six months before had most reluctantly sworn
to the Spanish treaty. This was, indeed, a triumph to the archbishop,
but did not make the singularity the less of putting an address for
war into the hands of a clergyman; and one, moreover, who had so
lately fallen into great difficulty on account of his own accidental
shedding of blood. When the archbishop came to the passage where
James was congratulated on "his having become sensible of the
insincerity of the Spaniards—" "Hold!" exclaimed the king; "you
insinuate what I have never spoken. Give me leave to tell you that I
have not expressed myself to be either sensible or insensible of their
good or bad dealing. Buckingham hath made you a relation on which
you are to judge, but I never yet declared my mind upon it."
James, indeed, knew very well to the contrary; the Spaniards had
been too grasping, and had thus overshot themselves, but they
meant to complete the marriage; and it was a most unjustifiable
thing in James to go to war with them on the ground of their
insincerity, if he did not believe in its existence. But James was
desirous that as Buckingham had so strenuously called for war to
avenge his own petty, private piques, he should bear the blame of it.
James told them plainly that if he went to war he should demand
ample advances, and when five days afterwards the question of
supplies came on, he demanded seven hundred thousand pounds to
commence the war with, and an annual sum of one hundred and
fifty thousand pounds towards the liquidation of his debts. The
amount startled the Commons, in spite of their magniloquent offer
to support him with life and fortune; but Buckingham and the prince,
who were as mad for war as they had before been for their foolish
adventure, let the Commons know that a much less sum would be
accepted, and they voted three hundred thousand pounds for the
year, which the king consented should be put into the hands of the
treasurers appointed by the House, who were to pay money only on
a warrant from the Council of War. James also agreed that he would
not end the war without their consent. The vote was accompanied
by another address, vindicating Buckingham from the censures of
the Spanish ambassadors, and then the king issued a proclamation
announcing that both the treaties with Spain were at an end.
Thus was James, after twenty years of peace, except in the
character of an ally of his son-in-law, launched into a war. The
Spaniards ridiculed the idea; for on the authority of Gondomar, they
had conceived not only a very contemptible idea of James, but that
the kingdom was poor, torn with religious factions, and feeble from
the timid and vacillating character of the king. Only one peer, the
Earl of Rutland, had the good sense to oppose the vote for the war.
The restraint of the desire to please Spain during the negotiations
for the marriage being removed, the Houses of Parliament indulged
their old hatred of the Catholics by uniting in a petition to the king to
renew their persecution. James again protested that he never
intended to abolish those laws, and would never consent to the
insertion of a clause in any treaty whatever, binding him to an
indulgence of Catholics. And Charles also bound himself by an oath,
that "whenever it should please God to bestow upon him any lady
that were Popish, she should have no further liberty but for her own
family, and no advantage to any recusants at home."
Accordingly a proclamation was issued, ordering all missionaries to
quit the kingdom by a certain day under penalty of death; judges
and magistrates were ordered to enforce the laws as aforetime; the
Lord Mayor was enjoined to arrest all persons coming from Mass in
the houses of the ambassadors, and the bishops were called upon to
advise the king how the children of the Papists might be brought up
Protestants. The Commons called on every member to name all
Catholics holding office in his town or county, and prepared a list of
them, which they sent to the Lords; but the Lords declared that
before they could unite in a prayer for the dismissal of any one, they
must have evidence of his guilt; and thus the vindictive scheme fell
to the ground.
The Commons, checked in this quarter, turned their attention to their
more legitimate prosecution of jobbers and holders of injurious
patents. They presented a list of eleven such grievances to the king,
who replied that he had his grievances too: they had encroached on
his prerogatives; they had condemned patents of unquestionable
usefulness; and had been guided in their quest after them by
lawyers, who, he would say it to their faces, were in the whole
kingdom the greatest grievances of all; for where a suit was of no
benefit to either litigant, they made it so to themselves. But this did
not prevent them from flying at high game. Buckingham had never
forgiven Cranfield, Earl of Middlesex and Lord Treasurer, for turning
against him in his absence; and the Opposition party, with whom the
duke was now connected, took the lead in prosecuting him on a
charge of bribery, oppression, and neglect of duty. James was
indignant at this attack, but had not resolution enough to ward it off;
though he told Buckingham that he was a fool, and making a rod for
his own breech, and Charles that he would live to have his bellyful of
impeachments. Cranfield was condemned to a fine of fifty thousand
pounds, to be imprisoned during his majesty's pleasure, and for ever
excluded from office, from Parliament, and the verge of the Court.
Williams, the Lord Keeper, had also a narrow escape.
Notwithstanding his cringing at the feet of Buckingham, the favourite
had by no means forgiven him; petitions against him were presented
to the Committee of Inquiry, but he again sued humbly to
Buckingham, and having had the opportunity during the Session of
doing him a service, the duke let him off with the proud remark, "I
shall not seek your ruin, but I shall cease to study your fortune."
Buckingham and Charles now persuaded the king to change his
foreign policy. They sent envoys all over Europe to engage the
different powers by any argument and by rich presents to co-operate
in the war against Spain and Austria for the restitution of the
Palatinate. To Sweden, Denmark, and the Protestant States of
Germany, they urged the necessity of reducing the power of the
Catholic princes on the Continent. Promises of liberal subsidies were
added, and the concurrence of these States was pledged. It was a
more difficult matter to influence the Catholic countries of France,
Venice, and Savoy to a war which was actually aimed at the
existence of their own religion. But the ancient enmity of these
States against Austria prevailed over their religious scruples, and
they undertook to assist indirectly, by making a show of hostilities
against Spain, so as to prevent her from giving effectual aid to
Austria, and by allowing soldiers to be raised within their territories,
as well as by furnishing money.
With Holland they had effected a league, and undertaken to send
troops to resist the invasion of Spain and Austria, when the news of
a frightful tragedy, perpetrated by the Dutch in the East, upon the
English there, arrived in England. This was what has become so well
known in history as the massacre of Amboyna.
Since the Dutch had enjoyed their long truce with Spain, they had
been zealously colonising and trading to the East. Besides Batavia,
they laid claim to all the Spice Islands in the Indian Archipelago,
from which they had expelled the Portuguese. On one of these
islands, Amboyna, the English East India Company had, in 1612,
established a small settlement, to trade with the natives for cloves.
The Dutch compelled them to retire, but in consequence of a treaty
in 1619, the English had returned thither, and established a
settlement at Cambello. In the whole population there were only
about twenty English and about thirty Japanese, whilst there were
two hundred Dutch soldiers besides other Dutchmen in the Civil
Service. Yet on pretence of a conspiracy between the English and
Japanese to surprise the garrison and expel the Dutch, in 1623 the
latter seized Captain Towerson and nine other Englishmen, nine
Japanese, and one Portuguese, and after torturing them into a
confession, cut off their heads.
The horror with which the news of this atrocious deed was received,
threatened to ruin Buckingham's plans. But the English minister
made a strong complaint on the subject; the States made humble
apologies and promises of ample redress, and thus it was contrived
for the moment to smooth over the difficulty. It was the more readily
done because the unpopular Spaniards had already laid siege to
Breda; and six thousand troops were despatched from England to
enable Prince Maurice of Orange to cope with the able Spanish
general Spinola. Spinola carried Breda in defiance of the Dutch and
English; and the Prince of Orange, hearing that Antwerp had been
left without a sufficient garrison, marched thither to surprise it but
with equally ill success. To obtain fresh men and money, Count
Mansfeldt, the Palatine's old auxiliary general, came over to England
in the autumn. He was promised twenty thousand pounds a month,
and twelve thousand Englishmen were pressed into his service. With
these he set sail, to reach as soon as possible his army of French
and German mercenaries on the borders of the Palatinate. But the
French, who had agreed to allow this force to pass through their
territory, refused, on account of their disorderly character; for they
were the scum of their own country, and several, on their march
through it, had been hanged for their outrages. Mansfeldt conducted
them to the island of Zealand, but there also the authorities were
averse from their landing; and while remaining cooped up in small
miserable transports, in bad weather, and on a swampy shore, they
began to perish of fever. Five thousand of them had died before they
reached the borders of the Palatinate, and the united force was still
too feeble to accomplish anything. Maurice of Orange, meanwhile,
having done nothing at Antwerp, retired into winter quarters, and
soon after died at the Hague; whereupon the Earl of Southampton
and other English officers returned home. Such was the miserable
result of the campaign into which James had been hurried by the
folly of Charles and Buckingham.
The melancholy thoughts of James were diverted from dwelling on
these wretched affairs by the prospect of the marriage of Charles
and Henrietta Maria, the youngest sister of the King of France.
It was a curious fact that at the time of Charles's looking out for a
wife from one of the principal houses of Europe, the prospect of an
English royal marriage was made gloomy by the most awful
reflections to both France and Spain. The last Spanish Queen of
England was Catherine of Aragon, who had found such a tyrant in
the sanguinary Henry VIII., and suffered divorce and severe usage;
the last French queen was Margaret of Anjou, who had been driven
from the country after the most heroic endeavours to maintain her
husband on the throne. Besides these sombre memories, the
question presented formidable difficulties from the temper of the
English people regarding Popery. Politically the alliance was
attractive, and this is generally all-sufficient in regal matrimony. But
it was singular that the present marriage with a French princess was
followed by similar and even more fearful results than the former.
Henrietta Maria married Charles only to engage in a similar contest
for the retention of the throne as Margaret of Anjou, and not only to
see her husband deposed but put to death.
Charles is supposed by many to have been struck by the young
Princess of France at his visit to the French Court on his way to
Spain, and to have gone there prepared to break off the match. It is
probable, however, that the thought of Henrietta came back more
strongly upon him after he found himself disappointed in Donna
Maria of Spain; for independently of the other difficulties already
related attending Charles's Spanish courtship, it is very likely that he
was not extremely fascinated by the Infanta. On the way to Spain,
Henrietta, as seen by him, was merely a girl of little more than
fourteen years of age, of short stature, and visible but for a brief
space. The impression which she left could not be very vivid; but the
Queen of France, the elder sister of Donna Maria, was extremely
beautiful and, as Charles himself said in his letters to his father at
the time, had so much struck him as to inspire him "with a greater
desire to see her sister." There can be little doubt that Charles was
disappointed in his expectation, for he was of that romantic turn that
had he been strongly fascinated by the lady, he would have broken
through all difficulties for her sake. But at the Court of Spain he met
with another queen, the sister of Louis of France and of Henrietta,
who not only cast the Infanta into the shade by her beauty and
grace, but actually suggested to Charles the more desirable union
with her sister of France. The rigid etiquette of the Spanish Court
prevented much intercourse between Charles and the queen; she
dared not even converse with him in French without express
permission, and one opportunity to do so having been obtained, she
begged him never to speak to her again, for that it was the custom
in Spain to poison all gentlemen who were very marked in their
attentions to the queen. But she seized that one opportunity to say
that "she wished he would marry her sister Henrietta, which indeed
he would be able to do, because his engagement with the Infanta
would be certainly broken."

THE LADIES OF THE FRENCH COURT AND THE PORTRAIT OF PRINCE


CHARLES. (See p. 506.)
On the other hand, there was a decided desire in the French Court
for this alliance, despite past experience. Mary de Medici, the queen-
mother of France, had acquired a predominating influence in the
government of her son, Louis XIII., by means of her clever and
intriguing almoner Richelieu, who soon mounted into vast power in
the State. She entertained a strong hope of effecting a marriage for
her daughter with the heir of England, and was no doubt early
informed of the probability of the failure of the Spanish courtship. It
was soon conveyed to Charles by the English ambassador at Paris,
that Henrietta had said, "The Prince of Wales need not have gone so
far as Madrid to look for a wife." This following the suggestion of the
Queen of Spain, left no doubt of the wishes of the Court of France,
and the bait seems to have been soon taken. Buckingham would
certainly promote the idea to spite the Spaniards; and Henry Rich,
Lord Kensington, appeared in Paris before the Spanish match was
formally broken off, to open the subject to the queen-mother.

HENRIETTA MARIA.
Mary de Medici, though extremely anxious for the marriage, played
the part of the politician well under Richelieu, and gave no decided
encouragement to the hints of the English envoy, till he assured her
plainly that the match with Spain was positively broken off. Even
then, she told Lord Kensington that "she could not consider the
matter seriously, as she had received no intimation of such proposal
from the King of England, and that the princess could not make
advances; she must be sought." On this, Kensington spoke out with
authority, and received a favourable answer. It is asserted that a
great sensation was excited at the French Court, and the ladies
crowded round Lord Kensington to have a view of the prince's
portrait, which he carried in a locket; and the locket was soon
privately borrowed by the princess and kept for a good long
observation, she expressing her satisfaction with the looks of her
royal lover. Kensington, by his courtly assiduity at Paris and his
letters to Charles, endeavoured to create a strong personal interest
in the prince and princess towards each other. Hay, Earl of Carlisle,
one of James's favourites, a handsome, empty fop, who prided
himself on adorning his person with lace and jewels to the amount
of forty thousand pounds, was sent as a formal ambassador for the
marriage negotiation, the real conductor of it still being Kensington.
A miniature portrait of Henrietta was sent to Charles, who appeared
to be enraptured with it.
So far all went well. But notwithstanding the anxious desire for the
marriage on the part of the French Court, it was not likely that so
crafty a diplomatist as Richelieu would make an easy bargain for the
English. The portion of the princess was settled at eight hundred
thousand crowns. She was pledged to renounce all claims for herself
and her descendants on the crown of France. Then came the
question of religion. James and Charles had lately bound themselves
by the most solemn oaths that a Catholic wife of the prince should
have indulgence in that respect only for her own private worship;
and that no toleration whatever should be extended to the English
Catholics on account of such a marriage. But this was not likely to
pass. The Pope Urban, in the first place, was extremely unfriendly to
the match. He expected little good from a prince who had shown
such duplicity in the Spanish courtship; and he predicted that the
alliance, if effected, would be disastrous; being fully informed by the
seminary priests who were in England, secretly prosecuting the
support of Catholicism, of the determined temper of the people on
that score, and assured by them that if the king dared to relax the
penal laws he would not be king long; and if he did not soften their
rigour, the Pope argued, what prospect of happiness could there be
for a Catholic queen? He was, therefore, averse from granting a
dispensation.
Under these circumstances the negotiation appeared for some time
at a stand. On the part of the English people, the opposition was
scarcely perceptible. They saw that they were pretty certain to have
a Catholic queen; the Stuart family did not incline to stoop to the
alliance of any further petty Protestant princes; the experiment of
the Palatinate was not encouraging. The people, therefore, were far
more disposed to receive a daughter of great Henry IV., who had
been a Protestant at heart even when he had yielded the profession
of his faith to political necessity, than a grand-daughter of Philip II.,
who had rendered his memory so odious in England and all over the
world by bloody persecutions of the Protestants. On the part of the
French, however, the proceedings every day seemed involved in
growing difficulties.
Richelieu, who, up to the time of the breaking off the Spanish
match, was most compliant, now insisted on the concession to the
Catholics of all the advantages stipulated for by Spain. He declared
that it would be an affront to his sovereign to offer less. James,
despite his recent oath, signed a paper, promising indulgence to the
Catholics, which Kensington and Carlisle assured Richelieu was quite
sufficient; but it had no effect on the astute French minister. "We did
sing a song to the deaf," wrote the ambassadors, "for he would not
endure to hear of it." In vain did they remind him that the French
Court had promised that if they gave toleration to the Catholics, it
would send soldiers to the Palatinate, and unite their interests with
those of England entirely. Richelieu did not deny this, but contended
that the security was not sufficient; they must have an actual treaty.
Meanwhile Lord Nithsdale, a Catholic, was sent post haste to Rome,
to make promises of favour to the English Catholics in order to
procure the dispensation.
At length the French Court agreed to accept the secret agreement of
James, which was to the effect that the English Catholics should
enjoy a greater freedom of religion than had been guaranteed by the
Spanish contract. This was signed by James, Charles, and the
Secretary of State, on the 8th of November, and Louis placed his
signature on the 12th to the treaty of marriage. By this treaty it was
provided, not indeed expressly, as many historians have asserted,
that the children of the marriage should be brought up Roman
Catholics till their thirteenth year, and that they should remain under
the queen's care till that age; a stipulation amounting very much to
the same thing; for though Charles chose to construe the article in
his own way, the mother used her opportunity thus guaranteed to fix
the Catholic faith firmly in the hearts of her sons, as was too well
and too disastrously shown in the end.
If the English Court thought the difficulties all surmounted, they
were vastly mistaken; for the French ministers now expressed
themselves as not satisfied with James's secret engagement. It was,
they contended, too vague, and they called upon him to specify
precisely the indulgences which he intended towards the Catholics.
At this proposition Carlisle expressed his astonishment, and wrote to
James in a tone of unequivocal indignation. He advised the king to
make no further concessions; feeling sure that if he were firm, the
French would give way rather than hazard the failure of the match.
But to preach firmness to James was to expect solidity from a mist.
He was alarmed at the obstinacy of the Pope; at the declaration of
Philip of Spain, that he held the marriage contract with Charles as
still valid, from a private agreement between the prince and himself;
and at the strenuous efforts made by Philip to bring the Court of
France to this persuasion. To complete his dismay, the Huguenots of
France, just at this moment, made a rising under the leadership of
Soubise. They demanded a better observance of the edicts in favour
of the Protestants, seized the Isle of Rhé, near La Rochelle, placed it
in a state of defence, sent out a fleet to range the coast, and vowed
not to lay down their arms till their demands were granted. James
consented to add these express stipulations to his secret bond—That
all Catholics imprisoned on account of their religion, since the rising
of Parliament, should be liberated; that all fines levied on recusants
since that period should be repaid; and that for the future they
should suffer no interruption to the free exercise of their religious
faith.
All obstacles on the part of the French Court were now removed,
and the young princess prepared for her journey to England. But the
Pope continued his opposition, still presaging misfortune from the
marriage, and refusing to deliver the dispensation. The patience of
the queen-mother was exhausted; the ministers of France proposed
to proceed on a dispensation from the ecclesiastic authorities in their
own realm; but to this James demurred, lest the validity of the
marriage might hereafter be called in question. At length the Pope
was satisfied by an oath taken by Louis, binding himself and his
successors to compel James and his son, by all the power of France
if necessary, to keep their engagement. The dispensation was
delivered by Spada, the Papal Nuncio; the Duke of Chevreuse, a
prince of the House of Guise, and a near relative of James and
Charles, through the Queen of Scots, was appointed proxy by
Charles, and Buckingham was ordered to go over and receive the
bride. But James was destined not to see the completion of the
marriage, after all his trouble through nine years of matrimonial
negotiations.
On the 13th of March, 1625, he returned to Theobalds from the hunt
with an illness upon him, which was regarded as the tertian ague,
but which soon developed itself as gout in the stomach. He had long
been so thoroughly undermined in constitution by his habits of
eating and drinking, that it required no fierce attack of sickness to
carry him off. He had always had a strong repugnance to doctors
and physic, but now the Court physicians were hurried to his
bedside. At this moment appeared the mother of Buckingham with
an infallible specific—a plaster and a posset obtained from an Essex
quack. These were pronounced marvellous in the cure of ague, and
though the physicians protested against their use, they were
applied. They did not delay, if they did not accelerate the
catastrophe. On the eleventh day of his illness, James received the
Sacrament. Williams, bishop and Lord Keeper, preached his funeral
sermon, and said that, having told the king "that holy men in holy
orders in the Church of England doe challenge a power as inherent
in their functions, and not in their person, to pronounce and declare
remission of sins to such as being penitent doe call for the same, he
had answered suddenly, 'I have ever believed there was that power
in you that be in orders in the Church of England, and therefore I, a
miserable sinner, doe humbly desire Almighty God to absolve me my
sinnes, and you, that are His servant in that high place, to affoard
me this heavenly comfort.' And after the absolution read and
pronounced, he received the sacrament with that zeal and devotion,
as if he had not been a fraile man, but a Christian cloathed with
flesh and blood."
On Sunday, the 27th of March, the fourteenth day of his illness,
Charles was hastily called before daylight to go to him, but before he
reached the chamber the king had lost the power of speech. He
appeared extremely anxious to communicate something to him but
could not, and soon after expired. He was in the fifty-ninth year of
his age, and the twenty-third of his reign. Two only of his seven
children, three sons and four daughters, Charles and the ex-queen
of Bohemia, survived him.
CHAPTER XIX.
REIGN OF CHARLES I.
Accession of Charles—His Marriage—Meeting of Parliament—
Loan of Ships to Richelieu—Dissolution of Parliament—Failure of
the Spanish Expedition—Persecution of the Catholics—The
Second Parliament—It appoints three Committees—
Impeachment of Buckingham—Parliament dissolved to save him
—Illegal Government—High Church Doctrines—Rupture with
France—Disastrous Expedition to Rhé—The Third Parliament—
The Petition of Right—Resistance and Final Surrender of Charles
—Parliament Prorogued—Assassination of Buckingham—Fall of
La Rochelle—Parliament Reassembles and is dissolved—
Imprisonment of Offending Members—Government without
Parliament—Peace with France and Spain—Gustavus Adolphus
in Germany—Despotic Proceedings of Charles and Laud.

Within a quarter of an hour after the decease of James, Charles was


proclaimed by the Knight-Marshal, Sir Edward Zouch, at the court-
gate at Theobalds. He was in his twenty-fifth year, and so far as the
admission of his title and the substantial prosperity of the kingdom
were concerned, few monarchs have mounted the throne with more
favourable auspices. But though there was entire submission to his
right to reign, and the state of parties was such that no immediate
change of executive was needed, yet there were at work feelings
and principles which required the nicest wisdom to estimate their
nature and their force, and the most able policy to deal with them.
The battle between prerogative and popular rights had to be fought
out, and it depended on the capacity of the monarch to perceive
what was capable of modulation, and what was immovable, whether

You might also like