MCPcopy Create free account
hub / github.com/dagger/dagger / as_param

Method as_param

sdk/python/codegen/src/codegen/generator.py:630–640  ·  view source on GitHub ↗

As a parameter in a function signature.

(self)

Source from the content-addressed store, hash-verified

628 yield doc("\n\n".join(doc_parts))
629
630 def as_param(self) -> str:
631 """As a parameter in a function signature."""
632 type_ = "Self" if self.is_self else self.type
633 out = f"{self.name}: {type_}"
634 if self.default_is_mutable:
635 if not out.endswith("| None"):
636 out = f"{out} | None"
637 out = f"{out} = None"
638 elif self.has_default:
639 out = f"{out} = {self.default_value}"
640 return out
641
642 @joiner
643 def as_doc(self) -> Iterator[str]:

Callers 4

__str__Method · 0.95
test_input_field_paramFunction · 0.80
func_signatureMethod · 0.80

Calls

no outgoing calls

Tested by 2

test_input_field_paramFunction · 0.64