Code generation in Python

Anand S (~anand40)


4

Votes

Description:

This talk explores the techniques and applications of code parsing, code refactoring and code generation.

Python interpreters can read and rewrite Python code. That means you can write a program that takes this function:

def increment(value):
    return value + 1

and replace it with a more generic:

def increment(value, by=1):
    return value + by

... on the fly.

We will look at how the ast module helps parse Python code, and how it can be re-written.

Prerequisites:

A rock solid understanding of Python

Speaker Info:

Anand is a co-founder of Gramener, a data science company. He leads a team of data enthusiasts with skills in analysis, design, programming and statistics.

Section: Core Python
Type: Talks
Target Audience: Advanced
Last Updated: