File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -1312,3 +1312,29 @@ from native import f
13121312print(f(1))
13131313[out]
131413142
1315+
1316+ [case testStarArgFastPaths]
1317+ from typing import Any, Mapping
1318+ def fn(x: str, y: int) -> str:
1319+ return x * y
1320+ def star_tuple(*args: Any) -> None:
1321+ return fn(*args)
1322+ def star_list(args: list[Any]) -> None:
1323+ return fn(*args)
1324+ def star_generic(args: dict[Any, Any]) -> str:
1325+ return fn(*args)
1326+ def star2(**kwargs: Any) -> None:
1327+ return fn(**kwargs)
1328+ def star2_generic(kwargs: Mapping[Any, Any]) -> None:
1329+ return fn(**kwargs)
1330+
1331+ def test_star_fastpath_tuple() -> None:
1332+ assert star_tuple("a", 3) == "aaa"
1333+ def test_star_fastpath_list() -> None:
1334+ assert star_list(["a", 3]) == "aaa"
1335+ def test_star_fastpath_generic() -> None:
1336+ assert star_generic({"a": None, 3: None}) == "aaa"
1337+ def test_star2_fastpath() -> None
1338+ assert star2(x="a", y=3) == "aaa"
1339+ def test_star2_fastpath_generic() -> None
1340+ assert star2_generic({x: "a", y: 3}) == "aaa"
You can’t perform that action at this time.
0 commit comments