diff options
author | Leonard Richardson <leonardr@segfault.org> | 2013-05-07 13:17:26 -0400 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2013-05-07 13:17:26 -0400 |
commit | 07bafa37e866876563ecd729c6a2adaa6d6d01ff (patch) | |
tree | af3c93c38abb0d8d8129395065f3575b1773fc3b /bs4/element.py | |
parent | 7be8a3961be3a7f4ebee46eed3ef3a1372cef532 (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.py | 3 |
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),) |