Python 3 Object Oriented Programming 3rd Edition Dusty Phillips [Dusty Phillips] download
Python 3 Object Oriented Programming 3rd Edition Dusty Phillips [Dusty Phillips] download
https://textbookfull.com/product/python-3-object-oriented-
programming-3rd-edition-dusty-phillips-dusty-phillips/
https://textbookfull.com/product/swift-3-object-oriented-
programming-gaston-c-hillar/
https://textbookfull.com/product/deep-learning-in-python-an-
object-oriented-programming-1st-edition-hong-m-lei-lei/
https://textbookfull.com/product/android-programming-the-big-
nerd-ranch-guide-2nd-edition-bill-phillips/
https://textbookfull.com/product/programming-in-c-object-
oriented-features-1st-edition-laxmisha-rai/
Surgical Instrumentation Nancymarie Phillips
https://textbookfull.com/product/surgical-instrumentation-
nancymarie-phillips/
https://textbookfull.com/product/astrophysics-for-dummies-
cynthia-phillips/
https://textbookfull.com/product/c-programming-an-object-
oriented-approach-1e-ise-behrouz-a-forouzan/
https://textbookfull.com/product/the-american-challenge-reader-
michael-phillips/
https://textbookfull.com/product/object-oriented-programming-
with-simotion-fundamentals-program-examples-and-software-
concepts-according-to-iec-61131-3-1st-edition-michael-braun/
Python 3 Object-Oriented Programming
Third Edition
Dusty Phillips
BIRMINGHAM - MUMBAI
Python 3 Object-Oriented
Programming Third Edition
Copyright © 2018 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, without the prior written permission of the publisher, except in the case of brief
quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information
presented. However, the information contained in this book is sold without warranty, either express or implied.
Neither the author, nor Packt Publishing or its dealers and distributors, will be held liable for any damages
caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products
mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the
accuracy of this information.
ISBN 978-1-78961-585-2
www.packt.com
mapt.io
Mapt is an online digital library that gives you full access to over
5,000 books and videos, as well as industry leading tools to help you
plan your personal development and advance your career. For more
information, please visit our website.
Why subscribe?
Spend less time learning and more time coding with practical
eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
developers and tech professionals, just like you, to help them share
their insight with the global tech community. You can make a
general application, apply for a specific hot topic that we are
recruiting an author for, or submit your own idea.
Table of Contents
Title Page
Packt Upsell
Why subscribe?
Packt.com
Contributors
Conventions used
Get in touch
Reviews
1. Object-Oriented Design
Introducing object-oriented
Composition
Inheritance
Multiple inheritance
Case study
Exercises
Summary
2. Objects in Python
Adding attributes
Making it do something
Talking to yourself
More arguments
Explaining yourself
Organizing modules
Absolute imports
Relative imports
Third-party libraries
Case study
Exercises
Summary
Basic inheritance
Extending built-ins
Polymorphism
Abstract base classes
Exercises
Summary
Handling exceptions
The exception hierarchy
Exercises
Summary
Manager objects
Removing duplicate code
In practice
Case study
Exercises
Summary
Dataclasses
Dictionaries
Counter
Lists
Sorting lists
Sets
Exercises
Summary
7. Python Object-Oriented Shortcuts
Python built-in functions
Enumerate
File I/O
Placing it in context
Exercises
Summary
8. Strings and Serialization
Strings
String manipulation
String formatting
Escaping braces
f-strings can contain Python code
Matching patterns
Matching a selection of characters
Escaping characters
Matching multiple characters
Serializing objects
Customizing pickles
Serializing web objects
Case study
Exercises
Summary
9. The Iterator Pattern
List comprehensions
Set and dictionary comprehensions
Generator expressions
Generators
Strategy in Python
The state pattern
A state example
State versus strategy
Summary
12. Testing Object-Oriented Programs
Why test?
Test-driven development
Unit testing
Assertion methods
Reducing boilerplate and cleaning up
Organizing and running tests
Implementing it
Exercises
Summary
13. Concurrency
Threads
The many problems with threads
Shared memory
The global interpreter lock
Thread overhead
Multiprocessing
Multiprocessing pools
Queues
AsyncIO
AsyncIO in action
Reading an AsyncIO Future
Executors
AsyncIO clients
Case study
Exercises
Summary
Along the way, we'll learn how to integrate the object-oriented and
the not-so-object-oriented aspects of the Python programming
language. We will learn the complexities of string and file
manipulation, emphasizing the difference between binary and textual
data.
We'll then cover the joys of unit testing, using not one, but two unit
testing frameworks. Finally, we'll explore, through Python's various
concurrency paradigms, how to make objects work well together at
the same time.
creating and using objects. We will see how to wrap data using
properties and restrict data access. This chapter also discusses the
DRY principle and how not to repeat code.
Once the file is downloaded, please make sure that you unzip or
extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://githu
. In case
b.com/PacktPublishing/Python-3-Object-Oriented-Programming-Third-Edition
We also have other code bundles from our rich catalog of books and
videos available at https://github.com/PacktPublishing/. Check them out!
Conventions used
There are a number of text conventions used throughout this book.
Piracy: If you come across any illegal copies of our works in any
form on the Internet, we would be grateful if you would provide us
with the location address or website name. Please contact us at
copyright@packt.com with a link to the material.
[pg 387]
§ 5. Names of Gods tabooed.
Primitive man creates his gods in his own image. Xenophanes remarked
long ago that the complexion of negro gods was black and their noses flat;
f that Thracian gods were ruddy and blue-eyed; and that if horses, oxen, and
lions only believed in gods and had hands wherewith to portray them, they
would doubtless fashion their deities in the form of horses, and oxen, and
lions.1441 Hence just as the furtive savage conceals his real name because he
fears that sorcerers might make an evil use of it, so he fancies that his gods
must likewise keep their true names secret, lest other gods or even men
f
should learn the mystic sounds and thus be able to conjure with them.
Nowhere was this crude conception of the secrecy and magical virtue of the
divine name more firmly held or more fully developed than in ancient Egypt,
where the superstitions of a dateless past were embalmed in the hearts of
the people hardly less effectually than the bodies of cats and crocodiles and
the rest of the divine menagerie in their rock-cut tombs. The conception is
well illustrated by a story which tells how the subtle Isis wormed his secret
name from Ra, the great Egyptian god of the sun. Isis, so runs the tale, was
a woman mighty in words, and she was weary of the world of men, and
yearned after the world of the gods. And she meditated in her heart, saying,
“Cannot I by virtue of the great name of Ra make myself a goddess and
reign like him in heaven and earth?” For Ra had many names, but the great
name which gave him all power over gods and men was known to none but
himself. Now the god was by this time grown old; he slobbered at the
mouth and his spittle fell upon the ground. So Isis gathered up the spittle
and the earth with it, and kneaded thereof a serpent and laid it in the path
where the great god passed every day to his double kingdom after his
heart's desire. And when he came forth according to his wont, attended by
all his company of gods, the sacred serpent [pg 388] stung him, and the
god opened his mouth and cried, and his cry went up to heaven. And the
company of gods cried, “What aileth thee?” and the gods shouted, “Lo and
behold!” But he could not answer; his jaws rattled, his limbs shook, the
poison ran through his flesh as the Nile floweth over the land. When the
great god had stilled his heart, he cried to his followers, “Come to me, O my
children, offspring of my body. I am a prince, the son of a prince, the divine
seed of a god. My father devised my name; my father and my mother gave
me my name, and it remained hidden in my body since my birth, that no
magician might have magic power over me. I went out to behold that which
I have made, I walked in the two lands which I have created, and lo!
something stung me. What it was, I know not. Was it fire? was it water? My
heart is on fire, my flesh trembleth, all my limbs do quake. Bring me the
children of the gods with healing words and understanding lips, whose
power reacheth to heaven.” Then came to him the children of the gods, and
they were very sorrowful. And Isis came with her craft, whose mouth is full
of the breath of life, whose spells chase pain away, whose word maketh the
dead to live. She said, “What is it, divine Father? what is it?” The holy god
opened his mouth, he spake and said, “I went upon my way, I walked after
my heart's desire in the two regions which I have made to behold that
which I have created, and lo! a serpent that I saw not stung me. Is it fire? is
it water? I am colder than water, I am hotter than fire, all my limbs sweat, I
tremble, mine eye is not steadfast, I behold not the sky, the moisture
bedeweth my face as in summer-time.” Then spake Isis, “Tell me thy name,
divine Father, for the man shall live who is called by his name.” Then
answered Ra, “I created the heavens and the earth, I ordered the
mountains, I made the great and wide sea, I stretched out the two horizons
like a curtain. I am he who openeth his eyes and it is light, and who
shutteth them and it is dark. At his command the Nile riseth, but the gods
know not his name. I am Khepera in the morning, I am Ra at noon, I am
Tum at eve.” But the poison was not taken away from him; it pierced
deeper, and the great god could no longer walk. Then said Isis to him, “That
was [pg 389] not thy name that thou spakest unto me. Oh tell it me, that
the poison may depart; for he shall live whose name is named.” Now the
poison burned like fire, it was hotter than the flame of fire. The god said, “I
consent that Isis shall search into me, and that my name shall pass from my
breast into hers.” Then the god hid himself from the gods, and his place in
the ship of eternity was empty. Thus was the name of the great god taken
from him, and Isis, the witch, spake, “Flow away poison, depart from Ra. It
is I, even I, who overcome the poison and cast it to the earth; for the name
of the great god hath been taken away from him. Let Ra live and let the
poison die.” Thus spake great Isis, the queen of the gods, she who knows
Ra and his true name.1442
Thus we see that the real name of the god, with which his power was
inextricably bound up, was supposed to be lodged, in an almost physical
sense, somewhere in his breast, from which it could be extracted by a sort
of surgical operation and transferred with all its supernatural powers to the
breast of another. In Egypt attempts like that of Isis to appropriate the
power of a high god by possessing herself of his name were not mere
legends told of the mythical beings of a remote past; every Egyptian
magician aspired to wield like powers by similar means. For it was believed
that he who possessed the true name possessed the very being of god or
man, and could force even a deity to obey him as a slave obeys his master.
Thus the art of the magician consisted in obtaining from the gods a
revelation of their sacred names, and he left no stone unturned to
f accomplish his end. When once a god in a moment of weakness or
forgetfulness had imparted to the wizard the wondrous lore, the deity had
no choice but to submit humbly to the man or pay the penalty of his
contumacy.1443 [pg 390] In one papyrus we find the god Typhon thus
adjured: “I invoke thee by thy true names, in virtue of which thou canst not
refuse to hear me”; and in another the magician threatens Osiris that if the
god does not do his bidding he will name him aloud in the port of Busiris.1444
So in the Lucan the Thessalian witch whom Sextus Pompeius consulted
before the battle of Pharsalia threatens to call up the Furies by their real
names if they will not do her bidding.1445 In modern Egypt the magician still
works his old enchantments by the same ancient means; only the name of
the god by which he conjures is different. The man who knows “the most
great name” of God can, we are told, by the mere utterance of it kill the
living, raise the dead, transport himself instantly wherever he pleases, and
perform any other miracle.1446 Similarly among the Arabs of North Africa at
the present day “the power of the name is such that when one knows the
proper names the jinn can scarcely help answering the call and obeying;
they are the servants of the magical names; in this case the incantation has
a constraining quality which is for the most part very strongly marked. When
Ibn el Hâdjdj et-Tlemsânî relates how the jinn yielded up their secrets to
him, he says, ‘I once met the seven kings of the jinn in a cave and I asked
them to teach me the way in which they attack men and women, causing
them to fall sick, smiting them, paralysing them, and the like. They all
answered me: “If it were anybody but you we would teach that to nobody,
but you have discovered the bonds, the spells, and the names which compel
us; were it not for the names by which you have constrained us, we would
not have answered to your call.” ’ ”1447 So, too, “the Chinese of ancient times
were dominated by the notion that beings are intimately associated with
their names, so that a man's knowledge of the name of a spectre might
enable him to exert power over the latter and to bend it to his will.”1448
[pg 391]
The belief in the magic virtue of divine names was shared by the Romans.
When they sat down before a city, the priests addressed the guardian deity
of the place in a set form of prayer or incantation, inviting him to abandon
the beleaguered city and come over to the Romans, who would treat him as
well as or better than he had ever been treated in his old home. Hence the
name of the guardian deity of Rome was kept a profound secret, lest the
enemies of the republic might lure him away, even as the Romans
themselves had induced many gods to desert, like rats, the falling fortunes
of cities that had sheltered them in happier days.1449 Nay, the real name, not
merely of its guardian deity, but of the city itself, was wrapt in mystery and
might never be uttered, not even in the sacred rites. A certain Valerius
Soranus, who dared to divulge the priceless secret, was put to death or
came to a bad end.1450 In like manner, it seems, the ancient Assyrians were
forbidden to mention the mystic names of their cities;1451 and down to
modern times the Cheremiss of the Caucasus keep the names of their
communal villages secret from motives of superstition.1452
If the reader has had the patience to follow this long and perhaps tedious
examination of the superstitions attaching to personal names, he will
probably agree that the mystery in which the names of royal personages are
so often shrouded is no isolated phenomenon, no arbitrary expression of
f courtly servility and adulation, but merely the particular application of a
general law of primitive thought, which includes within its scope common
folk and gods as well as kings and priests.
[pg 392]
§ 6. Common Words tabooed.
But personal names are not the only words which superstitious fears have
banished from everyday use. In many cases similar motives forbid certain
persons at certain times to call common things by common names, thus
obliging them either to refrain from mentioning these things altogether or to
designate them by special terms or phrases reserved for such occasions. A
consideration of these cases follows naturally on an examination of the
taboos imposed upon personal names; for personal names are themselves
very often ordinary terms of the language, so that an embargo laid on them
necessarily extends to many expressions current in the commerce of daily
life. And though a survey of some of the interdicts on common words is not
strictly necessary for our immediate purpose, it may serve usefully to
complete our view of the transforming influence which superstition has
exercised on language. I shall make no attempt to subject the examples to a
searching analysis or a rigid classification, but will set them down as they
come in a rough geographical order. And since my native land furnishes as
apt instances of the superstition as any other, we may start on our round
from Scotland.
In the Atlantic Ocean, about six leagues to the west of Gallon Head in the
Lewis, lies a small group of rocky islets known as the Flannan Islands.
Sheep and wild fowl are now their only inhabitants, but remains of what are
described as Druidical temples and the title of the Sacred Isles given them
by Buchanan suggest that in days gone by piety or superstition may have
found a safe retreat from the turmoil of the world in these remote solitudes,
where the dashing of the waves and the strident scream of the sea-birds are
almost the only sounds that break the silence. Once a year, in summer-time,
the inhabitants of the adjacent lands of the Lewis, who have a right to these
islands, cross over to them to fleece their sheep and kill the wild fowl for the
sake both of their flesh and their feathers. They regard the islands as
invested with a certain sanctity, and have been heard to say that none ever
yet landed in them but found himself more [pg 393] disposed to devotion
there than anywhere else. Accordingly the fowlers who go thither are
bound, during the whole of the time that they ply their business, to observe
very punctiliously certain quaint customs, the transgression of which would
be sure, in their opinion, to entail some serious inconvenience. When they
have landed and fastened their boat to the side of a rock, they clamber up
into the island by a wooden ladder, and no sooner are they got to the top,
than they all uncover their heads and make a turn sun-ways round about,
thanking God for their safety. On the biggest of the islands are the ruins of a
chapel dedicated to St. Flannan. When the men come within about twenty
paces of the altar, they all strip themselves of their upper garments at once
and betake themselves to their devotions, praying thrice before they begin
fowling. On the first day the first prayer is offered as they advance towards
the chapel on their knees; the second is said as they go round the chapel;
and the third is said in or hard by the ruins. They also pray thrice every
evening, and account it unlawful to kill a fowl after evening prayers, as also
to kill a fowl at any time with a stone. Another ancient custom forbids the
crew to carry home in the boat any suet of the sheep they slaughter in the
islands, however many they may kill. But what here chiefly concerns us is
that so long as they stay on the islands they are strictly forbidden to use
certain common words, and are obliged to substitute others for them. Thus
it is absolutely unlawful to call the island of St. Kilda, which lies thirty
leagues to the southward, by its proper Gaelic name of Hirt; they must call
it only “the high country.” They may not so much as once name the islands
in which they are fowling by the ordinary name of Flannan; they must speak
only of “the country.” “There are several other things that must not be called
by their common names: e.g. visk, which in the language of the natives
signifies water, they call burn; a rock, which in their language is creg, must
here be called cruey, i.e. hard; shore in their language expressed by
claddach, must here be called vah, i.e. a cave; sour in their language is
expressed gort, but must here be called gaire, i.e. sharp; slippery, which is
expressed bog, must be called soft; and several other things to this [pg
394] purpose.”1453 When Highlanders were in a boat at sea, whether sailing
or fishing, they were forbidden to call things by the names by which they
were known on land. Thus the boat-hook should not be called a croman, but
a chliob; a knife not sgian, but “the sharp one” (a ghiar); a seal not ròn, but
“the bald beast” (béisd mhaol); a fox not sionnach, but “the red dog”
(madadh ruadh); the stone for anchoring the boat not clach, but “hardness”
(cruaidh). This practice now prevails much more on the east coast than on
the west, where it may be said to be generally extinct. It is reported to be
carefully observed by the fishermen about the Cromarty Firth.1454 Among the
words tabooed by fishermen in the north of Scotland when they are at sea
are minister, salmon, hare, rabbit, rat, pig, and porpoise. At the present day
if some of the boats that come to the herring-fishing at Wick should meet a
salmon-boat from Reay in Caithness, the herring-men will not speak to, nor
even look at, the salmon-fishers.1455
The natives of Siberia are unwilling to call a bear a bear; they speak of him
as “the little old man,” “the master of the forest,” “the sage,” “the respected
one.” Some who are more familiar style him “my cousin.”1477 The
f Kamtchatkans reverence the whale, the bear, and the wolf from fear, and
never mention their names when they meet them, believing that they
understand human speech.1478 Further, they [pg 399] think that mice also
understand the Kamtchatkan language; so in autumn, when they rob the
field-mice of the bulbs which these little creatures have laid up in their
burrows as a store against winter, they call everything by names different
from the ordinary ones, lest the mice should know what they were saying.
Moreover, they leave odds and ends, such as old rags, broken needles,
cedar-nuts, and so forth, in the burrows, to make the mice think that the
transaction has been not a robbery but a fair exchange. If they did not do
that, they fancy that the mice would go and drown or hang themselves out
of pure vexation; and then what would the Kamtchatkans do without the
mice to gather the bulbs for them? They also speak kindly to the animals,
and beg them not to take it ill, explaining that what they do is done out of
pure friendship.1479 The Cherokee Indians regard the rattlesnake as a
superior being and take great pains not to offend him. They never say that
a man has been bitten by a snake but that he has been “scratched by a
briar.” In like manner, when an eagle has been shot for a ceremonial dance,
it is announced that “a snowbird has been killed.” The purpose is to deceive
the spirits of rattlesnakes or eagles which might be listening.1480 The
Esquimaux of Bering Strait think that some animals can hear and
understand what is said of them at a distance. Hence, when a hunter is
going out to kill bears he will speak of them with the greatest respect and
give out that he is going to hunt some other beast. Thus the bears will be
deceived and taken unawares.1481 Among the Esquimaux of Baffin Land,
women in mourning may not mention the names of any animals.1482 Among
the Thompson Indians of British Columbia, children may not name the
coyote or prairie wolf in winter, lest he should turn on his back and so bring
cold weather.1483
[pg 400]
The Arabs call a man who has been bitten by a snake “the sound one”;
leprosy or the scab they designate “the blessed disease”; the left side they
name “the lucky side”; they will not speak of a lion by his right name, but
refer to him as for example “the fox.”1484 In Africa the lion is alluded to with
f
the same ceremonious respect as the wolf and the bear in northern Europe
and Asia. The Arabs of Algeria, who hunt the lion, speak of him as Mr. John
Johnson (Johan-ben-el-Johan), because he has the noblest qualities of man
and understands all languages. Hence, too, the first huntsman to catch sight
of the beast points at him with his finger and says, “He is not there”; for if
he were to say “He is there,” the lion would eat him up.1485 Except under
dire necessity the Waziguas of eastern Africa never mention the name of the
lion from fear of attracting him. They call him “the owner of the land” or
“the great beast.”1486 The negroes of Angola always use the word ngana
(“sir”) in speaking of the same noble animal, because they think that he is
“fetish” and would not fail to punish them for disrespect if they omitted to
do so.1487 Bushmen and Bechuanas both deem it unlucky to speak of the
lion by his proper name; the Bechuanas call him “the boy with the
beard.”1488 During an epidemic of smallpox in Mombasa, British East Africa, it
was noticed that the people were unwilling to mention the native name
(ndui) of the disease. They referred to it either as “grains of corn” (tete) or
simply as “the bad disease.”1489 So the Chinese of Amoy are averse to speak
of fever by its proper name; they prefer to call it “beggar's disease,” hoping
thereby to make the demons of fever imagine that they despise it and that
therefore it would be useless to attack them.1490 Some of the natives of
Nigeria [pg 401] dread the owl as a bird of ill omen and are loth to mention
its name, preferring to speak of it by means of a circumlocution such as “the
bird that makes one afraid.”1491 The Herero think that if they see a snake
and call it by its name, the reptile will sting them, but that if they call it a
strap (omuvia) it will lie still.1492 When Nandi warriors are out on an
expedition, they may not call a knife a knife (chepkeswet); they must call it
“an arrow for bleeding cattle” (loñget); and none of the party may utter the
usual word employed in greeting males.1493 In Madagascar there seems to
be an aversion to pronouncing the word for lightning (vàratra); the word for
mud (fòtaka) is sometimes substituted for it.1494 Again, it is strictly forbidden
to mention the word for crocodile (màmba) near some rivers of Madagascar;
and if clothes should be wetted in certain other rivers of the island, you may
not say that they are wet (lèna); you must say that they are on fire (may)
or that they are drinking water (misòtro ràno).1495 A certain spirit, who used
to inhabit a lake in Madagascar, entertained a rooted aversion to salt, so
that whenever the thing was carried past the lake in which he resided it had
to be called by another name, or it would all have been dissolved and lost.
The persons whom he inspired had to veil their references to the obnoxious
article under the disguise of “sweet peppers.”1496 In a West African story we
read of a man who was told that he would die if ever the word for salt was
pronounced in his hearing. The fatal word was pronounced, and die he did
sure enough, but he soon came to life again with the help of a magical
wooden pestle of which he was the lucky possessor.1497
In India the animals whose names are most commonly tabooed are the
snake and the tiger, but the same tribute of respect is paid to other beasts
f also. Sayids and Mussulmans [pg 402] of high rank in northern India say
that you should never call a snake by its proper name, but always describe
it either as a tiger (sher) or a string (rassi).1498 In Telingana the euphemistic
name for a snake, which should always be employed, is worm or insect
(purugu); if you call a cobra by its proper name, the creature will haunt you
for seven years and bite you at the first opportunity.1499 Ignorant Bengalee
women will not mention a snake or a thief by their proper names at night,
for fear that one or other might appear. When they have to allude to a
serpent, they call it “the creeping thing”; when they speak of a thief, they
say “the unwelcome visitor.”1500 Other euphemisms for the snake in northern
India are “maternal uncle” and “rope.” They say that if a snake bites you,
you should not mention its name, but merely observe “A rope has touched
me.”1501 Natives of Travancore are careful not to speak disrespectfully of
serpents. A cobra is called “the good lord” (nalla tambiran) or “the good
snake” (nalla pambu). While the Malayalies of the Shervaray Hills are
hunting the tiger, they speak of the beast only as “the dog.”1502 The
Canarese of southern India call the tiger either “the dog” or “the jackal”;
they think that if they called him by his proper name, he would be sure to
carry off one of them.1503 The jungle people of northern India, who meet the
tiger in his native haunts, will not pronounce his name, but speak of him as
“the jackal” (gídar), or “the beast” (janwar), or use some other euphemistic
term. In some places they treat the wolf and the bear in the same
fashion.1504 The Pankas of South Mirzapur will not name the tiger, bear,
camel, or donkey by their proper names; the camel they call “long neck.”
Other tribes of the same district only scruple to mention certain animals in
the morning. Thus, the Kharwars, a Dravidian tribe, will not name a pig,
squirrel, hare, jackal, bear, monkey, or donkey in the morning hours; if [pg
403] they have to allude to these animals at that time, they call them by
special names. For instance, they call the hare “the four-footed one” or “he
that hides in the rocks”; while they speak of the bear as jigariya, which
being interpreted means “he with the liver of compassion.” If the Bhuiyars
are absolutely obliged to refer to a monkey or a bear in the morning, they
speak of the monkey as “the tree-climber” and the bear as “the eater of
white ants.” They would not mention a crocodile. Among the Pataris the
matutinal title of the bear is “the hairy creature.”1505 The Kols, a Dravidian
race of northern India, will not speak of death or beasts of prey by their
proper names in the morning. Their name for the tiger at that time of day is
“he with the claws,” and for the elephant “he with the teeth.”1506 The forests
of the Sundarbans, the district at the mouth of the Ganges, are full of man-
eating tigers and the annual loss of life among the woodcutters is heavy.
Here accordingly the ferocious animal is not called a tiger but a jackal
(çial).1507
In Annam the fear inspired by tigers, elephants, and other wild animals
induces the people to address these creatures with the greatest respect as
f “lord” or “grandfather,” lest the beasts should take umbrage and attack
them.1508 The tiger reigns supreme in the forests of Tonquin and Cochin-
China, and the peasants honour him as a maleficent deity. In talking of him
they always call him ong, which means monsieur or grandfather. They are
convinced that if they dared to speak of him disrespectfully, he would
avenge the insult.1509 In Siam there are many people who would never
venture to utter the words tiger or crocodile in a spot where these terrible
creatures might be in hiding, lest [pg 404] the sound of their names should
attract the attention of the beasts towards the speakers.1510 When the
Malays of Patani Bay in Siam are in the jungle and think there is a tiger near,
they will either speak of him in complimentary terms as the “grandfather of
the woods” or only mention him in a whisper.1511 In Laos, while a man is out
hunting elephants he is obliged to give conventional names to all common
objects, which creates a sort of special language for elephant-hunters.1512 So
when the Chams and Orang-Glaï of Indo-China are searching for the
precious eagle-wood in the forest, they must employ an artificial jargon to
designate most objects of everyday life; thus, for example, fire is called “the
red,” a she-goat becomes “a spider,” and so on. Some of the terms which
compose the jargon are borrowed from the dialects of neighbouring
tribes.1513 When the Mentras or aborigines of Malacca are searching for what
they call gaharu (lignum aloes) they are obliged to use a special language,
avoiding the words in ordinary use. At such times they call gaharu by the
name of tabak, and they speak of a snake as “the long animal” and of the
elephant as “the great animal.” They have also to observe a number of
other taboos, particularly in the matter of diet. If a man has found a
promising gaharu tree, and on going home dreams that the guardian spirit
of the tree (hantu gaharu) demands a human victim as the price of his
property, the dreamer will try next day to catch somebody asleep and to
smear his forehead with lime. This is a sign to the guardian spirit of the
tree, who accordingly carries away the soul of the sleeper to the land of the
dead by means of a fever or other ailment, whereas the original dreamer
gets a good supply of aloes wood.1514
[pg 405]
At certain seasons of the year parties of Jakuns and Binuas go out to seek
for camphor in the luxuriant forests of their native country, which is the
narrow southern extremity of the Malay Peninsula, the Land's End of Asia.
They are absent for three or four months together, and during the whole of
this time the use of the ordinary Malay language is forbidden to them, and
they have to speak a special language called by them the bassa kapor
(camphor language) or pantang1515 kapur. Indeed not only have the
searchers to employ this peculiar language, but even the men and women
who stay at home in the villages are obliged to speak it while the others are
away looking for the camphor. They believe that a spirit presides over the
camphor trees, and that without propitiating him they could not obtain the
precious gum; the shrill cry of a species of cicada, heard at night, is
supposed to be the voice of the spirit. If they failed to employ the camphor
language, they think that they would have great difficulty in finding the
camphor trees, and that even when they did find them the camphor would
not yield itself up to the collector. The camphor language consists in great
part of words which are either Malayan or of Malay origin; but it also
contains many words which are not Malayan but are presumed to be
remains of the original Jakun dialects now almost extinct in these districts.
The words derived from Malayan are formed in many cases by merely
substituting a descriptive phrase for the common term. Thus instead of rice
they say “grass fruit”; instead of gun they say “far sounding”; the epithet
“short-legged” is substituted for hog; hair is referred to as “leaves,” and so
on.1516 So when the Battas or Bataks of Sumatra have gone out to search for
camphor, they must abandon the speech of daily life as soon as they reach
the camphor [pg 406] forest. For example, if they wish to speak of the
forest they may not use the ordinary word for it (hoetan), but must call it
kerrengettetdoeng. When they have fixed on a spot in which to try their
luck, they set up a booth and clear a space in front of it to serve as a place
of sacrifice. Here, after summoning the camphor spirit (berroe ni kapoer) by
playing on a flute, they offer sacrifice to him repeatedly. Then they lie down
to dream of the place where camphor is to be found. If this succeeds, the
leader goes and chooses the tree. When it has been cut down to the
accompaniment of certain spells or incantations, one of the men runs and
wraps the top of the fallen tree in a garment to prevent the camphor from
escaping from the trunk before they have secured it. Then the tree is cleft
and split up in the search for the camphor crystals, which are to be found in
the fibres of the wood.1517 Similarly, when the Kayans of Borneo are
searching for camphor, they talk a language invented solely for their use at
this time. The camphor itself is never mentioned by its proper name, but is
always referred to as “the thing that smells”; and all the tools employed in
collecting the drug receive fanciful names. Unless they conform to this rule
they suppose that the camphor crystals, which are found only in the
crevices of the wood, will elude them.1518 The Malanau tribes of Borneo
observe the same custom very strictly, believing that the crystals would
immediately dissolve if they spoke anything but the camphor language. For
example, the common Malanau word for “return” is muli, but in presence of
a camphor tree they say beteku. Again, “to hide” is palim in the Malanau
language, but when they are looking for camphor they say krian. In like
manner, all common names for implements and food are exchanged for
others. In some tribes the camphor-seekers may never mention the names
of chiefs and influential men; [pg 407] if they broke this rule, they would
find no camphor in the trees.1519
In the western states of the Malay Peninsula the chief industry is tin-mining,
and odd ideas prevail among the natives as to the nature and properties of
the ore. They regard it as alive and growing, sometimes in the shape of a
buffalo, which makes its way from place to place underground. Ore of
inferior quality is excused on the score of its tender years; it will no doubt
improve as it grows older. Not only is the tin believed to be under the
protection and command of certain spirits who must be propitiated, but it is
even supposed to have its own special likes and dislikes for certain persons
and things. Hence the Malays deem it advisable to treat tin ore with respect,
to consult its convenience, nay, to conduct the business of mining in such a
way that the ore may, as it were, be extracted without its own knowledge.
When such are their ideas about the mineral it is no wonder that the miners
scruple to employ certain words in the mines, and replace them by others
which are less likely to give offence to the ore or its guardian spirits. Thus,
for example, the elephant must not be called an elephant but “the tall one
who turns himself about”; and in like manner special words, different from
those in common use, are employed by the miners to designate the cat, the
buffalo, the snake, the centipede, tin sand, metallic tin, and lemons. Lemons
are particularly distasteful to the spirits; they may not be brought into the
mines.1520 Again, the Malay wizard, who is engaged in snaring pigeons with
the help of a decoy-bird and a calling-tube, must on no account call things
by their common names. The tiny conical hut, in which he sits waiting for
the wild pigeons to come fluttering about him, goes by the high-sounding
name of the Magic Prince, perhaps with a delicate allusion to its noble
inmate. The calling-tube is known as Prince [pg 408] Distraction, doubtless
on account of the extraordinary fascination it exercises on the birds. The
decoy-pigeon receives the name of the Squatting Princess, and the rod with
a noose at the end of it, which serves to catch the unwary birds, is disguised
under the title of Prince Invitation. Everything, in fact, is on a princely scale,
so far at least as words can make it so. The very nooses destined to be
slipped over the necks or legs of the little struggling prisoners are dignified
by the title of King Solomon's necklaces and armlets; and the trap into
which the birds are invited to walk is variously described as King Solomon's
Audience Chamber, or a Palace Tower, or an Ivory Hall carpeted with silver
and railed with amalgam. What pigeon could resist these manifold
attractions, especially when it is addressed by the respectful title of Princess
Kapor or Princess Sarap or Princess Puding?1521 Again, the fisher-folk on the
east coast of the Malay Peninsula, like their brethren in Scotland, are
reluctant to mention the names of birds or beasts while they are at sea. All
animals then go by the name of cheweh, a meaningless word which is
believed not to be understood by the creatures to whom it refers. Particular
kinds of animals are distinguished by appropriate epithets; the pig is “the
grunting cheweh,” the buffalo is “the cheweh that says uak,” the snipe is
“the cheweh that cries kek-kek,” and so on.1522 In this respect the fishermen
of Patani Bay class together sea spirits, Buddhist monks, beasts, and
reptiles; these are all cheweh and their common names may not be
mentioned at sea. But, curiously enough, they lay no such embargo on the
names of fish and birds, except the vulture and domestic fowls and ducks.
At sea the vulture is named “bald head,” the tiger “striped,” the snake
“weaver's sword,” the horse “fast,” and a species of monkey “long tail.” The
human foot is called “tortoise,” and a Buddhist monk “yellow” on account of
the colour of his robe. These Malay fishermen are at least as unwilling to
speak of a Buddhist monk at sea as Scotch fishermen are to mention a
minister in similar circumstances. If one of them mentions a monk, his
mates will fall on him and beat him; whereas for other slips of the tongue
they [pg 409] think it enough to throw a little bilge-water over the back of
the transgressor and to say, “May the ill-luck be dismissed!” The use of this
special language is even more obligatory by night than by day. On shore the
fishermen make very merry over those lubberly landsmen who cannot talk
correctly at sea.1523 In like manner Achinese fishermen, in northern Sumatra,
employ a special vocabulary when they are at sea. Thus they may not call a
mountain a mountain, or mountain-high billows would swamp the boat; they
refer to it as “high ground.” They may not speak of an elephant by its
proper name of gadjah, but must call it pò meurah. If a man wishes to say
that something is clear, he must not use the ordinary word for clear (lheuëh)
because it bears the meaning also of “free,” “loose”; and the utterance of
such a word might enable the fish to get free from the net and escape.
Instead of lheuëh he must therefore employ the less dangerous synonym
leungka. In like manner, we are told, among the fishermen of the north
coast of Java whole lists of words might be compiled which are tabooed at
sea and must be replaced by others.1524
In Sumatra the spirits of the gold mines are treated with as much deference
as the spirits of the tin-mines in the Malay Peninsula. Tin, ivory, and the like
f may not be brought by the miners to the scene of their operations, for at
the scent of such things the spirits of the mine would cause the gold to
vanish. For the same reason it is forbidden to refer to certain things by their
proper names, and in speaking of them the miners must use other words. In
some cases, for example in removing the grains of the gold, a deep silence
must be observed; no commands may be given or questions asked,1525
probably because the removal of the precious metal is regarded as a theft
which the spirits would punish if they caught the thieves in the act. Certainly
the [pg 410] Dyaks believe that gold has a soul which seeks to avenge itself
on men who dig the precious metal. But the angry spirit is powerless to
harm miners who observe certain precautions, such as never to bathe in a
river with their faces turned up stream, never to sit with their legs dangling,
and never to tie up their hair.1526 Again, a Sumatran who fancies that there
is a tiger or a crocodile in his neighbourhood, will speak of the animal by the
honourable title of “grandfather” for the purpose of propitiating the
creature.1527 In the forest a Karo-Batak refers to a tiger as “Grandfather to
whom the wood belongs,” “he with the striped coat,” or “the roving trap.”1528
Among the Gayos of Sumatra it is forbidden to mention the name of small-
pox in the house of a man who is suffering from the disease; and the words
for ugly, red, stinking, unlucky, and so forth are forbidden under the same
circumstances. The disease is referred to under the title of “prince of the
averters of misfortune.”1529 So long as the hunting season lasts, the natives
of Nias may not name the eye, the hammer, stones, and in some places the
sun by their true names; no smith may ply his trade in the village, and no
person may go from one village to another to have smith's work done for
him. All this, with the exception of the rule about not naming the eye and
the sun, is done to prevent the dogs from growing stiff, and so losing the
power of running down the game.1530 During the rice-harvest in Nias the
reapers seldom speak to each other, and when they do so, it is only in
whispers. Outside the field they must speak of everything by names
different from those in common use, which gives rise to a special dialect or
jargon known as “field speech.” It has been observed that some of the
words in this jargon [pg 411] resemble words in the language of the Battas
of Sumatra.1531 While these rice-reapers of Nias are at work they may not
address each other by their names; they must use only such general terms
as “man,” “woman,” “girl,” “old man,” and “old woman.” The word for “fire”
may not pass their lips; instead of it they must use the word for “cold.”
Other words tabooed to them during the harvest are the words for “smoke”
and “stone.” If a reaper wishes to ask another for his whetstone to sharpen
his knife, he must speak of it as a “fowl's egg.”1532 In Java when people
suspect that a tiger or crocodile is near, they avoid the use of the proper
name of the beast and refer to him as “the old lord” or “grandfather.”
Similarly, men who are watching a plantation to protect it from wild boars
speak of these animals as “handsome men” (wong bagus). When after
harvest the unhusked rice is to be brought into the barn, the barn is not
called a barn but “the dark store-house.” Serious epidemics may not be
mentioned by their true names; thus smallpox is called the “pretty girl” (lara
bagus). The Javanese are particularly careful to eschew certain common
words at evening or night. Thus the snake is then called a “tree-root”; the
venomous centipede is referred to as the “red ant”; oil is spoken of as
“water”; and so forth. And when leaves and herbs are being gathered for
use in medicine they are regularly designated by other than their ordinary
names.1533
When a Bugineese or Macassar man is at sea and sailing past a place which
he believes to be haunted by evil spirits, he keeps as quiet as he can; but if
he is obliged to speak he designates common things and actions, such as
water, wind, fire, cooking, eating, the rice-pot, and so forth, by peculiar
terms which are neither Bugineese nor Macassar, and therefore cannot be
understood by the evil spirits, whose knowledge of languages is limited to
these two tongues. However, according to another and later account given
by the same authority, it appears that many of the substituted terms are
merely figurative expressions or descriptive phrases borrowed from the
ordinary language. Thus the word for water is replaced by a rare word
meaning “rain”; a rice-pot is called a “black man”; boiled rice is “one who is
eaten”; a fish is a “tree-leaf”; a fowl is “one who lives in a poultry hatch”;
and an ape is a “tree-dweller.”1537 Natives of the island of Saleyer, which lies
off the south coast of [pg 414] Celebes, will not mention the name of their
island when they are making a certain sea-passage; and in sailing they will
never speak of a fair wind by its proper name. The reason in both cases is a
fear of disturbing the evil spirits.1538 When natives of the Sapoodi
Archipelago, to the north-east of Java, are at sea they will never say that
they are near the island of Sapoodi, for if they did so they would be carried
away from it by a head wind or by some other mishap.1539 When Galelareese
sailors are crossing over to a land that is some way off, say one or two days'
sail, they do not remark on any vessels that may heave in sight or any birds
that may fly past; for they believe that were they to do so they would be
driven out of their course and not reach the land they are making for.
Moreover, they may not mention their own ship, or any part of it. If they
have to speak of the bow, for example, they say “the beak of the bird”;
starboard is named “sword,” and larboard “shield.”1540 The inhabitants of
Ternate and of the Sangi Islands deem it very dangerous to point at distant
objects or to name them while they are at sea. Once while sailing with a
crew of Ternate men a European asked one of them the name of certain
small islands which they had passed. The man had been talkative before,
but the question reduced him to silence. “Sir,” he said, “that is a great
taboo; if I told you we should at once have wind and tide against us, and
perhaps suffer a great calamity. As soon as we come to anchor I will tell you
the name of the islands.” The Sangi Islanders have, besides the ordinary
language, an ancient one which is only partly understood by some of the
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com