summaryrefslogtreecommitdiff
path: root/bs4/element.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonardr@segfault.org>2013-05-07 13:17:26 -0400
committerLeonard Richardson <leonardr@segfault.org>2013-05-07 13:17:26 -0400
commit07bafa37e866876563ecd729c6a2adaa6d6d01ff (patch)
treeaf3c93c38abb0d8d8129395065f3575b1773fc3b /bs4/element.py
parent7be8a3961be3a7f4ebee46eed3ef3a1372cef532 (diff)
Since the string part of a NavigableString is immutable, gave it a simpler __copy__ implementation. [bug=682685]
Diffstat (limited to 'bs4/element.py')
-rw-r--r--bs4/element.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bs4/element.py b/bs4/element.py
index 2834fcb..f4d5c40 100644
--- a/bs4/element.py
+++ b/bs4/element.py
@@ -759,6 +759,9 @@ class NavigableString(unicode, PageElement):
return unicode.__new__(cls, value)
return unicode.__new__(cls, value, DEFAULT_OUTPUT_ENCODING)
+ def __copy__(self):
+ return self
+
def __getnewargs__(self):
return (unicode(self),)