In this article Alessandro provides an overview of Abstract Syntax Trees (ASTs), introduces a few use-cases, and showcases the ast module in the Python Standard Library. The content is structured in a top-down fashion, starting from general notion about an AST, and digging deeper up to the point of artificially manipulating an AST to “randomize” the content of some instructions.
Articles on Concepts
Mutable vs Immutable Data Types in Python
By Bob Belderbos on 27 April 2020
Knowing the difference between mutable and immutable types in Python is important. In this article I will give you some practical examples of both and show you some of the advantages of using immutable types. We even look at JS / React / functional programming a bit towards the end.
Exploring the Modern Python Command-Line Interface
By Erik O'Shaughnessy on 27 April 2020
Delve into the why and the how of writing command-line tools using Python.
When to Write Classes in Python And Why it Matters
By Bob Belderbos on 25 April 2020
When people come to Python one of the things they struggle with is OOP (Object Oriented Programming). Not so much the syntax of classes, but more when and when not to use them. If that’s you, read on. In this article I will give you some insights that will get you clarity on this.
4 Common Mistakes When Learning Python and Programming
By Bob Belderbos on 19 March 2020
How are you progressing with your Python? What could be holding you back? I gave it some thought and identified 4 issues we commonly see that hold people back from becoming a proficient Pythonista and programmer.
Introduction to Python Functions
By Julian Sequeira on 11 February 2020
In this article I’m going to break down what a function is and how you can use them to be a better coder.
Under the Hood: Python Comparison Breakdown
By AJ Kerrigan on 27 October 2019
Use Python’s “dis” module to see how Python evaluates two similar comparison operations.
Linting with Flake8
By Julian Sequeira on 8 October 2019
What the heck is linting? Let’s dive into the concept and talk about how flake8 can help us make our code better.
3 Cool Things You Can do With the dateutil Module
By Bob Belderbos on 30 November 2018
In this short article I will show you how to use dateutil’s parse, relativedelta and rrule to make it easier to work with datetimes in Python.
A Python Orientation – How to Get Started
By Andrew Knight on 17 August 2018
Python is a wonderful language for both beginners and expert programmers, but getting started can be daunting. Which version should I use? Which editors are best? What do you mean there are different implementations and environments? Here’s a guide to help navigate these big FAQs.