Mercurial > cpython-lru_cache-weakref
annotate Include/bytes_methods.h @ 66978:aed2bbafa550 3.1
Blocked revisions 87324 via svnmerge
........
r87324 | r.david.murray | 2010-12-16 14:08:51 -0500 (Thu, 16 Dec 2010) | 9 lines
#10719: restore messages generated on invalid compileall args
Before the introduction of filename arguments to compileall it gave semi useful
messages about not being able to 'list' names that weren't valid directories.
This fix restores that behavior. In addition to the test for this case, the
patch also adds a test for the default behavior of compileall when no arguments
are provided, and fixes a bug in one of the previously added tests.
........
| author | R. David Murray <rdmurray@bitdance.com> |
|---|---|
| date | Thu, 16 Dec 2010 19:10:16 +0000 |
| parents | 4b4b59f278bf |
| children | d31eaec883eb |
| rev | line source |
|---|---|
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
1 #ifndef Py_BYTES_CTYPE_H |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
2 #define Py_BYTES_CTYPE_H |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
3 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
4 /* |
|
47300
96b34263e448
Renamed PyBytes to PyByteArray
Christian Heimes <christian@cheimes.de>
parents:
46161
diff
changeset
|
5 * The internal implementation behind PyBytes (bytes) and PyByteArray (bytearray) |
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
6 * methods of the given names, they operate on ASCII byte strings. |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
7 */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
8 extern PyObject* _Py_bytes_isspace(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
9 extern PyObject* _Py_bytes_isalpha(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
10 extern PyObject* _Py_bytes_isalnum(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
11 extern PyObject* _Py_bytes_isdigit(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
12 extern PyObject* _Py_bytes_islower(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
13 extern PyObject* _Py_bytes_isupper(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
14 extern PyObject* _Py_bytes_istitle(const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
15 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
16 /* These store their len sized answer in the given preallocated *result arg. */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
17 extern void _Py_bytes_lower(char *result, const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
18 extern void _Py_bytes_upper(char *result, const char *cptr, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
19 extern void _Py_bytes_title(char *result, char *s, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
20 extern void _Py_bytes_capitalize(char *result, char *s, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
21 extern void _Py_bytes_swapcase(char *result, char *s, Py_ssize_t len); |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
22 |
|
53094
4407e4d07084
Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
Georg Brandl <georg@python.org>
parents:
47300
diff
changeset
|
23 /* This one gets the raw argument list. */ |
|
4407e4d07084
Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
Georg Brandl <georg@python.org>
parents:
47300
diff
changeset
|
24 extern PyObject* _Py_bytes_maketrans(PyObject *args); |
|
4407e4d07084
Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
Georg Brandl <georg@python.org>
parents:
47300
diff
changeset
|
25 |
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
26 /* Shared __doc__ strings. */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
27 extern const char _Py_isspace__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
28 extern const char _Py_isalpha__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
29 extern const char _Py_isalnum__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
30 extern const char _Py_isdigit__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
31 extern const char _Py_islower__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
32 extern const char _Py_isupper__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
33 extern const char _Py_istitle__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
34 extern const char _Py_lower__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
35 extern const char _Py_upper__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
36 extern const char _Py_title__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
37 extern const char _Py_capitalize__doc__[]; |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
38 extern const char _Py_swapcase__doc__[]; |
|
53094
4407e4d07084
Add bytes/bytearray.maketrans() to mirror str.maketrans(), and deprecate
Georg Brandl <georg@python.org>
parents:
47300
diff
changeset
|
39 extern const char _Py_maketrans__doc__[]; |
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
40 |
|
53543
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
41 /* These are left in for backward compatibility and will be removed |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
42 in 2.8/3.2 */ |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
43 #define ISLOWER(c) Py_ISLOWER(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
44 #define ISUPPER(c) Py_ISUPPER(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
45 #define ISALPHA(c) Py_ISALPHA(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
46 #define ISDIGIT(c) Py_ISDIGIT(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
47 #define ISXDIGIT(c) Py_ISXDIGIT(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
48 #define ISALNUM(c) Py_ISALNUM(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
49 #define ISSPACE(c) Py_ISSPACE(c) |
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
50 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
51 #undef islower |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
52 #define islower(c) undefined_islower(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
53 #undef isupper |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
54 #define isupper(c) undefined_isupper(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
55 #undef isalpha |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
56 #define isalpha(c) undefined_isalpha(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
57 #undef isdigit |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
58 #define isdigit(c) undefined_isdigit(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
59 #undef isxdigit |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
60 #define isxdigit(c) undefined_isxdigit(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
61 #undef isalnum |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
62 #define isalnum(c) undefined_isalnum(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
63 #undef isspace |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
64 #define isspace(c) undefined_isspace(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
65 |
|
53543
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
66 /* These are left in for backward compatibility and will be removed |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
67 in 2.8/3.2 */ |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
68 #define TOLOWER(c) Py_TOLOWER(c) |
|
4b4b59f278bf
Merged revisions 72040 via svnmerge from
Eric Smith <eric@trueblade.com>
parents:
53094
diff
changeset
|
69 #define TOUPPER(c) Py_TOUPPER(c) |
|
43576
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
70 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
71 #undef tolower |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
72 #define tolower(c) undefined_tolower(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
73 #undef toupper |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
74 #define toupper(c) undefined_toupper(c) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
75 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
76 /* this is needed because some docs are shared from the .o, not static */ |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
77 #define PyDoc_STRVAR_shared(name,str) const char name[] = PyDoc_STR(str) |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
78 |
|
697cc31a83f6
For PEP3137: Adds missing methods to the mutable PyBytes object (soon
Gregory P. Smith <greg@mad-scientist.com>
parents:
diff
changeset
|
79 #endif /* !Py_BYTES_CTYPE_H */ |
