~/talk

Seven Things Every Python Programmer Should Know

Talkat NDC TechTown 2017 · 2017-10-17..10-20· [python]
slides:none on file

Explains seven concrete pitfalls and fixes: default empty lists are created once at import and persist across calls causing state bugs; fix with an immutable tuple or a unset = object() sentinel and runtime list creation. Clarifies namespaces and the LEGB lookup (no C for class scope). Shows that exact geometry with fractions (45× slower) removes float pathology. Demonstrates profiling with cProfile and disassembly to find costly attribute-dictionary lookups, and replacing hot Python (IBM-float conversion for seg-y) with C++ yields an 86% speedup.

AI-written summary · about

  1. 0:00Introduction
  2. 2:49Code Execution
  3. 5:06Empty Lists
  4. 10:30Sentinel Objects
  5. 23:18No tradeoffs
  6. 23:33Floatingpoint arithmetic
  7. 24:14Number types
  8. 25:02Decimal and fractions
  9. 25:18Failure modes of float
  10. 25:49Floats are binary
  11. 27:23Decimals are floatingpoints
  12. 28:42Computational geometry
  13. 29:41Sign of the determinant
  14. 30:12Demonstration
  15. 33:20Floating point numbers
  16. 34:13Python quirks
  17. 38:18Python idioms
  18. 40:32Chain comparisons
  19. 44:26Reduce work
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.