We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d94fb35 commit 671a63eCopy full SHA for 671a63e
src/future/types/newstr.py
@@ -105,6 +105,7 @@ def __repr__(self):
105
"""
106
Without the u prefix
107
108
+
109
value = super(newstr, self).__repr__()
110
# assert value[0] == u'u'
111
return value[1:]
@@ -292,6 +293,13 @@ def __eq__(self, other):
292
293
else:
294
return False
295
296
+ def __hash__(self):
297
+ if (isinstance(self, unicode) or
298
+ isinstance(self, bytes) and not isnewbytes(self)):
299
+ return super(newstr, self).__hash__()
300
+ else:
301
+ raise NotImplementedError()
302
303
def __ne__(self, other):
304
if (isinstance(other, unicode) or
305
isinstance(other, bytes) and not isnewbytes(other)):
0 commit comments