mirror of
https://github.com/python/cpython.git
synced 2025-10-19 16:03:42 +00:00
[3.13] gh-137668: Document that ord() supports also bytes and bytearray (GH-137669) (GH-137704)
(cherry picked from commit 35759fe2fa
)
This commit is contained in:
parent
165532ccdb
commit
3a74d52584
3 changed files with 27 additions and 9 deletions
|
@ -1969,15 +1969,21 @@ builtin_oct(PyObject *module, PyObject *number)
|
|||
/*[clinic input]
|
||||
ord as builtin_ord
|
||||
|
||||
c: object
|
||||
character as c: object
|
||||
/
|
||||
|
||||
Return the Unicode code point for a one-character string.
|
||||
Return the ordinal value of a character.
|
||||
|
||||
If the argument is a one-character string, return the Unicode code
|
||||
point of that character.
|
||||
|
||||
If the argument is a bytes or bytearray object of length 1, return its
|
||||
single byte value.
|
||||
[clinic start generated code]*/
|
||||
|
||||
static PyObject *
|
||||
builtin_ord(PyObject *module, PyObject *c)
|
||||
/*[clinic end generated code: output=4fa5e87a323bae71 input=3064e5d6203ad012]*/
|
||||
/*[clinic end generated code: output=4fa5e87a323bae71 input=98d38480432e1177]*/
|
||||
{
|
||||
long ord;
|
||||
Py_ssize_t size;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue