# Collection like objects in python

DevFeed: [Collection like objects in python](<https://devfeed.tech/articles/collection-like-objects-in-python-27328.md>)

Original publisher: [Read original article](<https://blog.pchudzik.com/202004/python-and-collection-like-objects/>)

Published: 2020-04-15T00:00:00Z

Content type: tutorial

Language: en

Sources: [Paweł Chudzik](<https://devfeed.tech/sources/pawe-chudzik.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Protocol (disambiguation)](<https://devfeed.tech/topics/protocol.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [behavior](<https://devfeed.tech/tags/behavior.md>), [class](<https://devfeed.tech/tags/class.md>), [collections](<https://devfeed.tech/tags/collections.md>), [dsl](<https://devfeed.tech/tags/dsl.md>), [functional](<https://devfeed.tech/tags/functional.md>), [list](<https://devfeed.tech/tags/list.md>), [programming-language](<https://devfeed.tech/tags/programming-language.md>), [protocol](<https://devfeed.tech/tags/protocol.md>), [python](<https://devfeed.tech/tags/python.md>), [set](<https://devfeed.tech/tags/set.md>), [slices](<https://devfeed.tech/tags/slices.md>)

## AI overview

A tutorial on implementing Python collection-like objects using the collections protocol. It discusses slices and methods such as __getitem__, __setitem__, __delitem__, __iter__, __contains__, and __missing__, including how they support collection behavior and domain-specific language extensions.

## Source excerpt

Collections are an important part of every programming language. In python, there is a couple of built-in collections like list, set, dictionary but I'm not going to dig into them now. In this post, I'll explore what it takes to implement collection like objects on your own using collections protocol. Read more