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:

Hi can you please upload the slides for the talk so that your proposal can be reviewed.

Pradhvan Bisht (~cyber_freak)

I haven't put together slides for this Pradhvan. Will try and have something in the next two weeks.

Anand S (~anand40)

Took me a while to get this together, but for future reference, here are the slides I used at PyConf Hyderabad on this topic: https://www.slideshare.net/gramener/dont-repeat-yourself-and-automated-code-reviews

Anand S (~anand40)

Login to add a new comment.