Skip to content

Commit e854537

Browse files
committed
Use object equality as was intended
1 parent 0201fba commit e854537

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

temporalio/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2861,7 +2861,7 @@ def with_context(self, context: SerializationContext) -> Self:
28612861
context data to the data converter used to serialize and encode the outbound payloads.
28622862
"""
28632863
data_converter = self._client.data_converter.with_context(context)
2864-
if data_converter == self._client.data_converter:
2864+
if data_converter is self._client.data_converter:
28652865
return self
28662866
cls = type(self)
28672867
if cls.__init__ is not AsyncActivityHandle.__init__:

temporalio/converter.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ def with_context(self, context: SerializationContext) -> Self:
427427
for c in self.converters.values():
428428
if isinstance(c, WithSerializationContext):
429429
converters.append(c.with_context(context))
430-
any_with_context |= converters[-1] != c
430+
any_with_context |= converters[-1] is not c
431431
else:
432432
converters.append(c)
433433

@@ -1348,7 +1348,7 @@ def with_context(self, context: SerializationContext) -> Self:
13481348
if isinstance(failure_converter, WithSerializationContext):
13491349
failure_converter = failure_converter.with_context(context)
13501350
if all(
1351-
new == orig
1351+
new is orig
13521352
for new, orig in [
13531353
(payload_converter, self.payload_converter),
13541354
(payload_codec, self.payload_codec),

0 commit comments

Comments
 (0)