@@ -425,8 +425,7 @@ def with_context(
425425 ``Field`` object aliases module names to avoid naming collisions
426426 in the file being written.
427427 """
428-
429- updated_msg = dataclasses .replace (
428+ return dataclasses .replace (
430429 self ,
431430 message = (
432431 self .message .with_context (
@@ -444,8 +443,6 @@ def with_context(
444443 meta = self .meta .with_context (collisions = collisions , context_cache = context_cache ),
445444 )
446445
447- return updated_msg
448-
449446 def add_to_address_allowlist (
450447 self ,
451448 * ,
@@ -834,8 +831,7 @@ def with_context(
834831 """
835832 visited_messages = visited_messages or set ()
836833 visited_messages = visited_messages | {self }
837-
838- updated_msg = dataclasses .replace (
834+ return dataclasses .replace (
839835 self ,
840836 fields = (
841837 {
@@ -863,8 +859,6 @@ def with_context(
863859 meta = self .meta .with_context (collisions = collisions , context_cache = context_cache ),
864860 )
865861
866- return updated_msg
867-
868862 def add_to_address_allowlist (
869863 self ,
870864 * ,
@@ -959,8 +953,7 @@ def with_context(self, *, collisions: Set[str], context_cache: Optional[Dict] =
959953 ``EnumType`` object aliases module names to avoid naming collisions in
960954 the file being written.
961955 """
962-
963- updated_msg = (
956+ return (
964957 dataclasses .replace (
965958 self ,
966959 meta = self .meta .with_context (collisions = collisions , context_cache = context_cache ),
@@ -969,8 +962,6 @@ def with_context(self, *, collisions: Set[str], context_cache: Optional[Dict] =
969962 else self
970963 )
971964
972- return updated_msg
973-
974965 def add_to_address_allowlist (
975966 self , * , address_allowlist : Set ["metadata.Address" ]
976967 ) -> None :
@@ -1090,8 +1081,7 @@ def with_context(
10901081 ``OperationInfo`` object aliases module names to avoid naming collisions
10911082 in the file being written.
10921083 """
1093-
1094- updated_msg = (
1084+ return (
10951085 self
10961086 if not collisions
10971087 else dataclasses .replace (
@@ -1109,8 +1099,6 @@ def with_context(
11091099 )
11101100 )
11111101
1112- return updated_msg
1113-
11141102 def add_to_address_allowlist (
11151103 self ,
11161104 * ,
@@ -1166,8 +1154,7 @@ def with_context(
11661154 ``OperationInfo`` object aliases module names to avoid naming collisions
11671155 in the file being written.
11681156 """
1169-
1170- updated_msg = dataclasses .replace (
1157+ return dataclasses .replace (
11711158 self ,
11721159 response_type = self .response_type .with_context (
11731160 collisions = collisions ,
@@ -1181,9 +1168,6 @@ def with_context(
11811168 ),
11821169 )
11831170
1184- return updated_msg
1185-
1186-
11871171 def add_to_address_allowlist (
11881172 self ,
11891173 * ,
@@ -1984,7 +1968,6 @@ def with_context(
19841968 ``Method`` object aliases module names to avoid naming collisions
19851969 in the file being written.
19861970 """
1987-
19881971 maybe_lro = None
19891972 if self .lro :
19901973 maybe_lro = (
@@ -2007,7 +1990,7 @@ def with_context(
20071990 else None
20081991 )
20091992
2010- updated_msg = dataclasses .replace (
1993+ return dataclasses .replace (
20111994 self ,
20121995 lro = maybe_lro ,
20131996 extended_lro = maybe_extended_lro ,
@@ -2024,8 +2007,6 @@ def with_context(
20242007 meta = self .meta .with_context (collisions = collisions , context_cache = context_cache ),
20252008 )
20262009
2027- return updated_msg
2028-
20292010 def add_to_address_allowlist (
20302011 self ,
20312012 * ,
@@ -2413,8 +2394,7 @@ def with_context(
24132394 ``Service`` object aliases module names to avoid naming collisions
24142395 in the file being written.
24152396 """
2416-
2417- updated_msg = dataclasses .replace (
2397+ return dataclasses .replace (
24182398 self ,
24192399 methods = {
24202400 k : v .with_context (
@@ -2428,8 +2408,6 @@ def with_context(
24282408 },
24292409 meta = self .meta .with_context (collisions = collisions , context_cache = context_cache ),
24302410 )
2431-
2432- return updated_msg
24332411
24342412 def add_to_address_allowlist (
24352413 self ,
0 commit comments