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

Generate negative indices from the slices() strategy #2468

Closed
Zac-HD opened this issue Jun 19, 2020 · 2 comments · Fixed by #2511
Closed

Generate negative indices from the slices() strategy #2468

Zac-HD opened this issue Jun 19, 2020 · 2 comments · Fixed by #2511
Labels
enhancement it's not broken, but we want it to be better

Comments

@Zac-HD
Copy link
Member

Zac-HD commented Jun 19, 2020

For example, slices(size=3) should be able to generate slice(-3, -1) as an equivalent form of slice(0, 2). We should also sometimes draw step=None if step=1 would be allowed. It would also be nice to support slicing length-zero sequences, i.e. if size == 0: return builds(slice, none(), none(), none() | integers().filter(bool)).

Both would be helpful for downstream users - see e.g. Quansight-Labs/ndindex#46.

@Zac-HD Zac-HD added the enhancement it's not broken, but we want it to be better label Jun 19, 2020
@kir0ul
Copy link
Contributor

kir0ul commented Jul 25, 2020

Oh damn, was working on that one too 🙁

@Zac-HD
Copy link
Member Author

Zac-HD commented Jul 25, 2020

Sorry @kir0ul 😕

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement it's not broken, but we want it to be better
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants