Skip to content

Conversation

@danielenricocahall
Copy link
Contributor

For slicing (i.e; [1:-1]), add support for negative values by adding the length to the value. Basic idea:

test = "test"
test[1:-1] == "es" # True
test[1:len(test) - 1] == "es"  # True
test[1:len(test) - 1]  == test[1:-1] # True

@btwael
Copy link
Owner

btwael commented Apr 7, 2020

Good job, thank you.

@btwael btwael merged commit 73344d1 into btwael:master Apr 7, 2020
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

Successfully merging this pull request may close these issues.

2 participants