mirror of
https://github.com/python/cpython.git
synced 2025-07-31 07:04:42 +00:00
First step of the C API rename:
renamed Include/bytesobject.h to Include/bytearrayobject.h renamed Include/stringobject.h to Include/bytesobject.h added Include/stringobject.h with aliases
This commit is contained in:
parent
b4701e638c
commit
3497f94476
11 changed files with 513 additions and 476 deletions
|
@ -1498,10 +1498,10 @@ builtin_ord(PyObject *self, PyObject* obj)
|
|||
ord = (long)((unsigned char)*PyString_AS_STRING(obj));
|
||||
return PyInt_FromLong(ord);
|
||||
}
|
||||
} else if (PyBytes_Check(obj)) {
|
||||
size = PyBytes_GET_SIZE(obj);
|
||||
} else if (PyByteArray_Check(obj)) {
|
||||
size = PyByteArray_GET_SIZE(obj);
|
||||
if (size == 1) {
|
||||
ord = (long)((unsigned char)*PyBytes_AS_STRING(obj));
|
||||
ord = (long)((unsigned char)*PyByteArray_AS_STRING(obj));
|
||||
return PyInt_FromLong(ord);
|
||||
}
|
||||
|
||||
|
@ -2618,7 +2618,7 @@ _PyBuiltin_Init(void)
|
|||
SETBUILTIN("basestring", &PyBaseString_Type);
|
||||
SETBUILTIN("bool", &PyBool_Type);
|
||||
/* SETBUILTIN("memoryview", &PyMemoryView_Type); */
|
||||
SETBUILTIN("bytearray", &PyBytes_Type);
|
||||
SETBUILTIN("bytearray", &PyByteArray_Type);
|
||||
SETBUILTIN("bytes", &PyString_Type);
|
||||
SETBUILTIN("buffer", &PyBuffer_Type);
|
||||
SETBUILTIN("classmethod", &PyClassMethod_Type);
|
||||
|
|
|
@ -169,7 +169,7 @@ Py_InitializeEx(int install_sigs)
|
|||
if (!_PyInt_Init())
|
||||
Py_FatalError("Py_Initialize: can't init ints");
|
||||
|
||||
if (!PyBytes_Init())
|
||||
if (!PyByteArray_Init())
|
||||
Py_FatalError("Py_Initialize: can't init bytearray");
|
||||
|
||||
_PyFloat_Init();
|
||||
|
@ -451,7 +451,7 @@ Py_Finalize(void)
|
|||
PyList_Fini();
|
||||
PySet_Fini();
|
||||
PyString_Fini();
|
||||
PyBytes_Fini();
|
||||
PyByteArray_Fini();
|
||||
PyInt_Fini();
|
||||
PyFloat_Fini();
|
||||
PyDict_Fini();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue