Загрузка...

Why Bother with Generators? | Better Bots with Generator Coroutines Pt 2

This is part of the Python Bots: Transform & Roll out - Generator Coroutines series.

Sign up for DUTC Weekly: https://mailchi.mp/dutc/ytweekly

LinkedIn: https://www.linkedin.com/company/do-n-t-use-this-code/
Website: https://www.dontusethiscode.com/index.html
Upcoming events: learning.dutc.io
Looking for training? Contact info@dutc.io

How do we write cleaner, more extensible, bots using generator coroutines?

When we design our bots, we often need to have highly stateful, interactive automations. "If a user does …, then …, or do …, which affects the next choice you make to do …" Typical ways of structuring this logic leads to complex, brittle code that you can't make heads or tails of!

But if we use generator coroutines, we can implement extremely complex workflows in very little code, and the code will be readable, extensible, and maintainable.

Generator coroutines are one of the most powerful features of Python that you probably aren't using yet, and they are extremely well suited to bot development!

Видео Why Bother with Generators? | Better Bots with Generator Coroutines Pt 2 канала Don't Use This Code • James Powell
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять