@@ -72,21 +72,17 @@ class SerializationContext(ABC):
7272 Provides contextual information during serialization and deserialization operations.
7373
7474 Examples:
75-
7675 - In client code, when starting a workflow, or sending a signal/update/query to a workflow, or
7776 receiving the result of an update/query, or handling an exception from a workflow, the context
7877 type is :py:class:`WorkflowSerializationContext` and the workflow ID set of the target
7978 workflow will be set in the context.
80-
8179 - In workflow code, when operating on a payload being sent/received to/from a child workflow, or
8280 handling an exception from a child workflow, the context type is
8381 :py:class:`WorkflowSerializationContext` and the workflow ID is that of the child workflow,
8482 not of the currently executing (i.e. parent) workflow.
85-
8683 - In workflow code, when operating on a payload to be sent/received to/from an activity, the
8784 context type is :py:class:`ActivitySerializationContext` and the workflow ID is that of the
8885 currently-executing workflow. ActivitySerializationContext is also set on operations
89-
9086 """
9187
9288 pass
@@ -407,11 +403,11 @@ def from_payloads(
407403
408404 def with_context (self , context : Optional [SerializationContext ]) -> Self :
409405 """Return a new instance with the given context."""
410- instance = type (self ).__new__ (type (self ))
411406 converters = [
412407 c .with_context (context ) if isinstance (c , WithSerializationContext ) else c
413408 for c in self .converters .values ()
414409 ]
410+ instance = type (self ).__new__ (type (self ))
415411 CompositePayloadConverter .__init__ (instance , * converters )
416412 return instance
417413
0 commit comments