summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2023-03-27 10:42:13 -0400
committerLeonard Richardson <leonardr@segfault.org>2023-03-27 10:42:13 -0400
commitc0aa6d696681ef3d3e6aecc290612a054ac76b38 (patch)
treedf62e7a43d29b3d47835802be318fde1ea64650d
parent544a069c2d802f726c888e9f921f7dc9b79f341a (diff)
Updated __copy__ docstrings.
-rw-r--r--bs4/element.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/bs4/element.py b/bs4/element.py
index e75d326..42b4a51 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -966,6 +966,9 @@ class NavigableString(str, PageElement):
return type(self)(self)
def __copy__(self):
+ """A copy of a NavigableString can only be a deep copy, because
+ only one PageElement can occupy a given place in a parse tree.
+ """
return self.__deepcopy__({})
def __getnewargs__(self):
@@ -1341,8 +1344,9 @@ class Tag(PageElement):
return clone
def __copy__(self):
- # A copy of a Tag must always be a deep copy, because the
- # Tag's children can only have one parent at a time.
+ """A copy of a Tag must always be a deep copy, because a Tag's
+ children can only have one parent at a time.
+ """
return self.__deepcopy__({})
def _clone(self):