Skip to content

Commit b063b43

Browse files
committed
Add a docstring for read_response
1 parent de51acb commit b063b43

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

cookiecutter/prompt.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,26 @@
1515
if PY3:
1616
iteritems = lambda d: iter(d.items())
1717
def read_response(prompt=''):
18+
"""
19+
Prompt the user for a response.
20+
21+
Prints the given prompt (which should be a Unicode string),
22+
and returns the text entered by the user as a Unicode string.
23+
24+
:param prompt: A Unicode string that is presented to the user.
25+
"""
26+
# The Python 3 input function does exactly what we want
1827
return input(prompt)
1928
else:
2029
def read_response(prompt=''):
30+
"""
31+
Prompt the user for a response.
32+
33+
Prints the given prompt (which should be a Unicode string),
34+
and returns the text entered by the user as a Unicode string.
35+
36+
:param prompt: A Unicode string that is presented to the user.
37+
"""
2138
# For Python 2, raw_input takes a byte string argument for the prompt.
2239
# This must be encoded using the encoding used by sys.stdout.
2340
# The result is a byte string encoding using sys.stdin.encoding.

0 commit comments

Comments
 (0)