mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Added bytes and b'' as aliases for str and ''
This commit is contained in:
parent
a9e073d100
commit
288e89acfc
6 changed files with 43 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue