At one place I consult I saw something like the following code:
This is good and valid Python code, however we can use the slice built-in slice to do the same job.
Also when you're writing your own __getitem__ consider that key might be a slice object.
No comments:
Post a Comment