The collections module has another handy tool called defaultdict. The defaultdict is a subclass of Python's dict that accepts a default_factory as its primary argument. The default_factory is usually a Python type, such as int or list, but you can also use a function or a lambda too. Let's start by creating a regular Python […]
This week we welcome Massimo DiPierro (@mdipierro) as our PyDev of the Week! Massimo is the inventor and lead developer of web2py, but he's also contributed to lots of other projects which you can see on his github profile. He is also the author of the following books: Annotated Algorithms in Python: with Applications in […]
Python's collections module has specialized container datatypes that can be used to replace Python's general purpose containers. The one that we'll be focusing on here is the namedtuple which you can use to replace Python's tuple. Of course, the namedtuple is not a drop-in replacement as you will soon see. I have seen some programmers […]
I noticed that CodeEval put out a post that Python is their most popular programming language for 5 years in a row! Admittedly, their Python usage has dropped 14% while others have gained, but Python has still managed to stay in the lead.
This week we welcome Hynek Schlawack (@hynek) as our PyDev of the Week! Hynek is an avid member of the Python community and a fellow of the Python Software Foundation. He has contributed to many projects and writes his own Python blog. Let's spend some time getting to know him better! Can you tell us […]
I am happy to announce my latest project, which is the sequel to my Python 101 book: Python 201 - Intermediate Python. I am launching a Kickstarter campaign to help fund its publication so if you're interested in supporting, you can do so here: https://www.kickstarter.com/projects/34257246/python-201-intermediate-python If you already know the basics of Python and now […]