Upgrading Python lists
Upgrading Python lists

Adding useful functionalities to Python lists

Image source: JoeyBLS photography

Introduction

Python lists are good. But they’re not great. There is so much functionality that can be easily added to them but is still missing. Indexing with booleans, easily creating dictionaries from them, appending more than one element at a time, so on and so forth. Well, not anymore.

Fastai has come up with their own data structure called L . It can do everything that a Python list can do and much more.

The purpose of this article is to show you how easy it is to write such useful functionalities on your own. Especially if you are a beginner, try creating a mini-version of this library. Try writing some of the functionalities you hoped existed. It’ll be a good learning experience.

For now, let’s learn about L. Here is the Colab link if you’d. Make a copy on your Colab (File->Save a copy in drive)and run the first cell only once. Your notebook will crash. But you’ll be ready to use the library right away.

Google Colaboratory Link.

What is L?
['Dipam Vasani']
['Programming', 'Python']