Python Bytes

#259 That argument is a little late-bound

Informações:

Sinopsis

Watch the live stream: Watch on YouTube About the show Sponsored by Shortcut - Get started at shortcut.com/pythonbytes Special guest: Renee Teate Michael #1: pypi-changes via Brian Skinn, created by Bernát Gábor Visually show you which dependencies in an environment are out of date. See the age of everything you depend upon. Also, shoutout again to pipdeptree Brian #2: Late-bound argument defaults for Python Default values for arguments to functions are evaluated at function definition time. If a value is a short expression that uses a variable, that variable is in the scope of the function definition. The expression cannot use other arguments. Example of what you cannot do: def foo(a, b = None, c = len(a)): ... There’s a proposal by Chris Angelico to add a =: operator for late default evaluation. syntax still up in the air. => and ?= also discussed However, it’s non-trivial to add syntax to an established language, and this article notes: At first blush, Angelico's idea to