Mercurial > cpython-lru_cache-weakref
diff Objects/boolobject.c @ 41876:dcb43f40390b
Add interning of unicode strings by copying the functionality from
stringobject.c.
Intern "True" and "False" in bool_repr() again as it was in the
8bit string era.
| author | Walter Dörwald <walter@livinglogic.de> |
|---|---|
| date | Fri, 25 May 2007 13:52:07 +0000 |
| parents | b29d71d43c80 |
| children | e70cdce0e8b2 |
line wrap: on
line diff
--- a/Objects/boolobject.c Thu May 24 22:05:19 2007 +0000 +++ b/Objects/boolobject.c Fri May 25 13:52:07 2007 +0000 @@ -24,10 +24,10 @@ if (self == Py_True) s = true_str ? true_str : - (true_str = PyUnicode_FromString("True")); + (true_str = PyUnicode_InternFromString("True")); else s = false_str ? false_str : - (false_str = PyUnicode_FromString("False")); + (false_str = PyUnicode_InternFromString("False")); Py_XINCREF(s); return s; }
