Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
fa8dd5f4
Commit
fa8dd5f4
authored
Aug 23, 2002
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix markup and punctuation
parent
7c7efe90
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Doc/lib/libsets.tex
Doc/lib/libsets.tex
+4
-4
No files found.
Doc/lib/libsets.tex
View file @
fa8dd5f4
...
@@ -33,7 +33,7 @@ abstract class useful for determining whether something is a set:
...
@@ -33,7 +33,7 @@ abstract class useful for determining whether something is a set:
The set classes are implemented using dictionaries. As a result, sets
The set classes are implemented using dictionaries. As a result, sets
cannot contain mutable elements such as lists or dictionaries.
cannot contain mutable elements such as lists or dictionaries.
However, they can contain immutable collections such as tuples or
However, they can contain immutable collections such as tuples or
instances of
\class
(ImmutableSet)
. For convenience in implementing
instances of
\class
{
ImmutableSet
}
. For convenience in implementing
sets of sets, inner sets are automatically converted to immutable
sets of sets, inner sets are automatically converted to immutable
form, for example,
\code
{
Set([Set(['dog'])])
}
is transformed to
form, for example,
\code
{
Set([Set(['dog'])])
}
is transformed to
\code
{
Set([ImmutableSet(['dog'])])
}
.
\code
{
Set([ImmutableSet(['dog'])])
}
.
...
@@ -140,8 +140,8 @@ but not found in \class{ImmutableSet}:
...
@@ -140,8 +140,8 @@ but not found in \class{ImmutableSet}:
\lineii
{
\var
{
s
}
.remove(
\var
{
x
}
)
}
\lineii
{
\var
{
s
}
.remove(
\var
{
x
}
)
}
{
Remove element
\var
{
x
}
from set
\var
{
s
}}
{
Remove element
\var
{
x
}
from set
\var
{
s
}}
\lineii
{
\var
{
s
}
.discard(
\var
{
x
}
)
}
\lineii
{
\var
{
s
}
.discard(
\var
{
x
}
)
}
{
Removes element
\var
{
x
}
from set
\var
{
s
}
l
ike
\var
{
s
}
.remove(
\var
{
x
}
)
{
Removes element
\var
{
x
}
from set
\var
{
s
}
. L
ike
\var
{
s
}
.remove(
\var
{
x
}
)
but does not raise
a
KeyError if
\var
{
x
}
is not in
\var
{
s
}}
but does not raise KeyError if
\var
{
x
}
is not in
\var
{
s
}}
\lineii
{
\var
{
s
}
.pop()
}
\lineii
{
\var
{
s
}
.pop()
}
{
Remove and return an element from
\var
{
s
}
; no guarantee is
{
Remove and return an element from
\var
{
s
}
; no guarantee is
made about which element is removed
}
made about which element is removed
}
...
@@ -212,6 +212,6 @@ method which returns the \class{Set} object wrapped by a new class
...
@@ -212,6 +212,6 @@ method which returns the \class{Set} object wrapped by a new class
The two mechanisms for adding hashability are normally invisible to the
The two mechanisms for adding hashability are normally invisible to the
user; however, a conflict can arise in a multi-threaded environment
user; however, a conflict can arise in a multi-threaded environment
where one thread is updating a
S
et while another has temporarily wrapped it
where one thread is updating a
s
et while another has temporarily wrapped it
in
\class
{_
TemporarilyImmutableSet
}
. In other words, sets of mutable sets
in
\class
{_
TemporarilyImmutableSet
}
. In other words, sets of mutable sets
are not thread-safe.
are not thread-safe.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment