Mercurial > cpython-lru_cache-weakref
comparison Python/sysmodule.c @ 43777:0d462d789b18
Merging the py3k-pep3137 branch back into the py3k branch.
No detailed change log; just check out the change log for the py3k-pep3137
branch. The most obvious changes:
- str8 renamed to bytes (PyString at the C level);
- bytes renamed to buffer (PyBytes at the C level);
- PyString and PyUnicode are no longer compatible.
I.e. we now have an immutable bytes type and a mutable bytes type.
The behavior of PyString was modified quite a bit, to make it more
bytes-like. Some changes are still on the to-do list.
| author | Guido van Rossum <guido@python.org> |
|---|---|
| date | Tue, 06 Nov 2007 21:34:58 +0000 |
| parents | 658cd34a8c5d |
| children | 1561763cda72 |
comparison
equal
deleted
inserted
replaced
| 43776:b310fd2b0184 | 43777:0d462d789b18 |
|---|---|
| 223 | 223 |
| 224 static PyObject * | 224 static PyObject * |
| 225 sys_intern(PyObject *self, PyObject *args) | 225 sys_intern(PyObject *self, PyObject *args) |
| 226 { | 226 { |
| 227 PyObject *s; | 227 PyObject *s; |
| 228 if (!PyArg_ParseTuple(args, "S:intern", &s)) | 228 if (!PyArg_ParseTuple(args, "U:intern", &s)) |
| 229 return NULL; | 229 return NULL; |
| 230 if (PyString_CheckExact(s)) { | 230 if (PyUnicode_CheckExact(s)) { |
| 231 Py_INCREF(s); | |
| 232 PyString_InternInPlace(&s); | |
| 233 return s; | |
| 234 } | |
| 235 else if (PyUnicode_CheckExact(s)) { | |
| 236 Py_INCREF(s); | 231 Py_INCREF(s); |
| 237 PyUnicode_InternInPlace(&s); | 232 PyUnicode_InternInPlace(&s); |
| 238 return s; | 233 return s; |
| 239 } | 234 } |
| 240 else { | 235 else { |
