Episode 35 – Sylvain Thénault on ASTroid

Visit our site to listen to past episodes, support the show, and sign up for our mailing list.

Summary

The Python AST (Abstract Syntax Tree) is a powerful abstraction that allows for a number of innovative projects. ASTroid is a library that provides additional convenience methods to simplify working with the AST. In this episode we spoke with Sylvain Thénault from Logilab about his work on ASTroid and how it is used to power the popular PyLint static analysis tool.

Brief Introduction

  • Hello and welcome to Podcast.__init__, the podcast about Python and the people who make it great.
  • Subscribe on iTunes, Stitcher, TuneIn or RSS
  • Follow us on Twitter or Google+
  • Give us feedback! Leave a review on iTunes, Tweet to us, send us an email or leave us a message on Google+
  • I would like to thank everyone who has donated to the show. Your contributions help us make the show sustainable. For details on how to support the show you can visit our site at pythonpodcast.com
  • I would also like to thank Hired, a job marketplace for developers, for sponsoring this episode of Podcast.__init__. Use the link hired.com/podcastinit to double your signing bonus.
  • Linode is sponsoring us this week. Check them out at linode.com/podcastinit and get a $10 credit to try out their fast and reliable Linux virtual servers for your next project
  • We are recording today on November 23rd, 2015 and your hosts as usual are Tobias Macey and Chris Patti
  • Today we are interviewing Sylvain Thénault about ASTroid
Hired LogoOn Hired software engineers & designers can get 5+ interview requests in a week and each offer has salary and equity upfront. With full time and contract opportunities available, users can view the offers and accept or reject them before talking to any company. Work with over 2,500 companies from startups to large public companies hailing from 12 major tech hubs in North America and Europe. Hired is totally free for users and If you get a job you’ll get a $2,000 “thank you” bonus. If you use our special link to signup, then that bonus will double to $4,000 when you accept a job. If you’re not looking for a job but know someone who is, you can refer them to Hired and get a $1,337 bonus when they accept a job.

Linode Sponsor BannerUse the promo code podcastinit10 to get a $10 credit when you sign up!

Interview with Sylvain Thénault

  • Introductions
  • How did you get introduced to Python? – Chris
  • Can you explain what an Abstract Syntax Tree is and why it is a useful language feature? – Tobias
  • What was your inspiration for creating ASTroid? – Chris
  • What features does ASTroid offer over Python’s standard AST package, and what makes those features important? – Chris
  • I know that the ASTroid package is used in Pylint which is also maintained by Logilab. How does the AST facilitate static analysis of Python projects and are there cases where you have to fall back to text parsing? – Tobias
  • Beyond static analysis, what are some of the other possible uses for the Python AST? – Tobias
  • The documentation for the AST package in Python mentions that the specific syntax objects in the tree are subject to change between releases. Does the ASTroid package provide any abstractions to maintain a consistent API between versions or does it just provide a pass-through? – Tobias
  • Have you encountered any challenges in testing ASTroid given that it operates at such a low level in the language? – Chris
  • Do you have trouble attracting contributors given the great understanding of Python’s inner working required? – Chris
  • Does the implementation or representation of the AST differ between different distributions of Python such as CPython, PyPy and Jython? – Tobias
  • What are some of the most interesting applications ASTroid has been used in? – Chris

Picks

Keep In Touch

Links

The intro and outro music is from Requiem for a Fish The Freak Fandango Orchestra / CC BY-SA