Skip to content

Commit

Permalink
shave some more time by calling cartesian_product directly rather t…
Browse files Browse the repository at this point in the history
…han via `tupleize` #184
  • Loading branch information
HighDiceRoller committed Jun 10, 2024
1 parent dca5c3d commit fee6dbb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/icepool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

from icepool.population.base import Population
from icepool.population.die import implicit_convert_to_die, Die
from icepool.collection.vector import tupleize, vectorize, Vector
from icepool.collection.vector import cartesian_product, tupleize, vectorize, Vector
from icepool.collection.symbols import Symbols
from icepool.population.again import AgainExpression

Expand Down
3 changes: 2 additions & 1 deletion src/icepool/creation_args.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ def expand_arg(
elif arg is icepool.Reroll:
return {}
elif type(arg) == tuple:
arg = cast('T | icepool.Population[T]', icepool.tupleize(*arg))
arg = cast('T | icepool.Population[T]',
icepool.cartesian_product(*arg, outcome_type=tuple))
if type(arg) == tuple:
return {arg: 1} # type: ignore
else: # converted to Population
Expand Down

0 comments on commit fee6dbb

Please sign in to comment.