Skip to content

Errors found in functions_advanced #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
edoardob90 opened this issue May 9, 2025 · 0 comments · May be fixed by #320
Open

Errors found in functions_advanced #318

edoardob90 opened this issue May 9, 2025 · 0 comments · May be fixed by #320
Assignees
Labels
advanced tutorial bug Something isn't working may2025

Comments

@edoardob90
Copy link
Member

edoardob90 commented May 9, 2025

There is a lingering datetime.utcnow() in the section about mutable objects as function's arguments:

from datetime import datetime

def log(msg, *, dt=datetime.utcnow()):
    print(f"{dt}: {msg}")

Should be:

from datetime import datetime, UTC


def log(msg, *, dt=datetime.now(UTC)):
    print(f"{dt}: {msg}")
@edoardob90 edoardob90 added bug Something isn't working advanced tutorial may2025 labels May 9, 2025
@edoardob90 edoardob90 linked a pull request May 9, 2025 that will close this issue
@edoardob90 edoardob90 self-assigned this May 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
advanced tutorial bug Something isn't working may2025
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant