Skip to content

Commit f6f6952

Browse files
author
Franziska Geiger
committed
Revert changes from other PR
1 parent f1703b5 commit f6f6952

File tree

3 files changed

+1
-51
lines changed

3 files changed

+1
-51
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_dict.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -457,39 +457,3 @@ def test_unhashable_key():
457457
assert_raises(TypeError, lambda: d[key_list])
458458
key_tuple_list = (key_list, 2)
459459
assert_raises(TypeError, lambda: d[key_tuple_list])
460-
461-
class EncodedString(str):
462-
# unicode string subclass to keep track of the original encoding.
463-
# 'encoding' is None for unicode strings and the source encoding
464-
# otherwise
465-
encoding = None
466-
467-
def __deepcopy__(self, memo):
468-
return self
469-
470-
def byteencode(self):
471-
assert self.encoding is not None
472-
return self.encode(self.encoding)
473-
474-
def utf8encode(self):
475-
assert self.encoding is None
476-
return self.encode("UTF-8")
477-
478-
@property
479-
def is_unicode(self):
480-
return self.encoding is None
481-
482-
def contains_surrogates(self):
483-
return string_contains_surrogates(self)
484-
485-
def as_utf8_string(self):
486-
return bytes_literal(self.utf8encode(), 'utf8')
487-
488-
489-
def test_wrapped_string_contains():
490-
testString = EncodedString('something')
491-
dict = {'something': (1, 0), 'nothing': (2, 0)}
492-
reached = False
493-
if testString in dict:
494-
reached = True
495-
assert reached

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/HashingStorageNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ protected boolean wrappedString(PString s) {
266266
CompilerDirectives.transferToInterpreterAndInvalidate();
267267
isBuiltinClassProfile = IsBuiltinClassProfile.create();
268268
}
269-
return isBuiltinClassProfile.profileClassWithBaseClasses(getClass(s), PythonBuiltinClassType.PString);
269+
return isBuiltinClassProfile.profileClass(getClass(s), PythonBuiltinClassType.PString);
270270
}
271271

272272
protected EconomicMapStorage switchToEconomicMap(HashingStorage storage) {

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/nodes/object/IsBuiltinClassProfile.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -206,20 +206,6 @@ public boolean profileClass(LazyPythonClass clazz, PythonBuiltinClassType type)
206206
}
207207
}
208208

209-
public boolean profileClassWithBaseClasses(LazyPythonClass clazz, PythonBuiltinClassType type) {
210-
if (!profileClass(clazz, type)) {
211-
PythonAbstractClass[] baseClasses = ((PythonClass) clazz).getBaseClasses();
212-
for (PythonAbstractClass baseClazz : baseClasses) {
213-
if (profileClass(baseClazz, type)) {
214-
return true;
215-
}
216-
}
217-
return false;
218-
} else {
219-
return true;
220-
}
221-
}
222-
223209
public boolean profileClass(PythonAbstractClass clazz, PythonBuiltinClassType type) {
224210
if (clazz instanceof PythonBuiltinClass) {
225211
if (!isBuiltinClass) {

0 commit comments

Comments
 (0)