diff options
author | Christian Heimes <christian@cheimes.de> | 2008-01-18 18:24:07 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-01-18 18:24:07 (GMT) |
commit | 288e89acfc29cf857a8c5d314ba2dd3398a2eae9 (patch) | |
tree | e4ca8e317d378207d274157a0dc138e2917cbc1b /Python | |
parent | a9e073d100c3869231ce7275ff7a810d8db74fc4 (diff) | |
download | cpython-288e89acfc29cf857a8c5d314ba2dd3398a2eae9.zip cpython-288e89acfc29cf857a8c5d314ba2dd3398a2eae9.tar.gz cpython-288e89acfc29cf857a8c5d314ba2dd3398a2eae9.tar.bz2 |
Added bytes and b'' as aliases for str and ''
Diffstat (limited to 'Python')
-rw-r--r-- | Python/ast.c | 3 | ||||
-rw-r--r-- | Python/bltinmodule.c | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/Python/ast.c b/Python/ast.c index ddcd0a0..aa42fe8 100644 --- a/Python/ast.c +++ b/Python/ast.c @@ -3238,6 +3238,9 @@ parsestr(const char *s, const char *encoding) quote = *++s; unicode = 1; } + if (quote == 'b' || quote == 'B') { + quote = *++s; + } if (quote == 'r' || quote == 'R') { quote = *++s; rawmode = 1; diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 3ebd29d..9a31356 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2446,6 +2446,7 @@ _PyBuiltin_Init(void) SETBUILTIN("True", Py_True); SETBUILTIN("basestring", &PyBaseString_Type); SETBUILTIN("bool", &PyBool_Type); + SETBUILTIN("bytes", &PyString_Type); SETBUILTIN("buffer", &PyBuffer_Type); SETBUILTIN("classmethod", &PyClassMethod_Type); #ifndef WITHOUT_COMPLEX |