Rename _Py_identifier to _Py_IDENTIFIER.

This commit is contained in:
Martin v. Löwis 2011-10-14 10:20:37 +02:00
parent 01277d166a
commit bd928fef42
57 changed files with 262 additions and 262 deletions

View file

@ -2082,7 +2082,7 @@ PyMapping_Keys(PyObject *o)
{
PyObject *keys;
PyObject *fast;
_Py_identifier(keys);
_Py_IDENTIFIER(keys);
if (PyDict_CheckExact(o))
return PyDict_Keys(o);
@ -2099,7 +2099,7 @@ PyMapping_Items(PyObject *o)
{
PyObject *items;
PyObject *fast;
_Py_identifier(items);
_Py_IDENTIFIER(items);
if (PyDict_CheckExact(o))
return PyDict_Items(o);
@ -2116,7 +2116,7 @@ PyMapping_Values(PyObject *o)
{
PyObject *values;
PyObject *fast;
_Py_identifier(values);
_Py_IDENTIFIER(values);
if (PyDict_CheckExact(o))
return PyDict_Values(o);

View file

@ -2698,7 +2698,7 @@ static PyObject *
bytearray_reduce(PyByteArrayObject *self)
{
PyObject *latin1, *dict;
_Py_identifier(__dict__);
_Py_IDENTIFIER(__dict__);
if (self->ob_bytes)
latin1 = PyUnicode_DecodeLatin1(self->ob_bytes,

View file

@ -14,7 +14,7 @@ static int numfree = 0;
#define PyMethod_MAXFREELIST 256
#endif
_Py_identifier(__name__);
_Py_IDENTIFIER(__name__);
PyObject *
PyMethod_Function(PyObject *im)

View file

@ -703,7 +703,7 @@ static PyObject *
proxy_get(proxyobject *pp, PyObject *args)
{
PyObject *key, *def = Py_None;
_Py_identifier(get);
_Py_IDENTIFIER(get);
if (!PyArg_UnpackTuple(args, "get", 1, 2, &key, &def))
return NULL;
@ -713,28 +713,28 @@ proxy_get(proxyobject *pp, PyObject *args)
static PyObject *
proxy_keys(proxyobject *pp)
{
_Py_identifier(keys);
_Py_IDENTIFIER(keys);
return _PyObject_CallMethodId(pp->dict, &PyId_keys, NULL);
}
static PyObject *
proxy_values(proxyobject *pp)
{
_Py_identifier(values);
_Py_IDENTIFIER(values);
return _PyObject_CallMethodId(pp->dict, &PyId_values, NULL);
}
static PyObject *
proxy_items(proxyobject *pp)
{
_Py_identifier(items);
_Py_IDENTIFIER(items);
return _PyObject_CallMethodId(pp->dict, &PyId_items, NULL);
}
static PyObject *
proxy_copy(proxyobject *pp)
{
_Py_identifier(copy);
_Py_IDENTIFIER(copy);
return _PyObject_CallMethodId(pp->dict, &PyId_copy, NULL);
}
@ -1299,7 +1299,7 @@ property_init(PyObject *self, PyObject *args, PyObject *kwds)
/* if no docstring given and the getter has one, use that one */
if ((doc == NULL || doc == Py_None) && get != NULL) {
_Py_identifier(__doc__);
_Py_IDENTIFIER(__doc__);
PyObject *get_doc = _PyObject_GetAttrId(get, &PyId___doc__);
if (get_doc) {
if (Py_TYPE(self) == &PyProperty_Type) {

View file

@ -2707,7 +2707,7 @@ dictviews_sub(PyObject* self, PyObject *other)
{
PyObject *result = PySet_New(self);
PyObject *tmp;
_Py_identifier(difference_update);
_Py_IDENTIFIER(difference_update);
if (result == NULL)
return NULL;
@ -2727,7 +2727,7 @@ dictviews_and(PyObject* self, PyObject *other)
{
PyObject *result = PySet_New(self);
PyObject *tmp;
_Py_identifier(intersection_update);
_Py_IDENTIFIER(intersection_update);
if (result == NULL)
return NULL;
@ -2767,7 +2767,7 @@ dictviews_xor(PyObject* self, PyObject *other)
{
PyObject *result = PySet_New(self);
PyObject *tmp;
_Py_identifier(symmetric_difference_update);
_Py_IDENTIFIER(symmetric_difference_update);
if (result == NULL)
return NULL;

View file

@ -30,7 +30,7 @@ PyFile_FromFd(int fd, char *name, char *mode, int buffering, char *encoding,
char *errors, char *newline, int closefd)
{
PyObject *io, *stream;
_Py_identifier(open);
_Py_IDENTIFIER(open);
io = PyImport_ImportModule("io");
if (io == NULL)
@ -59,7 +59,7 @@ PyFile_GetLine(PyObject *f, int n)
{
PyObject *reader;
PyObject *args;
_Py_identifier(readline);
_Py_IDENTIFIER(readline);
reader = _PyObject_GetAttrId(f, &PyId_readline);
if (reader == NULL)
@ -128,7 +128,7 @@ int
PyFile_WriteObject(PyObject *v, PyObject *f, int flags)
{
PyObject *writer, *value, *args, *result;
_Py_identifier(write);
_Py_IDENTIFIER(write);
if (f == NULL) {
PyErr_SetString(PyExc_TypeError, "writeobject with NULL file");
@ -197,7 +197,7 @@ PyObject_AsFileDescriptor(PyObject *o)
{
int fd;
PyObject *meth;
_Py_identifier(fileno);
_Py_IDENTIFIER(fileno);
if (PyLong_Check(o)) {
fd = PyLong_AsLong(o);

View file

@ -415,7 +415,7 @@ module_clear(PyModuleObject *m)
static PyObject *
module_dir(PyObject *self, PyObject *args)
{
_Py_identifier(__dict__);
_Py_IDENTIFIER(__dict__);
PyObject *result = NULL;
PyObject *dict = _PyObject_GetAttrId(self, &PyId___dict__);

View file

@ -1933,7 +1933,7 @@ static PyObject *
set_reduce(PySetObject *so)
{
PyObject *keys=NULL, *args=NULL, *result=NULL, *dict=NULL;
_Py_identifier(__dict__);
_Py_IDENTIFIER(__dict__);
keys = PySequence_List((PyObject *)so);
if (keys == NULL)

View file

@ -35,8 +35,8 @@ struct method_cache_entry {
static struct method_cache_entry method_cache[1 << MCACHE_SIZE_EXP];
static unsigned int next_version_tag = 0;
_Py_identifier(__dict__);
_Py_identifier(__class__);
_Py_IDENTIFIER(__dict__);
_Py_IDENTIFIER(__class__);
unsigned int
PyType_ClearCache(void)
@ -1284,7 +1284,7 @@ tail_contains(PyObject *list, int whence, PyObject *o) {
static PyObject *
class_name(PyObject *cls)
{
_Py_identifier(__name__);
_Py_IDENTIFIER(__name__);
PyObject *name = _PyObject_GetAttrId(cls, &PyId___name__);
if (name == NULL) {
PyErr_Clear();
@ -2599,7 +2599,7 @@ merge_class_dict(PyObject *dict, PyObject *aclass)
{
PyObject *classdict;
PyObject *bases;
_Py_identifier(__bases__);
_Py_IDENTIFIER(__bases__);
assert(PyDict_Check(dict));
assert(aclass);
@ -2901,7 +2901,7 @@ object_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyObject *sorted;
PyObject *sorted_methods = NULL;
PyObject *joined = NULL;
_Py_identifier(join);
_Py_IDENTIFIER(join);
/* Compute ", ".join(sorted(type.__abstractmethods__))
into joined. */
@ -3189,7 +3189,7 @@ slotnames(PyObject *cls)
PyObject *copyreg;
PyObject *slotnames;
static PyObject *str_slotnames;
_Py_identifier(_slotnames);
_Py_IDENTIFIER(_slotnames);
if (str_slotnames == NULL) {
str_slotnames = PyUnicode_InternFromString("__slotnames__");
@ -3329,7 +3329,7 @@ reduce_2(PyObject *obj)
Py_INCREF(dictitems);
}
else {
_Py_identifier(items);
_Py_IDENTIFIER(items);
PyObject *items = _PyObject_CallMethodId(obj, &PyId_items, "");
if (items == NULL)
goto end;

View file

@ -157,7 +157,7 @@ static PyObject *
weakref_repr(PyWeakReference *self)
{
PyObject *name, *repr;
_Py_identifier(__name__);
_Py_IDENTIFIER(__name__);
if (PyWeakref_GET_OBJECT(self) == Py_None)
return PyUnicode_FromFormat("<weakref at %p; dead>", self);
@ -441,7 +441,7 @@ proxy_checkref(PyWeakReference *proxy)
#define WRAP_METHOD(method, special) \
static PyObject * \
method(PyObject *proxy) { \
_Py_identifier(special); \
_Py_IDENTIFIER(special); \
UNWRAP(proxy); \
return _PyObject_CallMethodId(proxy, &PyId_##special, ""); \
}