Mastering Python 50 Specific Tips For Writing Better Code Practical Strategies For Writing Highquality Python Code Dane Olsen instant download
Mastering Python 50 Specific Tips For Writing Better Code Practical Strategies For Writing Highquality Python Code Dane Olsen instant download
https://ebookbell.com/product/mastering-python-50-specific-tips-
for-writing-better-code-practical-strategies-for-writing-
highquality-python-code-dane-olsen-53193304
https://ebookbell.com/product/mastering-python-50-specific-tips-for-
writing-better-code-practical-strategies-for-writing-highquality-
python-code-dane-olsen-232014530
https://ebookbell.com/product/mastering-python-scripting-for-system-
administrators-ganesh-sanjiv-naik-46242670
https://ebookbell.com/product/mastering-python-networking-utilize-
python-packages-and-frameworks-for-network-automation-monitoring-
cloud-4th-edition-4th-eric-chou-47552224
https://ebookbell.com/product/mastering-python-rick-van-hattem-igor-
milovanovi-49052754
Mastering Python Design Patterns 1st Edition Sakis Kasampalis
https://ebookbell.com/product/mastering-python-design-patterns-1st-
edition-sakis-kasampalis-50950844
https://ebookbell.com/product/mastering-python-3-programming-ultimate-
guide-to-learn-python-coding-fundamentals-and-realworld-applications-
subburaj-ramasamy-58472654
https://ebookbell.com/product/mastering-python-design-patterns-craft-
essential-python-patterns-by-following-core-design-principles-3rd-
edition-3rd-edition-kamon-ayeva-58477706
https://ebookbell.com/product/mastering-python-networking-advanced-
networking-with-python-chou-20640390
https://ebookbell.com/product/mastering-python-for-finance-2nd-
edition-james-ma-weiming-22246756
Mastering Python: 50 Specific Tips
for Writing Better Code
- Dane Olsen
ISBN: 9798865196815
Ziyob Publishers.
Mastering Python: 50 Specific Tips
for Writing Better Code
Practical Strategies for Writing High-Quality Python Code
Table of Contents
Chapter 1:
Introduction
1. The Zen of Python
2. Pythonic thinking
Chapter 2:
Pythonic thinking
1. Know your data structures
Tuples
Lists
Dictionaries
Sets
Arrays
Queues
Stacks
Heaps
Trees
Graphs
Chapter 3:
Functions
1. Function basics
2. Function design
Chapter 4:
Classes and Objects
1. Class basics
Creating and using classes
Defining instance methods
Using instance variables
Understanding class vs instance data
Using slots for memory optimization
Understanding class inheritance
Using multiple inheritance
2. Class design
Chapter 5:
Concurrency and Parallelism
1. Threads and Processes
Understanding coroutines
Using asyncio for I/O-bound tasks
Using asyncio for CPU-bound tasks
Using asyncio with third-party libraries
Debugging asyncio code
Chapter 6:
Built-in Modules
1. Collections
Using namedtuple
Using deque
Using defaultdict
Using OrderedDict
Using Counter
Using ChainMap
Using UserDict
Using UserList
Using UserString
2. Itertools
Using count, cycle, and repeat
Using chain, tee, and zip_longest
Using islice, dropwhile, and takewhile
Using groupby
Using starmap and product
Using datetime
Using time
Using timedelta
Using pytz
Using dateutil
Using json
Using pickle
Using shelve
Using dbm
Using SQLite
6. Testing and Debugging
Chapter 7:
Collaboration and Development
1. Code Quality
Using linters
Using type checkers
Using code formatters
Using docstring conventions
Writing maintainable code
2. Code Reviews
Conducting effective code reviews
Giving and receiving feedback
Improving code quality through reviews
3. Collaboration Tools
Writing documentation
Using Sphinx
Packaging Python projects
Distributing Python packages
Managing dependencies
Chapter 1:
Introduction
Python is a popular, high-level programming language that is widely
used for web development, scientific computing, artificial intelligence,
data analysis, and many other applications. It is a versatile and
powerful language that offers a lot of flexibility and ease of use to
developers. However, like any other programming language, writing
effective and efficient Python code requires a good understanding of
the language's features and best practices.
"Effective Python: 50 Specific Ways to Write Better Python" is a
comprehensive guide that focuses on providing readers with specific
tips and techniques to improve their Python coding skills. The book
covers a wide range of topics, including data structures, functions,
classes, concurrency, testing, and debugging. Each topic is
presented in a clear and concise manner, with practical examples and
explanations that help readers understand the concepts better.
The book is divided into 50 chapters, each of which covers a specific
aspect of Python programming. The chapters are organized in a
logical and progressive order, with each chapter building upon the
previous one. This makes it easy for readers to follow along and
learn at their own pace.
One of the strengths of the book is its focus on practical examples.
The author, Brett Slatkin, is an experienced Python developer who
has worked at Google for many years. He draws upon his experience
to provide readers with real-world examples that illustrate the
concepts he is explaining. This makes it easy for readers to
understand how the concepts apply to real-world programming
situations.
Another strength of the book is its emphasis on best practices. The
author provides readers with tips and techniques that are widely
accepted as best practices within the Python community. This helps
readers to write code that is more efficient, more maintainable, and
easier to understand.
One of the unique features of the book is its focus on Python 3.
Python 3 is the latest version of the language, and it has many new
features and improvements over Python 2. The author recognizes that
many developers still use Python 2, but he encourages readers to
move to Python 3, as it is a more modern and robust language.
Overall, "Effective Python: 50 Specific Ways to Write Better Python"
is an excellent resource for anyone who wants to improve their
Python coding skills. Whether you are a beginner or an experienced
developer, this book provides valuable insights and techniques that
can help you write better Python code. It is a must-read for anyone
who wants to become a more proficient Python programmer.
Pythonic thinking
Pythonic thinking refers to writing code that is idiomatic and natural to
the Python language. It involves using the language's features and
syntax in a way that is efficient, elegant, and easy to read. In this
note, we will discuss some key principles of Pythonic thinking and
demonstrate them with suitable code examples.
Using list comprehensions instead of loops:
List comprehensions are a concise and efficient way to create new
lists by applying a function to each element of an existing list. They
are more Pythonic than using for-loops with append statements to
create a new list. Here is an example:
Output:
15
4.0
Using generator expressions instead of list comprehensions:
Generator expressions are a memory-efficient way to generate
values on-the-fly. They are more Pythonic than list comprehensions
when you are working with large datasets. Here is an example:
1000000
<generator object <genexpr> at
0x7f9367040b30>
Using context managers for resource management:
Context managers provide a convenient way to manage resources
such as files, sockets, and database connections. They are more
Pythonic than using try/finally blocks to ensure that resources are
properly released. Here is an example:
2023-03-13 13:44:55.881958
Chapter 2:
Pythonic thinking
# Slicing a tuple
mytuple = (1, 2, 3, 4, 5)
print(mytuple[1:3]) # Output: (2, 3)
Unpacking a tuple:
Tuples can be unpacked into multiple variables.
# Unpacking a tuple
mytuple = (1, 2, 3)
a, b, c = mytuple
print(a) # Output: 1
print(b) # Output: 2
print(c) # Output: 3
Concatenating tuples:
Tuples can be concatenated using the + operator.
# Concatenating tuples
tuple1 = (1, 2, 3)
tuple2 = (4, 5, 6)
newtuple = tuple1 + tuple2
print(newtuple) # Output: (1, 2, 3, 4, 5, 6)
Using tuples as keys in dictionaries
Since tuples are immutable, they can be used
as keys in dictionaries.
python
Copy code
# Using tuples as keys in dictionaries
mydict = {(1, 2): 'value1', (3, 4): 'value2'}
print(mydict[(1, 2)]) # Output: 'value1'
print(mydict[(3, 4)]) # Output: 'value2'
In summary, tuples are an essential data structure in Pythonic
thinking, and they can be used for a wide range of applications. They
are particularly useful for grouping related data together, and their
immutability makes them ideal for use as keys in dictionaries or as
elements in sets.
Lists
In Pythonic thinking, it is crucial to know the available data structures
and how to use them effectively. One of the most commonly used
data structures in Python is the list. A list is an ordered collection of
elements that can be of any data type. Lists are mutable, which
means their elements can be changed once they are created. Lists
are typically used for storing data that can be modified or changed.
Here are some examples of lists and how to use them:
Creating a list:
Lists can be created using square brackets [] or the list() function.
# Slicing a list
mylist = [1, 2, 3, 4, 5]
print(mylist[1:3]) # Output: [2, 3]
Modifying list elements:
Since lists are mutable, their elements can be modified.
# Sorting a list
mylist = [4, 2, 3, 1, 5]
mylist.sort()
print(mylist) # Output: [1, 2, 3, 4, 5]
sortedlist = sorted(mylist, reverse=True)
print(sortedlist) # Output: [5, 4, 3, 2, 1]
Dictionaries
# Combining sets
set1 = {1, 2, 3, 4}
set2 = {3, 4, 5, 6}
union_set = set1.union(set2)
print(union_set) # Output: {1, 2, 3, 4, 5, 6}
intersection_set = set1.intersection(set2)
print(intersection_set) # Output: {3, 4}
difference_set = set1.difference(set2)
print(difference_set) # Output: {1, 2}
Checking if a set is a subset or superset:
To check if a set is a subset or superset of another set, you can use
the issubset() and issuperset() methods.
import numpy as np
# Performing element-wise computations
myarr = arr.array('f', [1.0, 2.0, 3.0, 4.0, 5.0])
myarr = np.square(myarr)
print(myarr) # Output: array([ 1., 4., 9., 16.,
25.], dtype=float32)
Converting arrays to lists:
Arrays can be converted to lists using the tolist() method.
Queues
print(len(myqueue)) # Output: 3
In summary, queues are a useful data structure in Python for tasks
that require a collection of elements to be processed in a first-in, first-
out order. They can be implemented using the built-in deque class
from the collections module or using the Queue class from the queue
module. To add elements to a queue, we can use the append()
method of the deque class or the put() method of the Queue class.
To remove elements from a queue, we can use the popleft() method
of the deque class or the get() method of the Queue class. Finally,
we can check the size of a queue using the len() function.
Stacks
# Creating a stack
mystack = []
Adding elements to a stack:
We can add elements to a stack using the append() method of the list
class.
import heapq
# Creating a heap
myheap = [3, 1, 4, 1, 5, 9, 2, 6, 5]
heapq.heapify(myheap)
Alternatively, we can use the heappush() function of the heapq
module to add elements to an empty heap.
import heapq
# Creating a heap
myheap = []
heapq.heappush(myheap, 3)
heapq.heappush(myheap, 1)
heapq.heappush(myheap, 4)
heapq.heappush(myheap, 1)
heapq.heappush(myheap, 5)
heapq.heappush(myheap, 9)
heapq.heappush(myheap, 2)
heapq.heappush(myheap, 6)
heapq.heappush(myheap, 5)
Getting the minimum element from a heap:
To get the minimum element from a heap, we can use the heappop()
function of the heapq module.
import heapq
# Getting the minimum element from a heap
myheap = [3, 1, 4, 1, 5, 9, 2, 6, 5]
heapq.heapify(myheap)
print(heapq.heappop(myheap)) # Output: 1
print(heapq.heappop(myheap)) # Output: 1
Adding elements to a heap:
We can add elements to a heap using the heappush() function of the
heapq module.
import heapq
# Adding elements to a heap
myheap = [3, 1, 4, 1, 5, 9, 2, 6, 5]
heapq.heapify(myheap)
heapq.heappush(myheap, 0)
heapq.heappush(myheap, 7)
print(myheap) # Output: [0, 1, 2, 3, 5, 9, 4, 6,
5, 7]
Checking the size of a heap:
We can check the size of a heap using the len() function.
import heapq
# Checking the size of a heap
myheap = [3, 1, 4, 1, 5, 9, 2, 6, 5]
heapq.heapify(myheap)
print(len(myheap)) # Output: 9
In summary, heaps are a useful data structure in Python for efficiently
maintaining the minimum (or maximum) element in a collection of
elements. They can be implemented using the heapq module. To
create a heap, we can use the heapify() function of the heapq module
to convert a list into a heap, or we can use the heappush() function to
add elements to an empty heap. To get the minimum element from a
heap, we can use the heappop() function. Finally, we can check the
size of a heap using the len() function.
Trees
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
# Creating a tree
root = Node(1)
root.left = Node(2)
root.right = Node(3)
root.left.left = Node(4)
root.left.right = Node(5)
Traversing a tree:
To traverse a tree in Python, we can use recursive functions to visit
each node in the tree in a specific order. Here are three common
ways to traverse a tree:
Inorder traversal: Visit the left subtree, then the current node, then
the right subtree.
def inorder(node):
if node is not None:
inorder(node.left)
print(node.data)
inorder(node.right)
# Inorder traversal of the tree
inorder(root)
Preorder traversal: Visit the current node, then the left subtree, then
the right subtree.
def preorder(node):
if node is not None:
print(node.data)
preorder(node.left)
preorder(node.right)
# Preorder traversal of the tree
preorder(root)
Postorder traversal: Visit the left subtree, then the right subtree, then
the current node.
def postorder(node):
if node is not None:
postorder(node.left)
postorder(node.right)
print(node.data)
# Postorder traversal of the tree
postorder(root)
Finding elements in a tree:
To find an element in a tree in Python, we can use a recursive
function to traverse the tree and search for the element.
class Node:
def __init__(self, data):
self.data = data
self.neighbors = []
# Creating a graph
A = Node('A')
B = Node('B')
C = Node('C')
D = Node('D')
E = Node('E')
F = Node('F')
G = Node('G')
H = Node('H')
A.neighbors = [B, C, D]
B.neighbors = [A, E]
C.neighbors = [A, F]
D.neighbors = [A, G, H]
E.neighbors = [B]
F.neighbors = [C]
G.neighbors = [D, H]
H.neighbors = [D, G]
Traversing a graph:
To traverse a graph in Python, we can use a recursive function to visit
each node in the graph in a specific order. Here are two common
ways to traverse a graph:
Depth-first search (DFS): Visit the current node, then recursively visit
each of its neighbors.
def bfs(node):
visited = set()
queue = [node]
visited.add(node)
while queue:
curr_node = queue.pop(0)
print(curr_node.data)
for neighbor in curr_node.neighbors:
if neighbor not in visited:
visited.add(neighbor)
queue.append(neighbor)
# BFS traversal of the graph
bfs(A)
Finding paths in a graph:
To find a path between two nodes in a graph in Python, we can use a
recursive function to traverse the graph and search for the path. We
can use either DFS or BFS to perform the traversal.
Language: English
Miss Bertha Kent walked back the gravel trail from the dressing
room. The early morning sun was bright and warm, but she held her
woolen robe tight across her throat. She tried to avoid looking at the
other camps—at the sleepy-eyed women coming out of tents, and
the men starting morning fires in the stone rings.
Bitterness was etched in acid in her soul. She made herself believe it
was because she hated Yosemite. The vacation had been such a
disappointment. She had expected so much and—as usual—it had all
gone wrong.
Her hope had been so high when school closed; this year was going
to be different!
"Are you going anywhere this summer?" Miss Emmy asked after the
last faculty meeting in June.
"To Yosemite for a couple of weeks, I think."
"The Park's always crowded. You ought to meet a nice man up
there, Bertha."
"I'm not interested in men," Miss Kent had replied frostily. "I'm a
botany teacher and it helps me professionally if I spend part of the
summer observing the phenomenon of nature."
"Don't kid me, Bertha. You can drop the fancy lingo, too; school's
out. You want a man as much as I do."
That was true, Miss Kent admitted—in the quiet of her own mind.
Never aloud; never to anyone else. Six years ago, when Bertha Kent
had first started to teach, she had been optimistic about it. She
wanted to marry; she wanted a family of her own—instead of
wasting her lifetime in a high school classroom playing baby sitter
for other people's kids. She had saved her money for all sorts of
exotic summer vacations—tours, cruises, luxury hotels—but
somehow something always went wrong.
To be sure, she had met men. She was pretty; she danced well; she
was never prudish; she liked the out-of-doors. All positive qualities:
she knew that. The fault lay always with the men. When she first
met a stranger, everything was fine. Then, slowly, Miss Kent began
to see his faults. Men were simply adult versions of the muscle-
bound knot-heads the administration loaded into her botany classes.
Bertha Kent wanted something better, an ideal she had held in her
mind since her childhood. The dream-man was real, too. She had
met him once and actually talked to him when she was a child. She
couldn't remember where; she couldn't recall his face. But the
qualities of his personality she knew as she did her own heart. If
they had existed once in one man, she would find them again,
somewhere. That was the miracle she prayed for every summer.
She thought the miracle had happened again when she first came to
Yosemite.
She found an open campsite by the river. While she was putting up
her tent, the man from the camp beside hers came to help. At first
he seemed the prototype of everything she hated—a good-looking,
beautifully co-ordinated physical specimen, as sharp-witted as a
jellyfish. The front of his woolen shirt hung carelessly unbuttoned.
She saw the mat of dark hair on his chest, the sculpted curves of
sun-tanned muscle. No doubt he considered himself quite attractive.
Then, that evening after the fire-fall, the young man asked her to go
with him to the ranger's lecture at Camp Curry. Bertha discovered
that he was a graduate physicist, employed by a large, commercial
laboratory. They had at least the specialized area of science in
common. By the time they returned from the lecture, they were
calling each other by first names. The next day Walt asked her to
hike up the mist trail with him to Nevada Falls.
The familiar miracle began to take shape. She lay awake a long time
that night, looking at the dancing pattern of stars visible through the
open flap of her tent. This was it; Walt was the reality of her dream.
She made herself forget that every summer for six years the same
thing had happened. She always believed she had found her miracle;
and always something happened to destroy it.
For two days the idyll lasted. The inevitable awakening began the
afternoon they drove along the Wawona highway to see the
Mariposa Grove of giant sequoias. They left their car in the parking
area and walked through the magnificent stand of cathedral trees.
The trail was steep and sometimes treacherous. Twice Walt took her
arm to help her. For some reason that annoyed her; finally she told
him,
"I'm quite able to look after myself, Walt."
"So you've told me before."
"After all, I've been hiking most of my life. I know exactly what to do
—"
"There isn't much you can't take care of for yourself, is there,
Bertha?" His voice was suddenly very cold.
"I'm not one of these rattle-brained clinging vines, if that's what you
mean. I detest a woman who is always yelping to a man for help."
"Independence is one thing, Bertha; I like that in a woman. But
somehow you make a man feel totally inadequate. You set yourself
up as his superior in everything."
"That's nonsense, Walt. I'm quite ready to grant that you know a
good deal more about physics than I do."
"Say it right, Bertha. You respect the fact that I hold a PhD." He
smiled. "That isn't the same thing as respecting me for a person. I
knew you didn't need my help on the trail, but it was a normal
courtesy to offer it. It seems to me it would be just as normal for
you to accept it. Little things like that are important in relations
between people."
"Forget it, Walt." She slipped her hand through his. "There, see? I'll
do it just the way you want."
She was determined not to quarrel over anything so trivial, though
what he said seemed childish and it tarnished the dream a little. But
the rest was still good; the miracle could still happen.
Yet, in spite of all her effort, they disagreed twice more before they
left the Mariposa Grove. Bertha began to see Walt as he was:
brilliant, no doubt, in the single area of physical science, but
basically no different from any other man. She desperately wished
that she could love him; she earnestly wished that the ideal, fixed so
long in her mind, might be destroyed.
But slowly she saw the miracle slip away from her. That night, after
the fire-fall, Walt did not ask her to go with him to the lecture.
Miserable and angry, Bertha Kent went into her tent, but not to
sleep.
She lay staring at the night sky, and thinking how ugly the pin-point
lights of distant suns were on the velvet void. As the hours passed,
she heard the clatter of pans and voices as people at the other
campsites retired. She heard Walt when he returned, whistling
tunelessly. He banged around for nearly an hour in the camp next to
hers. He dropped a stack of pans; he overturned a box of food; he
tripped over a tent line. She wondered if he were drunk. Had their
quarreling driven him to that? Walt must have loved her, then.
After a time all the Coleman lanterns in the camp were out. Still
Bertha Kent did not sleep. The acid grief and bitterness tormented
her with the ghost of another failure, another shattered dream. She
listened to the soft music of the flowing stream, the gentle whisper
of summer wind in the pines, but it gave her no peace.
Suddenly she heard quiet footsteps and the crackling of twigs behind
her tent. She was terrified. It must be Walt. If he had come home
drunk, he could have planned almost any kind of violence by way of
revenge.
The footsteps moved closer. Bertha shook off the paralysis of fear
and reached for her electric lantern. She flashed the beam into the
darkness. She saw the black bulk of a bear who was pawing through
her food box.
She was so relieved she forgot that a bear might also be a legitimate
cause of fear. She ran from the tent, swinging the light and shooing
the animal away as she would have chased a puppy. The bear
swung toward her, roaring and clawing at the air. She backed away.
The bear swung its paws again, and her food box shattered on the
ground, in a crescendo of sound.
Bertha heard rapid footsteps under the pines. In the pale moonlight
she saw Walt. He was wearing only a pair of red-striped boxer
shorts. He was swinging his arms and shouting, but the noise of the
falling box had already frightened the bear away.
Walt stood in the moonlight, smiling foolishly.
"I guess I came too late," he said.
"I'm quite sure the bear would have left of its own accord, Walt.
They're always quite tame in the national parks, you know." As soon
as she said it, she knew it was a mistake. Even though he had done
nothing, it would have cost her little to thank him. The words had
come instinctively; she hadn't thought how her answer would affect
him. Walt turned on his heel stiffly and walked back to his tent.
With a little forethought—a little kindness—Bertha might even then
have rescued her miracle. She knew that. She knew she had lost him
now, for good. For the first time in her life she saw the dream as a
barrier to her happiness, not an ideal. It held her imprisoned; it gave
her nothing in exchange.
She slept fitfully for the rest of the night. As soon as the sun was up,
she pulled on her woolen robe and went to the dressing room to
wash. She walked back along the gravel path, averting her eyes
from the other camps and the men hunched over the smoking
breakfast fires. She hated Yosemite. She hated all the people
crowded around her. She had made up her mind to pack her tent
and head for home. This was just another vacation lost, another
year wasted.
She went into her tent and put on slacks and a bright, cotton blouse.
Then she sat disconsolate at her camp table surveying the mess the
bear had made of her food box. There was nothing that she could
rescue. She could drive to the village for breakfast, but the shops
wouldn't open for another hour.
Behind her she heard Walt starting his Coleman stove. Yesterday he
would have offered her breakfast; now he'd ignored her. All along
the stream camp fires were blazing in the stone rings. Bertha
wondered if she could ask the couple on the other side of her
campsite for help. They had attempted to be friendly once before,
and Bertha hadn't responded with a great deal of cordiality. They
weren't the type she liked—a frizzy-headed, coarse-voiced blonde,
and a paunchy old man who hadn't enough sense to know what a
fool he looked parading around camp in the faded bathing trunks he
wore all day.
Suddenly a light flashed in Bertha's face. A metal shovel slid out of
nothingness and deposited a tiny, rectangular box on the table. For a
long minute she stared at the box stupidly, vaguely afraid. Her mind
must be playing her tricks. Such things didn't happen.
She reached out timidly and touched the box. It seemed real
enough. A miniature radio of some sort, with a two-inch speaker.
She turned the dials. She heard a faint humming.
The coarse-voiced blonde came toward the table.
"We just heard what happened last night, Miss Kent," she said. "Me
and George. About the bear, I mean."
Bertha forced a smile. "It made rather a shambles, didn't it?"
"Gee, you can't make breakfast out of a mess like this. Why don't
you come and eat with us?"
The blonde went on talking, apologizing for what she was serving
and at the same time listing it with a certain pride. Strangely, Miss
Kent heard not one voice, but two. The second came tinnily from the
little box on the table,
"You poor, dried-up old maid. That guy who's been hanging around
would have been over long before this, if you knew the first thing
about being nice to a man."
Bertha gasped. "Really, if that's the way you feel—"
"Why, honey, I just asked you over for breakfast," the blonde
answered; at the same time the voice from the machine said,
"I suppose George and me ain't good enough for you. O.K. by me,
sister. I didn't really want you to come anyway."
Trembling, Miss Kent stood up. "I've never been so insulted!"
"What's eating you, Miss Kent?" The blonde seemed genuinely
puzzled, but again the voice came from the plastic box,
"The old maid's off her rocker. You'd think she was reading my
mind."
Switching her trim little hips, the blonde walked back to her own
camp. Bertha Kent dropped numbly on the bench, staring at the ugly
box. "Reading my mind," the woman had said. Somehow the
machine had done precisely that, translating the blonde's spoken
words into the real, emotional meaning behind them. It was a
terrifying gadget. Bertha was hypnotized by its potential horror—like
the brutal, devastating truth spoken by a child.
A camper walked past on the road, waving at Miss Kent and calling
out a cheerful good morning. But again the machine read the real
meaning behind the pleasant words.
"So you've finally lost your man, Miss Kent. The way you dished out
the orders, it's a wonder he stayed around as long as he did. And a
pity: you're an attractive woman. You should make some man a
good wife."
They all thought that. The whole camp had been watching her,
laughing at her. Bertha felt helpless and alone. She needed—wanted
—someone else; it surprised her when she faced that fact.
Then it dawned on her: the camper was right; the blonde was right.
She had lost Walt through her own ridiculous bull-headedness. In
order to assert herself. To be an individualist, she had always
thought. And what did that matter, if it imposed this crushing
loneliness?
For a moment a kind of madness seized her. It was the diabolical
machine that was tormenting her, not the truth it told. She snatched
a piece of her broken food box and struck at the plastic case blindly.
There was a splash of fire; the gadget broke.
She saw Walt look up from his stove. She saw him move toward her.
But she stood paralyzed by a shattering trauma of pain. The voice
still came from the speaker, and this time it was her own. Her mind
was stripped naked; she saw herself whole, unsheltered by the
protective veneer of rationalization.
And she knew the pattern of the dream-man she had loved since her
childhood; she knew why the dream had been self-defeating.
For the idealization was her own father. That impossible paragon
created by the worship of a child.
The shock was its own cure. She was too well-balanced to accept
the tempting escape of total disorientation. Grimly she fought back
the tide of madness, and in that moment she found maturity. She
ran toward Walt, tears of gratitude in her eyes. She felt his arms
around her, and she clung to him desperately.
"I was terrified; I needed you, Walt; I never want to be alone
again."
"Needed me?" he repeated doubtfully.
"I love you." After a split-second's hesitation, she felt his lips warm
on hers.
From the corner of her eye she saw a chute dart out of nowhere and
scoop up the broken plastic box from the camp table. They both
vanished again. That was a miracle, too, she supposed; but not
nearly as important as hers.
Then the reason of a logical mind asserted its own form of realism:
of course, none of it had happened. The mind-reading gadget had
been a device created in her own subconscious, a psychological trick
to by-pass the dream that had held her imprisoned. She knew
enough psychology to understand that.
She ran her fingers through Walt's dark hair and repeated softly,
"I love you, Walt Gordon."
Updated editions will replace the previous one—the old editions will
be renamed.
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside the
United States, check the laws of your country in addition to the
terms of this agreement before downloading, copying, displaying,
performing, distributing or creating derivative works based on this
work or any other Project Gutenberg™ work. The Foundation makes
no representations concerning the copyright status of any work in
any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if you
provide access to or distribute copies of a Project Gutenberg™ work
in a format other than “Plain Vanilla ASCII” or other format used in
the official version posted on the official Project Gutenberg™ website
(www.gutenberg.org), you must, at no additional cost, fee or
expense to the user, provide a copy, a means of exporting a copy, or
a means of obtaining a copy upon request, of the work in its original
“Plain Vanilla ASCII” or other form. Any alternate format must
include the full Project Gutenberg™ License as specified in
paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.
ebookbell.com