+1 -1 +32
Vote on this proposal

Generators and Coroutines

by Abhishek Ghose (speaking)

Section
Core Python
Technical level
Intermediate

Objective

You will learn about Python generators and coroutines (fun stuff, really!)

Description

In this session I would look at a couple of relatively less used features of Python - generators and coroutines.
This would be the break-up of the talk:

  1. Intro: A broad view of the general idea, which is a superset of the implementation Python has. Here is how Knuth, very aptly, describes them: "Subroutines are special cases of more general program components, called "coroutines". In contrast to the unsymmetric relationship between a main routine and a subroutine, there is complete symmetry between coroutines , which call on each other."*

  2. Syntax and syntactical nuances

  3. Some smallish examples to make their usage clear. We would see how using this features can help us setup "pipelines" to implement data pipelines, and in general, producer-consumer type scenarios, help us in thinking in a "declarative" manner, where (and if) they save in memory and computation, etc.

  4. We would look at some "real-world" code snippets (i.e. from existing libraries) where these features have been used. I have not decided on the libraries yet but I'll probably pick something like gevent, psycopg2 etc

*from Sec 1.4.2, The Art of Computer Programming, Vol 1, by Donald Knuth.

Requirements

A basic understanding of Python.

Speaker bio

I am a Data Scientist at [24]7 (http://www.247-inc.com/). My work involves using Machine Learning to model data. This includes implementing tools/libraries for internal use which can simplify working with certain kinds of data/algorithms. Python is a popular choice in our group since it helps us prototype ideas quickly.

Bio on LinkedIn: https://www.linkedin.com/profile/view?id=86003065

Comments


  • 1

    [-] Senthil Kumaran 228 days ago

    Hi Abhishek, have you presented this talk at local user groups? Is this your first talk experience?


  • 1

    [-] Abhishek Ghose 228 days ago (edited 228 days ago)

    No, I have not presented this to any local groups.

    This is not my first talk experience - although a first in PyCon. I have presented to internal teams, customers, training programs, in the academia, as part of recruitment panels to colleges, etc., prior to this.

Login with Twitter or Google to leave a comment →