Главная
Study mode:
on
1
Intro
2
GOALS
3
TOPICS
4
VARIATIONS ON FIBONACCI NUMBER SELECTIONS
5
FIBONACCI NUMBER (DEFINITION)
6
FIBS LESS THAN N (PYTHON)
7
SMALLEST FIB GREATER/EQUALN(PYTHON)
8
THE PATTERN
9
TIME TO START REFACTORING YOUR CODE
10
CODE REFACTORING
11
EXTRACTING COMMON PARTS NOT DOABLE!
12
EXPERIMENT: COMBINE THE FIRST TWO FUNCTIONS
13
REFACTORING THE RIGHT WAY: SINGLE RESPONSIBILITY
14
CONTEXT SWITCH: GENERATOR FUNCTIONS
15
THE FIBONACCI NUMBER GENERATOR
16
EXAMPLE USAGE OF THE FIBONACCI GENERATOR
17
THE SMALLEST FIB GREATER/EQUAL N (PYTHON, REFACTORED)
18
RECAP
Description:
Explore techniques for refactoring code into generators in this 27-minute PyCon US talk by Jan-Hein Bührman. Learn how to identify common loop patterns and transform them into more maintainable and Pythonic code using generator functions. Discover how to combine custom generators with standard library tools and third-party packages to create efficient code pipelines. Follow along with a practical example using the Fibonacci sequence to understand the before-and-after effects of generator-based refactoring. Gain insights into recognizing opportunities for this refactoring pattern and improving code maintainability. Access accompanying slides for visual reference and additional details on the concepts presented.

When to Refactor Your Code into Generators and How

PyCon US
Add to list