Lines Matching defs:ascii
84 self.c_default = ascii(self.default)
211 ? (PyObject*)&_Py_SINGLETON(strings).ascii[ch] \
509 PyASCIIObject *ascii = _PyASCIIObject_CAST(op);
510 unsigned int kind = ascii->state.kind;
512 if (ascii->state.ascii == 1 && ascii->state.compact == 1) {
514 CHECK(ascii->state.ready == 1);
520 if (ascii->state.compact == 1) {
525 CHECK(ascii->state.ascii == 0);
526 CHECK(ascii->state.ready == 1);
534 CHECK(ascii->length == 0);
535 CHECK(ascii->hash == -1);
536 CHECK(ascii->state.compact == 0);
537 CHECK(ascii->state.ascii == 0);
538 CHECK(ascii->state.ready == 0);
539 CHECK(ascii->state.interned == SSTATE_NOT_INTERNED);
540 CHECK(ascii->wstr != NULL);
548 CHECK(ascii->state.compact == 0);
549 CHECK(ascii->state.ready == 1);
551 if (ascii->state.ascii) {
553 CHECK(compact->utf8_length == ascii->length);
568 CHECK(ascii->wstr == data);
569 CHECK(compact->wstr_length == ascii->length);
571 CHECK(ascii->wstr != data);
576 if (ascii->wstr == NULL)
587 data = PyUnicode_DATA(ascii);
588 for (i=0; i < ascii->length; i++)
595 if (ascii->state.ascii == 0) {
610 CHECK(PyUnicode_READ(kind, data, ascii->length) == 0);
1241 _PyUnicode_STATE(unicode).ascii = 0;
1281 return "legacy ascii";
1296 return "ascii";
1323 printf("compact ascii %d\n", PyUnicode_IS_COMPACT_ASCII(unicode));
1324 printf("ascii op %p\n", (void*)(_PyASCIIObject_CAST(unicode) + 1));
1333 PyASCIIObject *ascii = _PyASCIIObject_CAST(op);
1338 if (ascii->state.compact)
1340 if (ascii->state.ascii)
1341 data = (ascii + 1);
1347 printf("%s: len=%zu, ", unicode_kind_name(op), ascii->length);
1349 if (ascii->wstr == data)
1351 printf("wstr=%p", (void *)ascii->wstr);
1353 if (!(ascii->state.ascii == 1 && ascii->state.compact == 1)) {
1355 if (!ascii->state.compact && compact->utf8 == unicode->data.any) {
1442 _PyUnicode_STATE(unicode).ascii = is_ascii;
1819 _PyUnicode_STATE(unicode).ascii = 1;
1824 _PyUnicode_STATE(unicode).ascii = 0;
1967 PyASCIIObject *ascii = _PyASCIIObject_CAST(unicode);
1968 if (ascii->state.kind != PyUnicode_WCHAR_KIND && ascii->length == 1) {
3050 PyObject *ascii;
3052 ascii = PyObject_ASCII(obj);
3053 if (!ascii)
3055 if (unicode_fromformat_write_str(writer, ascii, width, precision) == -1) {
3056 Py_DECREF(ascii);
3059 Py_DECREF(ascii);
3590 if (strcmp(lower, "ascii") == 0
3863 if (strcmp(lower, "ascii") == 0
7058 const char *encoding = (limit == 256) ? "latin-1" : "ascii";
7336 "ascii", "ordinal not in range(128)",
9136 /* Fast path for ascii => ascii translation. Return 1 if the whole string
11524 /* Don't resize for ascii += latin1. Convert ascii to latin1 requires
13961 const char *ascii, Py_ssize_t len)
13964 len = strlen(ascii);
13966 assert(ucs1lib_find_max_char((const Py_UCS1*)ascii, (const Py_UCS1*)ascii + len) < 128);
13971 str = _PyUnicode_FromASCII(ascii, len);
13989 const Py_UCS1 *str = (const Py_UCS1 *)ascii;
13999 ascii, ascii + len,
14007 ascii, ascii + len,
15333 _PyUnicode_STATE(self).ascii = _PyUnicode_STATE(unicode).ascii;
15736 PyObject *item = (PyObject*)&_Py_SINGLETON(strings).ascii[chr];
16015 For example, replace "ANSI_X3.4-1968" (locale encoding) with "ascii"
16106 PyASCIIObject *ascii = _PyASCIIObject_CAST(op);
16108 assert(ascii->state.compact);
16110 if (ascii->state.ascii) {
16111 if (ascii->wstr) {
16112 PyObject_Free(ascii->wstr);
16113 ascii->wstr = NULL;
16119 if (ascii->wstr && ascii->wstr != data) {
16120 PyObject_Free(ascii->wstr);
16121 ascii->wstr = NULL;
16152 unicode_static_dealloc((PyObject*)&_Py_SINGLETON(strings).ascii[i]);