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

Fluent Python Luciano Ramalho pdf download

The document provides information about the book 'Fluent Python' by Luciano Ramalho, including publication details, copyright information, and a table of contents outlining various chapters on Python programming concepts. It highlights the book's focus on Python's data model, data structures, functions, and object-oriented idioms. Additionally, it mentions the availability of the book for download and further resources from O'Reilly Media.

Uploaded by

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

Fluent Python Luciano Ramalho pdf download

The document provides information about the book 'Fluent Python' by Luciano Ramalho, including publication details, copyright information, and a table of contents outlining various chapters on Python programming concepts. It highlights the book's focus on Python's data model, data structures, functions, and object-oriented idioms. Additionally, it mentions the availability of the book for download and further resources from O'Reilly Media.

Uploaded by

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

Fluent Python Luciano Ramalho pdf download

https://ebookmeta.com/product/fluent-python-luciano-ramalho/

Download more ebook from https://ebookmeta.com


Fluent Python

Luciano Ramalho

Fluent Python

by Luciano Ramalho

Copyright © 2014 Luciano Ramalho. All rights reserved.

Printed in the United States of America.

Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,


Sebastopol, CA 95472.

O’Reilly books may be purchased for educational, business, or sales


promotional use. Online editions are also available for most titles (
http://safaribooksonline.com). For more information, contact our
corporate/

institutional sales department: 800-998-9938 or


corporate@oreilly.com.

Editors: Meghan Blanchette and Rachel Roumeliotis

Indexer: FIX ME!

Production Editor: FIX ME!

Cover Designer: Karen Montgomery

Copyeditor: FIX ME!

Interior Designer: David Futato

Proofreader: FIX ME!

Illustrator: Rebecca Demarest


March 2015:

First Edition

Revision History for the First Edition:

2014-09-30: Early release revision 1

2014-12-05: Early release revision 2

2014-12-18: Early release revision 3

2015-01-27: Early release revision 4

2015-02-27: Early release revision 5

2015-04-15: Early release revision 6

2015-04-21: Early release revision 7

See http://oreilly.com/catalog/errata.csp?isbn=9781491946008 for


release details.

Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo
are registered trademarks of O’Reilly Media, Inc. !!FILL THIS IN!! and
related trade dress are trademarks of O’Reilly Media, Inc.

Many of the designations used by manufacturers and sellers to


distinguish their products are claimed as trademarks. Where those
designations appear in this book, and O’Reilly Media, Inc. was aware
of a trademark claim, the designations have been printed in caps or
initial caps.

While every precaution has been taken in the preparation of this


book, the publisher and authors assume no responsibility for errors or
omissions, or for damages resulting from the use of the information
contained herein.
ISBN: 978-1-491-94600-8

[?]

Para Marta, com todo o meu amor.

Table of Contents

Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . xv

Part I. Prologue

1. The Python Data Model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


.........................3

A Pythonic Card Deck 4

How special methods are used 8

Emulating numeric types 9

String representation 11

Arithmetic operators 11

Boolean value of a custom type 12

Overview of special methods 12

Why len is not a method 14

Chapter summary 14

Further reading 15

Part II. Data structures


2. An array of sequences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 19

Overview of built-in sequences 20

List comprehensions and generator expressions 21

List comprehensions and readability 21

Listcomps versus map and filter 23

Cartesian products 23

Generator expressions 25

Tuples are not just immutable lists 26

Tuples as records 26

Tuple unpacking 27

Nested tuple unpacking 29

Named tuples 30

Tuples as immutable lists 32

Slicing 33

Why slices and range exclude the last item 33

Slice objects 34

Multi-dimensional slicing and ellipsis 35

Assigning to slices 36
Using + and * with sequences 36

Building lists of lists 37

Augmented assignment with sequences 38

A += assignment puzzler 40

list.sort and the sorted built-in function 42

Managing ordered sequences with bisect 44

Searching with bisect 44

Inserting with bisect.insort 46

When a list is not the answer 47

Arrays 48

Memory views 51

NumPy and SciPy 52

Deques and other queues 54

Chapter summary 57

Further reading 58

3. Dictionaries and sets. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . 63

Generic mapping types 64

dict comprehensions 66

Overview of common mapping methods 66


Handling missing keys with setdefault 68

Mappings with flexible key lookup 70

defaultdict: another take on missing keys 71

The __missing__ method 72

Variations of dict 75

Subclassing UserDict. 76

Immutable mappings 77

Set theory 79

set literals 80

set comprehensions 81

Set operations 82

dict and set under the hood 85

A performance experiment 85

Hash tables in dictionaries 87

vi | Table of Contents

Practical consequences of how dict works 90

How sets work — practical consequences 93

Chapter summary 93

Further reading 94
4. Text versus bytes. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . 97

Character issues 98

Byte essentials 99

Structs and memory views 102

Basic encoders/decoders 103

Understanding encode/decode problems 105

Coping with UnicodeEncodeError 105

Coping with UnicodeDecodeError 106

SyntaxError when loading modules with unexpected encoding 107

How to discover the encoding of a byte sequence 108

BOM: a useful gremlin 109

Handling text files 110

Encoding defaults: a madhouse 113

Normalizing Unicode for saner comparisons 116

Case folding 119

Utility functions for normalized text matching 120

Extreme “normalization”: taking out diacritics 121

Sorting Unicode text 124

Sorting with the Unicode Collation Algorithm 126


The Unicode database 126

Dual mode str and bytes APIs 128

str versus bytes in regular expressions 129

str versus bytes on os functions 130

Chapter summary 132

Further reading 133

Part III. Functions as objects

5. First-class functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . 139

Treating a function like an object 140

Higher-order functions 141

Modern replacements for map, filter and reduce 142

Anonymous functions 143

The seven flavors of callable objects 144

User defined callable types 145

Function introspection 147

Table of Contents | vii

From positional to keyword-only parameters 148

Retrieving information about parameters 150

Function annotations 154


Packages for functional programming 156

The operator module 156

Freezing arguments with functools.partial 159

Chapter summary 161

Further reading 162

6. Design patterns with first-class functions. . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . 167

Case study: refactoring Strategy 168

Classic Strategy 168

Function-oriented Strategy 172

Choosing the best strategy: simple approach 175

Finding strategies in a module 176

Command 177

Chapter summary 179

Further reading 180

7. Function decorators and closures. . . . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . 183

Decorators 101 184

When Python executes decorators 185

Decorator-enhanced Strategy pattern 187

Variable scope rules 189


Closures 192

The nonlocal declaration 195

Implementing a simple decorator 197

How it works 198

Decorators in the standard library 200

Memoization with functools.lru_cache 200

Generic functions with single dispatch 202

Stacked decorators 205

Parametrized Decorators 206

A parametrized registration decorator 206

The parametrized clock decorator 209

Chapter summary 211

Further reading 212

viii | Table of Contents

Part IV. Object Oriented Idioms

8. Object references, mutability and recycling. . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . 219

Variables are not boxes 220

Identity, equality and aliases 221

Choosing between == and is 223


The relative immutability of tuples 224

Copies are shallow by default 225

Deep and shallow copies of arbitrary objects 227

Function parameters as references 229

Mutable types as parameter defaults: bad idea 230

Defensive programming with mutable parameters 232

del and garbage collection 234

Weak references 236

The WeakValueDictionary skit 237

Limitations of weak references 239

Tricks Python plays with immutables 240

Chapter summary 242

Further reading 243

9. A Pythonic object. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . 247

Object representations 248

Vector class redux 248

An alternative constructor 251

classmethod versus staticmethod 252

Formatted displays 253


A hashable Vector2d 257

Private and “protected” attributes in Python 263

Saving space with the __slots__ class attribute 265

The problems with __slots__ 267

Overriding class attributes 268

Chapter summary 270

Further reading 271

10. Sequence hacking, hashing and slicing. . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . 277

Vector: a user-defined sequence type 278

Vector take #1: Vector2d compatible 278

Protocols and duck typing 281

Vector take #2: a sliceable sequence 282

How slicing works 283

A slice-aware __getitem__ 285

Table of Contents | ix

Vector take #3: dynamic attribute access 286

Vector take #4: hashing and a faster == 290

Vector take #5: formatting 296

Chapter summary 303


Further reading 304

11. Interfaces: from protocols to ABCs. . . . . . . . . . . . . . . . . . .


. . . . . . . . . . . . . . . . . . . . . . . . 309

Interfaces and protocols in Python culture 310

Python digs sequences 312

Monkey-patching to implement a protocol at run time 314

Waterfowl and ABCs 316

Subclassing an ABC 321

ABCs in the standard library. 323

ABCs in collections.abc 323

The numbers tower of ABCs 324

Defining and using an ABC 325

ABC syntax details 330

Subclassing the Tombola ABC 331

A virtual subclass of Tombola 333

How the Tombola subclasses were tested 336

Usage of register in practice 339

Geese can behave as ducks 340

Chapter summary 341

Further reading 343


Discovering Diverse Content Through
Random Scribd Documents
INDEX TO THE POEMS
VOL. PAGE
Aar, The Fall of the vi 308
Abbeys, Old vii 100
Address from the Spirit of Cockermouth Castle vii 347
Address to a Child iv 50
Address to Kilchurn Castle ii 400
Address to my Infant Daughter, Dora iii 14
Address to the Scholars of the Village School of —— ii 84
Admonition iv 34
Æneid, Translation of Part of the First Book of the viii 276
“Aerial Rock—whose solitary brow” vi 187
Affliction of Margaret—, The iii 7
Afflictions of England vii 72
After-Thought (Duddon) vi 263
After-Thought (Tour on the Continent) vi 315
Airey-Force Valley viii 146
Aix-la-Chapelle vi 295
“Alas! what boots the long laborious quest” iv 216
Alban Hills, From the viii 65
Albano, At viii 64
Alfred vii 24
Alfred, His Descendants vii 25
Alice Fell; or, Poverty ii 272
Aloys Reding vi 310
Ambleside viii 156
America, Aspects of Christianity in (Three Sonnets) vii 84
American Episcopacy vii 85
American Tradition vi 246
Ancient History, On a celebrated Event in (Two
Sonnets) iv 242
Andrew Jones viii 221
Anecdote for Fathers i 234
Animal Tranquillity and Decay i 307
Anticipation (October 1803) ii 436
Anticipation of leaving School, Composed in i 1
Apennines, Among the Ruins of a Convent in the viii 82
Apology (Ecclesiastical Sonnets, 1st part) vii 18
Apology (Ecclesiastical Sonnets, 2nd part) vii 55
Apology (Sonnets upon the Punishment of Death) viii 112
Apology (Yarrow Revisited) vii 309
Applethwaite, At iii 23
Aquapendente, Musings near viii 42
Armenian Lady’s Love, The vii 232
Artegal and Elidure vi 45
Authors, A plea for, viii 99
Author’s Portrait, To the vii 318
Autumn (September) vi 64
Autumn (Two Poems) vi 201
Avarice, The last Stage of ii 60
Avon, The (Annan) vii 303
Bala-Sala, At vii 365
Balbi iv 237
Ballot, Protest against the viii 304
Bangor, Monastery of Old vii 13
Baptism vii 89
Barbara ii 178
Beaumont, Sir George, Epistle to iv 256
Beaumont, Sir George, Upon perusing the foregoing
Epistle to iv 267
Beaumont, Sir George, Picture of Peele Castle, painted
by iii 54
Beaumont, Sir George, Beautiful Picture, painted by iv 271
Beaumont, Sir George, Elegiac Stanzas addressed to vii 132
Beaumont, To Lady iv 57
Beggar, The Old Cumberland i 299
Beggars (Two Poems) ii 276
“‘Beloved Vale!’ I said, ‘when I shall con’” iv 35
Benefits, Other (Two Sonnets) vii 40
Bible, Translation of the vii 58
Binnorie, The Solitude of ii 204
Bird of Paradise, Coloured Drawing of the viii 29
Bird of Paradise, Suggested by a Picture of viii 140
Biscayan Rite (Two Sonnets) iv 241
Bishops, Acquittal of the vii 79
Bishops and Priests vii 86
Black Comb, Inscription on a Stone on the side of iv 281
Black Comb, View from the top of iv 279
“Blest Statesman He, whose Mind’s unselfish will” viii 101
Bologna, At (Three Sonnets) viii 85
Bolton Priory, The Founding of iv 204
Books and Newspapers, Illustrated viii 184
Borderers, The i 112
Bothwell Castle vii 299
Boulogne, On being stranded near the Harbour of vi 378
Bran, Effusion on the Banks of the vi 28
Breadalbane, Ruined Mansion of the Earl of vii 295
Brientz, Scene on the Lake of vi 315
Brigham, Nun’s Well vii 347
Britons, Struggle of the vii 11
Brothers, The ii 184
Brothers Water, Bridge at the foot of ii 293
Brougham Castle, Song at the Feast of iv 82
Brownie’s Cell vi 16
Brownie, The vii 297
Brugès (Two Poems) vi 288
Brugès, Incident at vii 198
Buonaparté ii 323
Buonaparté ii 331
Buonaparté iv 228
Burial in the South of Scotland, A Place of vii 285
Burns, At the Grave of ii 379
Burns, Thoughts suggested near the Residence of ii 383
Burns, To the Sons of ii 386
Butterfly, To a ii 383
Butterfly, To a ii 297
Calais, August 1802 ii 331
Calais, August 15, 1802 ii 334
Calais, Composed by the Seaside, near ii 330
Calais, Composed near ii 332
Calais, Composed on the Beach, near ii 335
Calais, Fish-women at vi 286
Calvert, Raisley iv 44
Camaldoli, At the Convent of (Three Sonnets) viii 72
Canute vii 27
Canute and Alfred vi 130
Castle, Composed at —— ii 410
“Castle of Indolence,” Written in my Pocket Copy of
Thomson’s ii 305
Casual Incitement vii 14
Catechising vii 91
Cathedrals, etc. vii 105
Catholic Cantons, Composed in one of the (Two
Poems) vi 312
Celandine, The Small iii 21
Celandine, To the Small (Two Poems) ii 300
Cenotaph (Mrs. Fermor) vii 135
Chamouny, Processions in the Vale of vi 363
Character, A ii 208
Charles the First, Troubles of vii 71
Charles the Second vii 75
Chatsworth vii 272
Chaucer, Selections from (Three Poems) ii 238
Chiabrera, Epitaphs translated from iv 229
Chichely, Archbishop, to Henry V. vii 47
Child, Address to a iv 50
Child, Characteristics of a, three years old iv 252
Child, To a (Written in her Album) viii 7
Childless Father, The ii 181
Christianity in America, Aspects of (Three Sonnets) vii 84
Churches, New vii 102
Church to be erected (Two Sonnets) vii 103
Churchyard, New vii 104
Cintra, Convention of (Two Sonnets) iv 210
Cistertian Monastery vii 37
Clarkson, Thomas, To iv 62
Clergy, Corruptions of the Higher vii 49
Clergy, Emigrant French vii 101
Clerical Integrity vii 78
Clermont, The Council of vii 30
Clifford, Lord iv 82
Clouds, To the viii 142
Clyde, In the Frith of, Ailsa Crag vii 369
Clyde, On the Frith of vii 370
Cockermouth Castle, Address from the Spirit of vii 347
Cockermouth, In sight of vii 346
Coleorton, Elegiac Musings in the grounds of vii 269
Coleorton, A Flower Garden at vii 125
Coleorton, Inscription for an Urn in the grounds of iv 78
Coleorton, Inscription for a Seat in the groves of iv 80
Coleorton, Inscription in a garden of iv 76
Coleorton, Inscription in the grounds of iv 74
Coleridge, Hartley, To ii 351
Collins, Remembrance of i 33
Cologne, In the Cathedral at vi 297
Commination Service vii 96
Complaint, A iv 17
“Complete Angler,” Written on a blank leaf in the vi 190
Conclusion (Duddon) vi 262
Conclusion (Ecclesiastical Sonnets) vii 108
Conclusion (Miscellaneous Sonnets) vii 177
Conclusion (Prelude) iii 367
Conclusion (Sonnets upon the Punishment of Death) viii 111
Confirmation (Two Sonnets) vii 92
Congratulation vii 102
Conjectures vii 5
Contrast, The. The Parrot and the Wren vii 141
Convent in the Apennines viii 82
Convention of Cintra, Composed while writing a Tract
occasioned by the (Two Sonnets) iv 210
Conversion vii 17
Convict, The viii 217
Cora Linn, Composed at vi 26
Cordelia M——, To vii 400
Cottage Girls, The Three vi 351
Cottager to her Infant, The iii 74
Council of Clermont, The vii 30
Countess’ Pillar vii 307
Covenanters, Persecution of the Scottish vii 79
Cranmer vii 62
Crosthwaite Church viii 157
Crusaders vii 41
Crusades vii 31
Cuckoo and the Nightingale, The ii 250
Cuckoo at Laverna, The viii 67
Cuckoo Clock, The viii 151
Cuckoo, To the ii 289
Cuckoo, To the vii 169
Cumberland Beggar, The Old i 299
Cumberland Beggar, The Old, MS. Variants viii 220
Cumberland, Coast of (In the Channel) vii 358
Cumberland, On a high part of the coast of vii 337
Daffodils, The iii 4
Daisy, To the (Two Poems) ii 353
Daisy, To the ii 360
Daisy, To the iii 51
Daniel, Picture of (Hamilton Palace) vii 303
Danish Boy, The ii 96
Danish Conquests vii 27
Danube, The Source of the vi 303
Dati, Roberto iv 234
Dedication (Miscellaneous Sonnets) vii 159
Dedication (Tour on the Continent) vi 285
Dedication (White Doe of Rylstone) iv 102
Dedication (White Doe of Rylstone) vi 42
Departure from the Vale of Grasmere ii 377
“Deplorable his lot who tills the ground” vii 38
Derwent, To the River vi 193
Derwent, To the River vii 345
Descriptive Sketches i 35
Descriptive Sketches i 309
Desultory Stanzas vi 382
Detraction which followed the Publication of a certain
Poem, On the vi 212
Devil’s Bridge, To the Torrent at the vii 129
Devotional Incitements vii 314
Dion vi 116
Dissensions vii 10
Distractions vii 68
Dog, Incident characteristic of a favourite iii 48
Dog, Tribute to the Memory of the same iii 49
Donnerdale, The Plain of vi 251
Dora, To (A little onward) vi 132
Dora, To my Niece viii 297
Douglas Bay, Isle of Man, On entering vii 360
Dover, Composed in the Valley near ii 341
Dover, Near ii 343
Dover, The Valley of (Two Sonnets) vi 380
Druidical Excommunication vii 7
Druids, Trepidation of the vii 6
Duddon, The River vi 225
Dungeon-Ghyll Force ii 138
Dunollie Castle (Eagles) vii 292
Dunolly Castle, On Revisiting vii 371
Dunolly Eagle, The vii 372
Duty, Ode to iii 37
Dyer, To the Poet John iv 273
Eagle and the Dove, The viii 309
Eagles (Dunollie Castle) vii 292
Eagle, The Dunolly vii 372
Easter Sunday, Composed on vi 194
Ecclesiastical Sonnets vii 2
Echo, The Mountain iv 25
Echo upon the Gemmi vi 360
Eclipse of the Sun, The vi 345
Eden, The River (Cumberland) vii 385
Edward VI. vii 59
Edward VI. signing the Warrant vii 60
Egremont Castle, The Horn of iv 12
Egyptian Maid, The vii 252
Ejaculation vii 107
Elegiac Musings (Coleorton Hall) vii 269
Elegiac Stanzas (Goddard) vi 371
Elegiac Stanzas (Mrs. Fermor) vii 132
Elegiac Stanzas (Peele Castle) iii 54
Elegiac Verses (John Wordsworth) iii 58
Elizabeth vii 65
Ellen Irwin ii 124
Emigrant French Clergy vii 101
Emigrant Mother, The ii 284
Eminent Reformers (Two Sonnets) vii 66
Emma’s Dell ii 153
Engelberg vi 316
Enghien, Duke d’ vi 114
“England! the time is come when thou should’st wean” ii 432
England, Afflictions of vii 72
Enterprise, To vi 218
Episcopacy, American vii 85
Epistle to Sir George Beaumont iv 256
Epistle to Sir George Beaumont, Upon perusing the
foregoing iv 267
Epitaph, A Poet’s ii 75
Epitaph in the Chapel-yard of Langdale viii 120
Epitaphs translated from Chiabrera iv 229
“Ere with cold beads of midnight dew” vii 145
“Even as a dragon’s eye that feels the stress” vi 69
Evening of extraordinary splendour, Composed upon
an vi 176
Evening Star over Grasmere Water, To the viii 263
Evening Walk, An i 4
Event in Ancient History, On a celebrated (Two
Sonnets) iv 242
Excursion, The v 1
Expostulation and Reply i 272
Fact, A, and an Imagination vi 130
Faery Chasm, The vi 241
Fancy iv 36
Fancy and Tradition vii 306
Fancy, Hints for the vi 242
Farewell, A ii 324
Farewell Lines vii 155
Farewell (Tour, 1833) vii 341
Farmer of Tilsbury Vale, The ii 147
Far-Terrace, The vii 154
Father, The Childless ii 181
Fathers, Anecdote for i 234
Fermor, Mrs. (Cenotaph) vii 135
Fermor, Mrs. (Elegiac Stanzas) vii 132
Fidelity iii 44
Filial Piety vii 231
Fir Grove (John Wordsworth) iii 66
Fishes in a Vase, Gold and Silver vii 214
Fish-women vi 286
Flamininus, T. Quintius (Two Sonnets) iv 242
Fleming, To the Lady (Rydal Chapel), (Two Poems) vii 109
Floating Island (D. W.) viii 125
Florence (Four Sonnets) viii 78
Flower Garden, A (Coleorton) vii 125
Flowers vi 235
Flowers (Cave of Staffa) vii 378
Flowers in the Island of Madeira viii 177
“Fly, some kind Harbinger, to Grasmere-dale!” ii 419
Foresight, or Children gathering Flowers ii 298
Forms of Prayer at Sea vii 97
Forsaken Indian Woman, Complaint of a i 275
Forsaken, The iii 10
Fort Fuentes vi 328
Fountain, The ii 91
Fox, Mr., Lines composed on the expected death of iv 47
France, Sky-prospect from the Plain of vi 377
Francesco Pozzobonnelli iv 236
French Army in Russia (Two Poems) vi 107
French Clergy, Emigrant vii 101
French Revolution ii 34
French Revolution, In allusion to Histories of the
(Three Sonnets) viii 130
French Royalist, Feelings of a vi 114
Friend, To a (Banks of the Derwent) vii 348
Funeral Service vi 97
Furness Abbey, At viii 168
Furness Abbey, At viii 176
Gemmi, Echo upon the vi 360
General Fast, Upon the late (1832) vii 323
George the Third (November, 1813) iv 282
George the Third, On the death of vi 209
Germans on the Heights of Hockheim, The vi 216
Germany, Written in ii 73
Gillies, Margaret, To (Two Poems) viii 114
Gillies, Margaret viii 306
Gillies, Robert Pearce vi 33
Gipsies iv 65
Glad Tidings vii 15
Gleaner, The vii 202
Glen-Almain, or, The Narrow Glen ii 393
Glencroe, At the Head of vii 295
Glowworm, The viii 231
Goddard, Elegiac Stanzas vi 371
Gold and Silver Fishes in a Vase (Two Poems) vii 214
Goody Blake and Harry Gill i 253
Gordale vi 185
Grace Darling viii 310
Grasmere, Departure from the Vale of (August 1803) ii 377
Grasmere, Home at viii 235
Grasmere, Inscription on the Island at ii 213
Grasmere, Return to ii 419
Grasmere Lake, Composed by the side of iv 73
Grave-stone, A (Worcester Cathedral) vii 201
“Great men have been among us; hands that penned” ii 346
Green, George and Sarah viii 266
Green Linnet, The ii 367
Greenock vii 383
Greta, To the River vii 344
“Grief, thou hast lost an ever ready friend” vi 195
Grotto, Written in a viii 234
Guernica, Oak of iv 245
Guilt and Sorrow i 77
Gunpowder Plot vii 69
Gustavus IV iv 227
Gwerndwffnant, Holiday at viii 284
H. C., Six years old, To ii 351
Hambleton Hills, After a journey across the ii 349
Happy Warrior, Character of the iv 7
Hart-Leap Well ii 128
Hart’s-Horn Tree vii 305
Haunted Tree, The vi 199
Hawkshead, Written as a School Exercise at viii 211
Hawkshead School, In anticipation of leaving i 1
Hawkshead School, Address to the Scholars of ii 84
Haydon, To B. R. vi 61
Haydon, To B. R. (Picture of Napoleon Buonaparte) vii 276
Heidelberg, Castle of (Hymn for Boatmen) vi 301
Helvellyn, To ——, on her first ascent of vi 135
Henry Eighth, Portrait of vii 166
Her eyes are wild i 258
Hermitage (St. Herbert’s Island) ii 210
Hermitage, Near the Spring of the vi 175
Hermit’s Cell, Inscriptions in and near vi 170
Highland Boy, The Blind ii 420
Highland Broach, The vii 310
Highland Girl, To a ii 389
Highland Hut vii 296
Hint from the Mountains vi 156
Hints for the Fancy vi 242
Historian, Plea for the viii 61
Hoffer iv 213
Hogg, James, Extempore Effusion upon the death of viii 24
Holiday at Gwerndwffnant viii 284
Home at Grasmere viii 235
Horn of Egremont Castle, The iv 12
Howard, Mrs., Monument of (Wetheral), (Two
Sonnets) vii 386
Humanity vii 222
Hutchinson, Sarah, To vii 162
Hymn for Boatmen (Heidelberg) vi 301
Hymn, The Labourer’s Noon-day vii 408
I.F., To viii 307
Idiot Boy, The i 283
Illustrated Books and Newspapers viii 184
Illustration (The Jung-Frau) vii 70
Imagination vi 67
Immortality, Ode, Intimations of viii 189
Indian Woman, Complaint of a Forsaken i 275
Infant Daughter, Address to my iii 14
Infant M—— M——, To the vii 170
Infant, The Cottager to her iii 74
Influence Abused vii 26
Influence of Natural Objects ii 66
Influences, Other vii 19
Inglewood Forest, Suggested by a View in vii 304
Inscription for a Monument in Crosthwaite Church
(Southey) viii 157
Inscription for a Stone (Rydal Mount) vii 269
Inscriptions (Coleorton) iv 74
Inscriptions (Hermit’s Cell) vi 170
Installation Ode viii 320
Interdict, An vii 32
Introduction (Ecclesiastical Sonnets) vii 4
Introduction (Prelude) iii 132
Invasion, Lines on the expected ii 437
Inversneyde ii 389
Invocation to the Earth vi 95
Iona (Two Sonnets) vii 379
Iona, The Black Stones of vii 381
Isle of Man (Two Sonnets) vii 362
Isle of Man, At Bala-Sala vii 365
Isle of Man, At Sea off the vii 359
Isle of Man, By the Sea-shore vii 361
Isle of Man (Douglas Bay) vii 360
Italian Itinerant, The vi 338
Italy, After leaving (Two Sonnets) viii 84
“It is no Spirit who from heaven hath flown” ii 375
“I watch, and long have watched, with calm regret” vi 197
Jedborough, The Matron of ii 414
Jewish Family, A vii 195
Joanna, To ii 157
Joanna H., Lines addressed to viii 282
Joan of Kent, Warrant for Execution of vii 60
Jones, Rev. Robert vi 257
Journey Renewed vi 257
June, 1820 vi 214
Jung-Frau, The, and the Fall of the Rhine vii 70
Kendal, Upon hearing of the death of the Vicar of vi 40
Kendal and Windermere Railway, On the projected viii 166
Kent, To the Men of (October, 1803) ii 434
Kilchurn Castle, Address to ii 400
Killicranky, In the Pass of ii 435
King’s College Chapel, Cambridge, Inside of (Three
Sonnets) vii 106
Kirkstone, The Pass of vi 158
Kirtle, The Braes of ii 124
Kitten and Falling Leaves, The iii 16
Laborer’s Noon-day Hymn, The vii 408
Lady, To a, upon Drawings she had made of Flowers in
Madeira viii 177
Lady E. B., and the Hon. Miss P., To the vii 128
Lamb, Charles, Written after the death of viii 17
Lancaster Castle, Suggested by the view of viii 103
Langdale, Epitaph in the Chapel-yard of viii 120
Laodamia vi 1
Last of the Flock, The i 279
Last Supper, by Leonardo da Vinci, The vi 343
Latimer and Ridley vii 61
Latitudinarianism vii 76
Laud vii 71
Leonardo da Vinci, The Last Supper vi 343
Lesbia viii 32
Liberty (Gold and Silver Fishes) vii 216
Liberty (Tyrolese Sonnets) iv 214
Liberty, Obligations of Civil to Religious vii 81
Liege, Between Namur and vi 293
Lines, composed a few miles above Tintern Abbey ii 51
Lines composed on the expected death of Mr. Fox iv 47
Lines, Farewell vii 155
Lines left upon a Seat in a Yew-tree i 108
Lines on the expected Invasion, 1803 ii 437
Lines suggested by a Portrait from the Pencil of F.
Stone (Two Poems) viii 1
Lines written as a School Exercise at Hawkshead viii 211
Lines written in Early Spring i 268
Lines written in the Album of the Countess of Lonsdale viii 8
Lines written upon a Stone, upon one of the Islands at
Rydal ii 63
Lines written upon hearing of the death of the late
Vicar of Kendal vi 40
Lines written while sailing in a Boat at Evening i 32
Liturgy, The vii 88
Loch Etive, Composed in the Glen of vii 291
Lombardy, In viii 83
London, Written in (1802), (Two Sonnets) ii 344
Longest Day, The vi 153
Long Meg and her Daughters vii 390
Lonsdale, The Countess of (Album) viii 8
Lonsdale, To the Earl of v 20
Lonsdale, To the Earl of vii 392
Louisa ii 362
Love, The Birth of viii 215
Love lies bleeding (Two Poems) viii 148
Loving and Liking vii 320
Lowther vii 391
Lowther, To the Lady Mary vi 211
Lucca Giordano viii 183
Lucy Gray; or, Solitude ii 99
Lucy (Three Poems) ii 78
Lucy (Three years she grew) ii 81
Lycoris, Ode to (Two Poems) vi 145
M. H., To ii 167
Madeira, Flowers in the Island of viii 177
Malham Cove vi 184
Manse, On the sight of a (Scotland) vii 286
March, Written in ii 293
Margaret ——, The Affliction of iii 7
Mariner, By a Retired vii 364
“Mark the concentred hazels that enclose” vi 71
Marriage Ceremony vii 94
Marriage of a Friend, Composed on the Eve of the iv 276
Marshall, To Cordelia vii 400
Mary Queen of Scots, Captivity of vi 191
Mary Queen of Scots, Lament of vi 162
Mary Queen of Scots (Workington) vii 349
Maternal Grief iv 248
Matron of Jedborough, The ii 414
Matthew ii 87
May Morning, Composed on (1838) viii 97
May Morning, Ode composed on vii 146
May, To vii 148
Meditation vii 401
Memory vii 117
“Men of the Western World!” viii 112
Mental Affliction viii 36
Merry England vii 343
Michael ii 215
Michael Angelo, From the Italian of (Three Sonnets) iii 380
Michael Angelo, Translation from viii 265
“Milton! thou should’st be living at this hour” ii 346
Missions and Travels vii 23
Monasteries, Dissolution of the (Three Sonnets) vii 52
Monasteries, Saxon vii 22
Monastery, Cistertian vii 37
Monastery of Old Bangor vii 13
Monastic Power, Abuse of vii 50
Monastic Voluptuousness vii 51
Monkhouse, Mary vii 170
Monks and Schoolmen vii 39
Monument of Mrs. Howard (Two Sonnets) vii 386
Monument (Long Meg and her Daughters) vii 390
Moon, The (The Shepherd, looking eastward) vi 68
Moon, The (With how sad steps, O Moon) iv 38
Moon (The Crescent-moon, the Star of Love) viii 127
Moon, The (Sea-side) viii 13
Moon, The (Rydal) viii 15
Moon, The (Who but is pleased to watch) viii 184
Moon, The (How beautiful the Queen of Night) viii 188
Moon, The (Once I could hail) vii 152
Morning Exercise, A vii 178
Mosgiel Farm (Burns) vii 383
Mother, The Mad i 258
Mother’s Return, The iv 63
Mountains, Hint from the vi 156
Mull, In the Sound of vii 293
Music, Power of iv 20
Mutability vii 100
Naming of Places, Poems on the ii 153
Namur and Liege, Between vi 293
Natural Objects, Influence of ii 66
“Near Anio’s stream, I spied a gentle Dove” viii 65
Needlecase in the form of a Harp, On seeing a vii 157
Negro Woman ii 342
Newspaper, Composed after reading a vii 290
Nightingale, The vi 214
Nightingale, The Cuckoo and the ii 250
Night Piece, A i 227
Night-thought, A viii 88
Nith, On the Banks of ii 383
Norman Boy, The viii 132
Norman Conquest, The vii 28
North Wales, Composed among the Ruins of a Castle
in vii 131
Nortons, The Fate of the iv 100
November, 1806 iv 49
November, 1813 iv 282
November 1 (1815) vi 63
Nunnery vii 388
Nun’s Well, Brigham vii 347
Nutting ii 70
Oak and the Broom, The ii 174
Oak of Guernica iv 245
Octogenarian, To an viii 185
Ode, Installation viii 320
Ode, Vernal vi 138
Ode (Who rises on the Banks of Seine) vi 104
Ode (1814) (When the soft hand) vi 96
Ode (1815) (Imagination—ne’er before content) vi 88
Ode, The Morning of the Day of Thanksgiving vi 74
Ode to Duty iii 37
Ode to Lycoris (Two Poems) vi 145
Ode composed on May Morning vii 146
Ode, Intimations of Immortality viii 189
Oker Hill in Darley Dale, A Tradition of vii 230
“O Nightingale! thou surely art” iv 67
“On Nature’s invitation do I come” ii 118
Open Prospect vi 243
Ossian, Written in a blank leaf of Macpherson’s vii 373
Our Lady of the Snow vi 318
Oxford, May 30, 1820 (Two Sonnets) vi 213
Painter, To a (Two Sonnets) viii 114
Palafox iv 222
Palafox iv 228
Palafox iv 240
Papal Abuses vii 33
Papal Dominion vii 34
Papal Power vii 36
Papal Unity vii 42
Parrot and the Wren, The vii 141
Parsonage in Oxfordshire, A vi 217
Pastoral Character vii 87
Patriotic Sympathies vii 74
Paulinus vii 15

You might also like