mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Only convert to an indexable sequence if absolutely necessary
This commit is contained in:
committed by
Rodrigo Girão Serrão
parent
948cb6676f
commit
274bb634ca
@@ -57,10 +57,11 @@ def test_get_item_from_immutable_sequence() -> None:
|
||||
assert wrap(range(10))[0] == 0
|
||||
assert wrap(range(10))[-1] == 9
|
||||
|
||||
|
||||
def test_get_slice_from_immutable_sequence() -> None:
|
||||
"""It should be possible to get a slice from an immutable sequence."""
|
||||
assert list(wrap(range(10))[0:2]) == [0,1]
|
||||
assert list(wrap(range(10))[0:-1]) == [0,1,2,3,4,5,6,7,8]
|
||||
assert list(wrap(iter(range(10)))[0:2]) == [0,1]
|
||||
assert list(wrap(iter(range(10)))[0:-1]) == [0,1,2,3,4,5,6,7,8]
|
||||
|
||||
|
||||
def test_immutable_sequence_contains() -> None:
|
||||
|
||||
Reference in New Issue
Block a user