1. trampgeek
  2. pypy-sandbox-4-pycode

Commits

Lukas Diekmann  committed a7633eb

use string strategy when appending string to empty set

  • Participants
  • Parent commits 001538c
  • Branches set-strategies

Comments (0)

Files changed (1)

File pypy/objspace/std/setobject.py

View file
     def add(self, w_set, w_key):
         if type(w_key) is W_IntObject:
             strategy = self.space.fromcache(IntegerSetStrategy)
+        elif type(w_key) is W_StringObject:
+            strategy = self.space.fromcache(StringSetStrategy)
         else:
             strategy = self.space.fromcache(ObjectSetStrategy)
         w_set.strategy = strategy