Dustin Ingram - PEP 572: The Walrus Operator

Dustin Ingram - PEP 572: The Walrus Operator

In this talk, we'll learn about a highly controversial change to Python syntax, the rationale for it, and the fallout as the result of it.

Along the way we'll go in-depth on how new ideas about Python are proposed, discussed, and become part of the language, what's unique about Python's process compared to other open source projects, and recent developments and what they mean for the future of the wider Python community.

https://us.pycon.org/2019/schedule/presentation/195/

53b37e14a09c5a718a39fda61fe1b8e5?s=128

PyCon 2019

May 04, 2019
Tweet

Transcript

  1. 6.
  2. 8.
  3. 19.
  4. 22.
  5. 23.
  6. 30.

    results = [] for x in data: result = f(x)

    if result: results.append(result) @di_codes
  7. 32.

    results = [ y for x in data if (y

    := f(x)) ] @di_codes
  8. 48.

    x = y = z = 0 # Yes (z

    := (y := (x := 0))) # No @di_codes
  9. 51.

    x = 1, 2 # Sets x to (1, 2)

    (x := 1, 2) # Sets x to 1 @di_codes
  10. 54.
  11. 55.
  12. 61.
  13. 62.
  14. 63.
  15. 64.

    TIM PETERS: "THE CURRENT PROPOSAL WOULD HAVE ALLOWED A MODEST

    BUT CLEAR IMPROVEMENT IN QUITE A FEW BITS OF CODE." @di_codes
  16. 65.

    BARRY WARSAW: "SINCE IT CHANGES THE SYNTAX OF THE LANGUAGE,

    PEOPLE TEND TO FOCUS ON THAT WITHOUT UNDERSTANDING THE DEEPER SEMANTIC ISSUES." @di_codes
  17. 67.

    GUIDO VAN ROSSUM: HAD TO STOP READING THE THREADS SO

    HE WOULDN'T "GO INSANE" @di_codes
  18. 68.
  19. 69.
  20. 70.
  21. 71.
  22. 72.
  23. 73.
  24. 74.
  25. 75.
  26. 76.
  27. 77.
  28. 83.
  29. 84.
  30. 85.
  31. 86.
  32. 91.

    ▸ PEP 8010 - The Technical Leader Governance Model ▸

    PEP 8011 - Python Governance Model Lead by Trio of Pythonistas ▸ PEP 8012 - The Community Governance Model ▸ PEP 8013 - The External Governance Model ▸ PEP 8014 - The Commons Governance Model ▸ PEP 8015 - Organization of the Python community ▸ PEP 8016 - The Steering Council Model @di_codes
  33. 93.
  34. 97.
  35. 98.
  36. 99.
  37. 100.
  38. 116.