bpo-29776: Use decorator syntax for properties. (#585)

This commit is contained in:
Serhiy Storchaka 2017-03-19 08:40:32 +02:00 committed by GitHub
parent c85a26628c
commit bdf6b910f9
10 changed files with 53 additions and 34 deletions

View file

@ -1868,8 +1868,13 @@ class Helper:
self._input = input
self._output = output
input = property(lambda self: self._input or sys.stdin)
output = property(lambda self: self._output or sys.stdout)
@property
def input(self):
return self._input or sys.stdin
@property
def output(self):
return self._output or sys.stdout
def __repr__(self):
if inspect.stack()[1][3] == '?':