i didn't think about slices although a different language could require tuples be inside () and use , in place of : in the square brackets. i was thinking about the : that follow keywords like def, if, else, for, while, try. except ... well, eventually follow. what if that language looked like:
class GetItem def __class_getitem__(self, key) if isinstance(key, slice) print("Key is a slice") elif isinstance(key, tuple) print("Key is a tuple") if all(isinstance(item, slice) for item in key) print("All items are slices") elif any(isinstance(item, slice) for item in key) print("One or more items are a slice instance") else print("Got something else") return key ...
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.