Kaydet (Commit) 8790a079 authored tarafından Brian Curtin's avatar Brian Curtin

Fix #7579. Add docstrings to msvcrt and adjust some wording for bytes.

üst 17689991
...@@ -90,12 +90,12 @@ Console I/O ...@@ -90,12 +90,12 @@ Console I/O
.. function:: getch() .. function:: getch()
Read a keypress and return the resulting character. Nothing is echoed to the Read a keypress and return the resulting character as a byte string.
console. This call will block if a keypress is not already available, but will Nothing is echoed to the console. This call will block if a keypress
not wait for :kbd:`Enter` to be pressed. If the pressed key was a special is not already available, but will not wait for :kbd:`Enter` to be
function key, this will return ``'\000'`` or ``'\xe0'``; the next call will pressed. If the pressed key was a special function key, this will
return the keycode. The :kbd:`Control-C` keypress cannot be read with this return ``'\000'`` or ``'\xe0'``; the next call will return the keycode.
function. The :kbd:`Control-C` keypress cannot be read with this function.
.. function:: getwch() .. function:: getwch()
...@@ -116,7 +116,7 @@ Console I/O ...@@ -116,7 +116,7 @@ Console I/O
.. function:: putch(char) .. function:: putch(char)
Print the character *char* to the console without buffering. Print the byte string *char* to the console without buffering.
.. function:: putwch(unicode_char) .. function:: putwch(unicode_char)
...@@ -126,8 +126,8 @@ Console I/O ...@@ -126,8 +126,8 @@ Console I/O
.. function:: ungetch(char) .. function:: ungetch(char)
Cause the character *char* to be "pushed back" into the console buffer; it will Cause the byte string *char* to be "pushed back" into the console buffer;
be the next character read by :func:`getch` or :func:`getche`. it will be the next character read by :func:`getch` or :func:`getche`.
.. function:: ungetwch(unicode_char) .. function:: ungetwch(unicode_char)
......
...@@ -197,12 +197,12 @@ msvcrt_getch(PyObject *self, PyObject *args) ...@@ -197,12 +197,12 @@ msvcrt_getch(PyObject *self, PyObject *args)
PyDoc_STRVAR(getch_doc, PyDoc_STRVAR(getch_doc,
"getch() -> key character\n\ "getch() -> key character\n\
\n\ \n\
Read a keypress and return the resulting character. Nothing is echoed to\n\ Read a keypress and return the resulting character as a byte string.\n\
the console. This call will block if a keypress is not already\n\ Nothing is echoed to the console. This call will block if a keypress is\n\
available, but will not wait for Enter to be pressed. If the pressed key\n\ not already available, but will not wait for Enter to be pressed. If the\n\
was a special function key, this will return '\\000' or '\\xe0'; the next\n\ pressed key was a special function key, this will return '\\000' or\n\
call will return the keycode. The Control-C keypress cannot be read with\n\ '\\xe0'; the next call will return the keycode. The Control-C keypress\n\
this function."); cannot be read with this function.");
#ifdef _WCONIO_DEFINED #ifdef _WCONIO_DEFINED
static PyObject * static PyObject *
...@@ -288,7 +288,7 @@ msvcrt_putch(PyObject *self, PyObject *args) ...@@ -288,7 +288,7 @@ msvcrt_putch(PyObject *self, PyObject *args)
PyDoc_STRVAR(putch_doc, PyDoc_STRVAR(putch_doc,
"putch(char) -> None\n\ "putch(char) -> None\n\
\n\ \n\
Print the character char to the console without buffering."); Print the byte string char to the console without buffering.");
#ifdef _WCONIO_DEFINED #ifdef _WCONIO_DEFINED
static PyObject * static PyObject *
...@@ -327,8 +327,9 @@ msvcrt_ungetch(PyObject *self, PyObject *args) ...@@ -327,8 +327,9 @@ msvcrt_ungetch(PyObject *self, PyObject *args)
PyDoc_STRVAR(ungetch_doc, PyDoc_STRVAR(ungetch_doc,
"ungetch(char) -> None\n\ "ungetch(char) -> None\n\
\n\ \n\
Cause the character char to be \"pushed back\" into the console buffer;\n\ Cause the byte string char to be \"pushed back\" into the\n\
it will be the next character read by getch() or getche()."); console buffer; it will be the next character read by\n\
getch() or getche().");
#ifdef _WCONIO_DEFINED #ifdef _WCONIO_DEFINED
static PyObject * static PyObject *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment