mirror of
https://github.com/python/cpython.git
synced 2025-10-24 10:23:58 +00:00
gh-137668: Document that ord() supports also bytes and bytearray (GH-137669)
This commit is contained in:
parent
639df39bf0
commit
35759fe2fa
3 changed files with 27 additions and 9 deletions
12
Python/clinic/bltinmodule.c.h
generated
12
Python/clinic/bltinmodule.c.h
generated
|
|
@ -831,10 +831,16 @@ PyDoc_STRVAR(builtin_oct__doc__,
|
|||
{"oct", (PyCFunction)builtin_oct, METH_O, builtin_oct__doc__},
|
||||
|
||||
PyDoc_STRVAR(builtin_ord__doc__,
|
||||
"ord($module, c, /)\n"
|
||||
"ord($module, character, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"Return the Unicode code point for a one-character string.");
|
||||
"Return the ordinal value of a character.\n"
|
||||
"\n"
|
||||
"If the argument is a one-character string, return the Unicode code\n"
|
||||
"point of that character.\n"
|
||||
"\n"
|
||||
"If the argument is a bytes or bytearray object of length 1, return its\n"
|
||||
"single byte value.");
|
||||
|
||||
#define BUILTIN_ORD_METHODDEF \
|
||||
{"ord", (PyCFunction)builtin_ord, METH_O, builtin_ord__doc__},
|
||||
|
|
@ -1268,4 +1274,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
|
|||
exit:
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e7a5d0851d7f2cfb input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=cd5f80e3dc3082d5 input=a9049054013a1b77]*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue