mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +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
|
@ -465,8 +465,13 @@ class Listener(object):
|
|||
self._listener = None
|
||||
listener.close()
|
||||
|
||||
address = property(lambda self: self._listener._address)
|
||||
last_accepted = property(lambda self: self._listener._last_accepted)
|
||||
@property
|
||||
def address(self):
|
||||
return self._listener._address
|
||||
|
||||
@property
|
||||
def last_accepted(self):
|
||||
return self._listener._last_accepted
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue