About __getitem__()
In Python __getitem__(self, index) method is called for both, when you try to get an item at an indexed position and when you want to slice a collection from start to the end position.
In the first case, index is an integer.
And in the second case, index is a slice object.
Also by me
Django Messaging 🎅🏼
For Django-based social platforms.
Django App for You
Django Paddle Subscriptions 🎅🏼
For Django-based SaaS projects.
Django App for You
Django GDPR Cookie Consent 🎅🏼
For Django websites that use cookies.
Django App for You