From 7c4e749138362ca032aa44b5e839dc854e947c88 Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Thu, 16 Jul 2026 16:00:28 +0000 Subject: [PATCH] Drop the redundant 'X as X' import aliases The 'import X as X' form is the explicit-re-export idiom for mypy's no_implicit_reexport, which this repo doesn't enable (commented out in mypy.ini), so plain imports re-export just as well. ContextResourceUsage is the one name not otherwise used in the module, so it keeps a noqa to mark the intentional re-export for ruff. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01JFbRtswu7rsHrttJFauUUb --- synapse/logging/context.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/synapse/logging/context.py b/synapse/logging/context.py index a15cb5c210..a10e2701d0 100644 --- a/synapse/logging/context.py +++ b/synapse/logging/context.py @@ -53,12 +53,13 @@ from twisted.python.threadpool import ThreadPool from synapse.logging.loggers import ExplicitlyConfiguredLogger from synapse.synapse_rust.logcontext import ( DEBUG_LOGGER_NAME, - SENTINEL_CONTEXT as SENTINEL_CONTEXT, - ContextResourceUsage as ContextResourceUsage, - LoggingContext as LoggingContext, - _Sentinel as _Sentinel, - current_context as current_context, - set_current_context as set_current_context, + SENTINEL_CONTEXT, + # Not used in this module, but re-exported: callers import it from here. + ContextResourceUsage, # noqa: F401 + LoggingContext, + _Sentinel, + current_context, + set_current_context, ) from synapse.util.stringutils import random_string_insecure_fast