Mercurial > cpython-lru_cache-weakref
annotate Objects/stringlib/stringdefs.h @ 60174:255a401c19b0
(partially)
Merged revisions 79534,79537,79539,79558,79606 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79534 | florent.xicluna | 2010-03-31 23:21:54 +0200 (mer, 31 mar 2010) | 2 lines
Fix test for xml.etree when using a non-ascii path. And use check_warnings instead of catch_warnings.
........
r79537 | florent.xicluna | 2010-03-31 23:40:32 +0200 (mer, 31 mar 2010) | 2 lines
Fix typo
........
r79539 | florent.xicluna | 2010-04-01 00:01:03 +0200 (jeu, 01 avr 2010) | 2 lines
Replace catch_warnings with check_warnings when it makes sense. Use assertRaises context manager to simplify some tests.
........
r79558 | florent.xicluna | 2010-04-01 20:17:09 +0200 (jeu, 01 avr 2010) | 2 lines
#7092: Fix some -3 warnings, and fix Lib/platform.py when the path contains a double-quote.
........
r79606 | florent.xicluna | 2010-04-02 19:26:42 +0200 (ven, 02 avr 2010) | 2 lines
Backport some robotparser test and skip the test if the external resource is not available.
........
| author | Florent Xicluna <florent.xicluna@gmail.com> |
|---|---|
| date | Fri, 02 Apr 2010 18:52:12 +0000 |
| parents | 5ca1948a8fd6 |
| children | 8beaa9a37387 |
| rev | line source |
|---|---|
|
42817
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
1 #ifndef STRINGLIB_STRINGDEFS_H |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
2 #define STRINGLIB_STRINGDEFS_H |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
3 |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
4 /* this is sort of a hack. there's at least one place (formatting |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
5 floats) where some stringlib code takes a different path if it's |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
6 compiled as unicode. */ |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
7 #define STRINGLIB_IS_UNICODE 0 |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
8 |
|
47301
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
9 #define STRINGLIB_OBJECT PyBytesObject |
|
42817
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
10 #define STRINGLIB_CHAR char |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
11 #define STRINGLIB_TYPE_NAME "string" |
|
43172
d842457e4b0e
Changed to use 'U' argument to PyArg_ParseTuple, instead of manually checking for unicode objects.
Eric Smith <eric@trueblade.com>
parents:
42817
diff
changeset
|
12 #define STRINGLIB_PARSE_CODE "S" |
|
45382
7af955843929
Fixes for shared 2.6 code that implements PEP 3101, advanced string
Eric Smith <eric@trueblade.com>
parents:
43172
diff
changeset
|
13 #define STRINGLIB_EMPTY nullstring |
|
58289
5ca1948a8fd6
Merged revisions 77461 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
58095
diff
changeset
|
14 #define STRINGLIB_ISSPACE Py_ISSPACE |
|
5ca1948a8fd6
Merged revisions 77461 via svnmerge from
Antoine Pitrou <solipsis@pitrou.net>
parents:
58095
diff
changeset
|
15 #define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r')) |
|
42817
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
16 #define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9')) |
|
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
17 #define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1) |
|
53543
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
52773
diff
changeset
|
18 #define STRINGLIB_TOUPPER Py_TOUPPER |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
52773
diff
changeset
|
19 #define STRINGLIB_TOLOWER Py_TOLOWER |
|
42817
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
20 #define STRINGLIB_FILL memset |
|
47301
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
21 #define STRINGLIB_STR PyBytes_AS_STRING |
|
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
22 #define STRINGLIB_LEN PyBytes_GET_SIZE |
|
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
23 #define STRINGLIB_NEW PyBytes_FromStringAndSize |
|
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
24 #define STRINGLIB_RESIZE _PyBytes_Resize |
|
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
25 #define STRINGLIB_CHECK PyBytes_Check |
|
57515
f37f6b9b224b
Issue #5748: bytesobject.c should not have its own private defines for stringlib macros. Also removed unused defines and include for localutil.h.
Eric Smith <eric@trueblade.com>
parents:
53543
diff
changeset
|
26 #define STRINGLIB_CHECK_EXACT PyBytes_CheckExact |
|
42817
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
27 #define STRINGLIB_TOSTR PyObject_Str |
|
47301
23ab586c427a
Renamed PyString to PyBytes
Christian Heimes <christian@cheimes.de>
parents:
46909
diff
changeset
|
28 #define STRINGLIB_GROUPING _PyBytes_InsertThousandsGrouping |
|
52773
28096ed73153
Added ',' thousands grouping to int.__format__. See PEP 378.
Eric Smith <eric@trueblade.com>
parents:
47611
diff
changeset
|
29 #define STRINGLIB_GROUPING_LOCALE _PyBytes_InsertThousandsGroupingLocale |
|
47611
da47e7e135ae
#2630: Implement PEP 3138.
Georg Brandl <georg@python.org>
parents:
47301
diff
changeset
|
30 #define STRINGLIB_TOASCII PyObject_Repr |
|
42817
5355337709e1
Implementation of PEP 3101, Advanced String Formatting.
Eric Smith <eric@trueblade.com>
parents:
diff
changeset
|
31 #endif /* !STRINGLIB_STRINGDEFS_H */ |
