Skip to content

3rd ed., Item46, Refine run_cascading() function #123

@HayaoSuzuki

Description

@HayaoSuzuki

The function run_cascading() of Item 46 can be improved as follows:

def run_cascading():
    amplitudes = [7, 7, 7, 2, 2, 2, 2, 10, 10, 10, 10, 10]
    it = complex_wave_cascading(iter(amplitudes))  # Iterator
    for output in it:
        transmit(output)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions