mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 16:34:47 -04:00
Use auto_attribs/native type hints for attrs classes. (#11692)
This commit is contained in:
parent
b92a2ff797
commit
10a88ba91c
40 changed files with 300 additions and 307 deletions
|
@ -39,7 +39,7 @@ from twisted.python.failure import Failure
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@attr.s
|
||||
@attr.s(slots=True, auto_attribs=True)
|
||||
@implementer(IPushProducer)
|
||||
class LogProducer:
|
||||
"""
|
||||
|
@ -54,10 +54,10 @@ class LogProducer:
|
|||
|
||||
# This is essentially ITCPTransport, but that is missing certain fields
|
||||
# (connected and registerProducer) which are part of the implementation.
|
||||
transport = attr.ib(type=Connection)
|
||||
_format = attr.ib(type=Callable[[logging.LogRecord], str])
|
||||
_buffer = attr.ib(type=deque)
|
||||
_paused = attr.ib(default=False, type=bool, init=False)
|
||||
transport: Connection
|
||||
_format: Callable[[logging.LogRecord], str]
|
||||
_buffer: Deque[logging.LogRecord]
|
||||
_paused: bool = attr.ib(default=False, init=False)
|
||||
|
||||
def pauseProducing(self):
|
||||
self._paused = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue