File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -392,6 +392,12 @@ Glossary
392392 the :term: `EAFP ` approach and is characterized by the presence of many
393393 :keyword: `if ` statements.
394394
395+ In a multi-threaded environment, the LBYL approach can risk introducing a
396+ race condition between "the looking" and "the leaping". For example, the
397+ code, ``if key in mapping: return mapping[key] `` can fail if another
398+ thread removes *key * from *mapping * after the test, but before the lookup.
399+ This issue can be solved with locks or by using the EAFP approach.
400+
395401 list
396402 A built-in Python :term: `sequence `. Despite its name it is more akin
397403 to an array in other languages than to a linked list since access to
Original file line number Diff line number Diff line change @@ -112,8 +112,6 @@ Example of calling the parser on a command string::
112112
113113 >>> cmd = 'deploy sneezy.example.com sleepy.example.com -u skycaptain'
114114 >>> result = parser.parse_args(cmd.split())
115-
116- >>> # parsed variables are stored in the attributes
117115 >>> result.action
118116 'deploy'
119117 >>> result.targets
You can’t perform that action at this time.
0 commit comments