mirror of
https://github.com/python/cpython.git
synced 2025-08-22 01:35:16 +00:00
bpo-29776: Use decorator syntax for properties. (#585)
This commit is contained in:
parent
c85a26628c
commit
bdf6b910f9
10 changed files with 53 additions and 34 deletions
|
@ -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] == '?':
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue