PyData London 2016
This talk describes how the interpreter iterates over containers when any construct involving the for keyword is used. It explains both the "old" and the "new" iteration protocols, demonstrates the difference between iterables and iterators, suggests implementation techniques to allow you to define your own iterables and iterators and points out some advantages of generators.
The talk's outline is given below. It will take approximately 25 minutes to deliver the material, the remainder being reserved for Q&A.
Iteration History (4 minutes)
Enter the Iterable (10 minutes) Recognizing Iterators Iterating over Iterators Why we Need Iterables
Writing Your Own Iterators and Iterables (10 minutes) The Basic Iterator Pattern The Advantages of Generators The Basic Iterable Pattern Python Native Iterables
Summary (1 minute)
GitHub: https://github.com/steveholden/iteration 00:00 Welcome!
00:10 Help us add time stamps or captions to this video! See the description for details.
Want to help add timestamps to our YouTube videos to help with discoverability? Find out more here: https://github.com/numfocus/YouTubeVi...
Смотрите видео Steve Holden - Iterables and Iterators: Going Loopy With Python онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал PyData 08 Май 2016. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 2,328 раз и оно понравилось 33 посетителям.