Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map expansion and starring #204

Open
3 tasks done
HighDiceRoller opened this issue Oct 3, 2024 · 2 comments
Open
3 tasks done

map expansion and starring #204

HighDiceRoller opened this issue Oct 3, 2024 · 2 comments

Comments

@HighDiceRoller
Copy link
Owner

HighDiceRoller commented Oct 3, 2024

  • Allow switching star after first repeat?

Decided against this.

  • Should star=True expand dice within the first argument?

Against:

  • Added complexity in implementation and API.
  • Most starting states are singular.

For:

  • This makes star behave the same as sending the unpacked arguments directly.
  • Since I'm not going with star switching after first repeat, this effect would require explicit tupleize otherwise.

Decision: I'm going to hold off at least for now.

  • Explicit NoExpand wrapper to prevent expansion?

Done.

@HighDiceRoller
Copy link
Owner Author

HighDiceRoller commented Jan 27, 2025

star switching as a problem: not only do we need to infer star, we need to replace a number of original arguments equal to the output arity of repl. For example:

map(lambda x, y: (x, y), 0, 1, repeat=10)

should keep producing (0, 1), but this requires removing both 0 and 1. This seems sufficiently unintuitive that I'd rather force the initial state to be explicitly tupled.

@HighDiceRoller HighDiceRoller changed the title Allow switching star after first repeat? map expansion and starring Jan 28, 2025
HighDiceRoller added a commit that referenced this issue Jan 28, 2025
…t to expand an argument

add `Expandable` protocol which defines the `_items_for_cartesian_product` property

re: #204
HighDiceRoller added a commit that referenced this issue Jan 28, 2025
@HighDiceRoller
Copy link
Owner Author

Backed off on this for now, pending deciding if/how to forward **kwargs in #218 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant