PLAY PODCASTS
Generators, Coroutines, and Learning Python Through Exercises
Episode 39

Generators, Coroutines, and Learning Python Through Exercises

The Real Python Podcast · Real Python

December 11, 20201h 5m

Audio is streamed directly from the publisher (dts.podtrac.com) as published in their RSS feed. Play Podcasts does not host this file. Rights-holders can request removal through the copyright & takedown page.

Show Notes

<p>Have you started to use generators in Python? Are you unsure why you would even use one over a regular function? How do you use the special &ldquo;send&rdquo; method and the &ldquo;yield from&rdquo; syntax? This week on the show, we have Reuven Lerner to talk about his PyCon Africa 2020 talk titled &ldquo;Generators, coroutines, and nanoservices.&rdquo;</p> <p>Reuven helps developers around the world become more fluent in Python. We talk about some of his teaching techniques and also how he continues to learn. Reuven is a believer in the continued practice of Python through exercises. We discuss his book &ldquo;Python Workout&rdquo; and his Weekly Python Exercise courses.</p> <div class="alert alert-primary" role="alert"> <p><strong>Course Spotlight:</strong> <a href="https://realpython.com/courses/python-generators/">Python Generators 101</a> </p> <p>In this step-by-step course, you&rsquo;ll learn about generators and yielding in Python. You&rsquo;ll create generator functions and generator expressions using multiple Python yield statements. You&rsquo;ll also learn how to build data pipelines that take advantage of these Pythonic tools.</p> </div> <p>Topics:</p> <ul> <li>00:00:00 &ndash; Introduction</li> <li>00:01:38 &ndash; Reuven&rsquo;s web site: Teaching Python and Data Science around the world</li> <li>00:03:39 &ndash; Training remotely and screen-time overload</li> <li>00:07:03 &ndash; Info-tainment and sparking engagement</li> <li>00:11:05 &ndash; PyCon Africa 2020 - Generators, Coroutines, and Nanoservices</li> <li>00:13:34 &ndash; Using dis() - disassembler for Python bytecode</li> <li>00:15:09 &ndash; Exceptions as signals, not exclusively for errors</li> <li>00:17:39 &ndash; What makes generator functions different?</li> <li>00:22:05 &ndash; Using .send() and creating a coroutine </li> <li>00:23:39 &ndash; Sponsor: Scout APM</li> <li>00:24:40 &ndash; Stopping the generator with .throw()</li> <li>00:26:28 &ndash; Additional uses for generators</li> <li>00:30:03 &ndash; Python Workout: 50 ten-minute exercises</li> <li>00:34:22 &ndash; A combination of techniques and sources for continued learning</li> <li>00:40:15 &ndash; Weekly Python Exercise</li> <li>00:42:02 &ndash; Video Course Spotlight</li> <li>00:43:08 &ndash; Bachelor degree in CS, but a Doctorate in learning sciences</li> <li>00:48:26 &ndash; What are additional techniques you use to keep learning?</li> <li>00:50:18 &ndash; Teaching is a great way to keep learning</li> <li>00:51:28 &ndash; What areas of data science are you focusing on?</li> <li>00:53:22 &ndash; The Business of Freelancing: podcast</li> <li>00:56:26 &ndash; What is something you thought you knew about Python, but were wrong about?</li> <li>00:59:24 &ndash; What is something you are excited about in the world of Python?</li> <li>01:02:18 &ndash; Conferences and user groups</li> <li>01:05:03 &ndash; Thanks and goodbye</li> </ul> <p>Show Links:</p> <ul> <li><a href="https://lerner.co.il/">Teaching Python and Data Science around the world: Reuven&rsquo;s Training Site</a></li> <li><a href="https://lerner.co.il/newsletter/">Reuven&rsquo;s newsletter</a></li> <li><a href="https://africa.pycon.org/speakers/reuven-m-lerner#talk">Generators, Coroutines, and Nanoservices: Pycon Africa 2020</a></li> <li><a href="https://www.python.org/dev/peps/pep-0255/">PEP 255 &ndash; Simple Generators: Python docs</a></li> <li><a href="https://realpython.com/introduction-to-python-generators/#how-to-use-send">How to Use Generators and yield in Python: Real Python article</a></li> <li><a href="https://docs.python.org/3/library/dis.html?highlight=dis#module-dis">dis — Disassembler for Python bytecode: Python docs</a></li> <li><a href="https://docs.python.org/3/c-api/exceptions.html?highlight=exception">Exception Handling: Python docs</a></li> <li><a href="https://www.manning.com/books/python-workout">Python Workout : 50 ten-minute exercises - Manning</a></li> <li><a href="https://store.lerner.co.il/wpe">Weekly Python Exercise Course</a></li> <li><a href="https://www.youtube.com/channel/UCgBncpylJ1kiVaPyP-PZauQ">Luis Serrano: machine learning &amp; math made easy - YouTube channel </a></li> <li><a href="https://www.businessoffreelancing.com/">The Business of Freelancing: Podcast</a></li> <li><a href="https://realpython.com/podcasts/rpp/29/">RPP Episode 29: Resolving Package Dependencies With the New Version of Pip</a></li> <li><a href="https://tools.simplysecure.org/survey/index.php?r=survey/index&amp;sid=827389&amp;lang=en">Sign-up for pip UX Studies!</a></li> </ul> <p>Level up your Python skills with our expert-led courses:</p> <ul> <li><a href="https://realpython.com/courses/intermediate-project-ideas/">Grow Your Python Portfolio With 13 Intermediate Project Ideas</a></li> <li><a href="https://realpython.com/courses/python-generators/">Python Generators 101</a></li> <li><a href="https://realpython.com/courses/speed-python-concurrency/">Speed Up Python With Concurrency</a></li> </ul> <p><a rel="payment" href="https://realpython.com/join">Support the podcast &amp; join our community of Pythonistas</a></p>