Args: Amazing or Approaching?
summary
History and mechanics of Python arguments get traced to concrete claims and fixes: defaults behave oddly because default args created at definition time, kwargs and star unpacking let callers avoid overloads, and positional-only slash plus upcoming deprecation of positional count/flags (3.13) force safer calls. Examples show mutable-default bugs, misordered parameters, and broken overloads; comparisons to Swift, JS and Rust highlight tradeoffs. Practical tools mentioned: typing additions in 3.11, use linters to auto-enforce or auto-fix keyword-only calls.
AI-written summary · about
chapters (12)
- 0:00Welcome
- 1:08Python’s argument system
- 2:10Default arguments pitfalls
- 5:00Keyword arguments
- 8:56Benefits of keyword args
- 13:38Forcing keyword-only args
- 16:29Slash parameter
- 19:18Unpacking dicts into calls
- 22:53Star and double-star args
- 25:23When arbitrary arguments are a bad idea
- 27:06Recap of Python args
- 28:10Closing & Q&A
related talks
05mIgnite Talk - 2019 Python Gotchas, Tips, and Tricks
01h 07mWhat Does It All Really Mean
27mVariables and objects in Python: it's pointers all the way down
28mHere be dragons: some elegant and ugly hacks in CPython
46mOn Being Pythonic
27mPython Oddities Explained
01h 10mKeynote 2: Robust Python and Why It Matters
59mMyths and fairy tales around Python performance
