MCPcopy Index your code
hub / github.com/github/copilot-sdk / getOrCreatePyUnionAlias

Function getOrCreatePyUnionAlias

scripts/codegen/python.ts:1793–1809  ·  view source on GitHub ↗
(
    aliasName: string,
    members: string[],
    ctx: PyCodegenCtx,
    description?: string
)

Source from the content-addressed store, hash-verified

1791}
1792
1793function getOrCreatePyUnionAlias(
1794 aliasName: string,
1795 members: string[],
1796 ctx: PyCodegenCtx,
1797 description?: string
1798): string {
1799 if (!ctx.aliasesByName.has(aliasName)) {
1800 const lines: string[] = [];
1801 if (description) {
1802 lines.push(`# ${description}`);
1803 }
1804 lines.push(`${aliasName} = ${members.join(" | ")}`);
1805 ctx.aliasesByName.add(aliasName);
1806 ctx.aliases.push(lines.join("\n"));
1807 }
1808 return aliasName;
1809}
1810
1811function resolvePyNamedUnion(
1812 typeName: string,

Callers 1

resolvePyNamedUnionFunction · 0.85

Calls 3

joinMethod · 0.80
pushMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…