python-tutorial icon indicating copy to clipboard operation
python-tutorial copied to clipboard

Errors found in `functions_advanced` notebook

Open fabioacl opened this issue 1 year ago • 4 comments

fabioacl avatar Dec 11 '23 14:12 fabioacl

In the Decorators, there is a typo in the print inside the fcounter function: has beel instead of has been.

fabioacl avatar Dec 11 '23 14:12 fabioacl

Suggestion:

In Fibonnaci sequence using reduce, maybe it would be helpful to also have a reminder that reduce can have a 3rd entry which is the starting point for the sum

GCatarina avatar Dec 12 '23 14:12 GCatarina

In the last example (once), the following line is missing:

import typing as t

anates avatar Dec 12 '23 15:12 anates

In the example code in the same example (once), given as

import time

@once(15)
def hello(name):
    return f"Hello, {name}!"

for i in range(30):
    print(i)
    try:
        time.sleep(3)
        print(hello(f"attempt #{i}"))
    except TooSoonError as err:
        print(f"Too soon: {err}")

the example error is defined as TooSoonError, which is not defined else. As discussed on Slack, this is a leftover from testing, and could be marked as such. Thanks!

anates avatar Dec 12 '23 16:12 anates