File tree Expand file tree Collapse file tree 3 files changed +4
-9
lines changed
Expand file tree Collapse file tree 3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -537,10 +537,6 @@ class AsyncBoundLogger:
537537 #: synchronously occasionally.
538538 sync_bl : BoundLogger
539539
540- # Blatant lie, we use a property for _context. Need this for Protocol
541- # though.
542- _context : Context
543-
544540 _executor = None
545541 _bound_logger_factory = BoundLogger
546542
@@ -565,11 +561,9 @@ def __init__(
565561 )
566562 self ._loop = asyncio .get_running_loop ()
567563
568- # We have to ignore the type because we've already declared it to ensure
569- # we're a BindableLogger.
570564 # Instances would've been correctly recognized as such, however the class
571565 # not and we need the class in `structlog.configure()`.
572- @property # type: ignore[no-redef]
566+ @property
573567 def _context (self ) -> Context :
574568 return self .sync_bl ._context
575569
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ def as_immutable(logger: TLLogger) -> TLLogger:
127127 processors = logger ._processors , # type: ignore[attr-defined]
128128 context = {},
129129 )
130- bl ._context = ctx
130+ bl ._context = ctx # type: ignore[misc]
131131
132132 return bl
133133 except AttributeError :
Original file line number Diff line number Diff line change @@ -136,7 +136,8 @@ class BindableLogger(Protocol):
136136 .. versionadded:: 20.2.0
137137 """
138138
139- _context : Context
139+ @property
140+ def _context (self ) -> Context : ...
140141
141142 def bind (self , ** new_values : Any ) -> Self : ...
142143
You can’t perform that action at this time.
0 commit comments