From 07bafa37e866876563ecd729c6a2adaa6d6d01ff Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Tue, 7 May 2013 13:17:26 -0400 Subject: Since the string part of a NavigableString is immutable, gave it a simpler __copy__ implementation. [bug=682685] --- bs4/element.py | 3 +++ 1 file changed, 3 insertions(+) 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),) -- cgit v1.2.3