8000 reverse-string: Don't redefine builting function 'input' (#1412) · CoolCoder31/python@a58792f · GitHub
[go: up one dir, main page]

Skip to content

Commit a58792f

Browse files
frerichcmccandless
authored andcommitted
r EEE2 everse-string: Don't redefine builting function 'input' (exercism#1412)
It hurts readability to redefine the meaning of well-known builtins such as 'input', and pylint rightfully warns about this, saying W: 1,12: Redefining built-in 'input' (redefined-builtin) It's a little unfortunate that Python grabs this part of the namespace, but let's fix the issue by using a different word for 'the input text'.
1 parent 9520f5b commit a58792f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
def reverse(input=''):
2-
return input[::-1]
1+
def reverse(text=''):
2+
return text[::-1]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
def reverse(input=''):
1+
def reverse(text=''):
22
pass

0 commit comments

Comments
 (0)
0