[mdns] Add comment explaining why manual lambda wrapping is needed

This commit is contained in:
J. Nick Koston
2026-04-07 14:18:32 -10:00
parent 6d0c61dc73
commit 89bd529cf9
+2 -1
View File
@@ -132,7 +132,8 @@ def mdns_service(
Returns:
A StructInitializer representing a MDNSService struct
"""
# Wrap port in a stateless lambda for TemplatableFn storage
# Wrap port in a stateless lambda for TemplatableFn storage.
# Can't use cg.templatable() here because this is a sync function.
if not isinstance(port, LambdaExpression):
port = LambdaExpression(
f"return {cg.safe_exp(port)};", [], capture="", return_type=cg.uint16