From d72d66b6d3bf9865beebf8af26f09daccd2b854a Mon Sep 17 00:00:00 2001 From: tigo Date: Sat, 26 Jul 2025 16:10:14 -0300 Subject: [PATCH] style: standardize property null checks to use ternary operators --- src/a2a/server/agent_execution/context.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/a2a/server/agent_execution/context.py b/src/a2a/server/agent_execution/context.py index 8b1559aa..4ac5fb0e 100644 --- a/src/a2a/server/agent_execution/context.py +++ b/src/a2a/server/agent_execution/context.py @@ -127,9 +127,7 @@ def context_id(self) -> str | None: @property def configuration(self) -> MessageSendConfiguration | None: """The `MessageSendConfiguration` from the request, if available.""" - if not self._params: - return None - return self._params.configuration + return self._params.configuration if self._params else None @property def call_context(self) -> ServerCallContext | None: @@ -139,9 +137,7 @@ def call_context(self) -> ServerCallContext | None: @property def metadata(self) -> dict[str, Any]: """Metadata associated with the request, if available.""" - if not self._params: - return {} - return self._params.metadata or {} + return self._params.metadata or {} if self._params else {} def add_activated_extension(self, uri: str) -> None: """Add an extension to the set of activated extensions for this request.