PyCon Redux
GitHub Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

2023

PyCon USA 2023 general information:

  • Location: Salt Palace Convention Center in Salt Lake City, UT
  • Talks: Friday April 21st to Sunday April 23rd
  • Conference schedule
Beautiful backdrop behind Salt Lake City
Beautiful backdrop behind Salt Lake City

Day 1

Just before on Lightning Talks to begin
Just before on Lightning Talks to begin

The author of coverage, Ned Batchelder is a Python community OG. He chose to give the keynote talk on “high uncertainty components in complex systems” (people).

This talk shares a comical perspective comparing people with software. A few examples are people are non-standard, undocumented, hidden state, and have unclear error messages. It then gives an API User’s Guide for people, detailing a valuable lesson, that all messages contain information and sentiment.

Ned also shared some advice he was given from Łukasz Langa:

  • If you don’t say something controversial in a PyCon keynote, are you really living your best life?

This talk by Brandt Bucher gives a behind the scenes look on CPython 3.11’s new specializing, adaptive interpreter. It also talks about further improvements from 3.12, please see PEP 659 for more information on this.

  • Specializing: interpreter specializes based on types or values
  • Adaptive: interpreter adapts when types or values change

Brandt also made a tool specialist to visualize where the interpreter’s optimization is succeeding or failing.

A brief review of Python parallelism:

  • A defining feature of Python is the global interpreter lock (GIL), a design decision that limits each Python process to at most one executing thread.
  • Prior to Python 3.12, parallelism can be accomplished via: multithreading (built-in threading), multiprocessing (built-in multiprocessing), coroutines (built-in asyncio), or distributed systems

Łukasz Langa gives a nice redux on combining asyncio.TaskGroups and multiprocessing.managers.SharedMemoryManager to work around the GIL in a data processing application.

Paul Ganssle is a python-dateutil maintainer and PEP 615’s author, and here he shares stories of all the complicating factors involved with timezone management.

  • Multiple timezone systems and governing bodies
  • Vary across location, transitions/year, country, time, and even ethnic group
  • Variable amount of timezone releases per year (not synced with Python releases)

This talk explains decisions made within Python’s zoneinfo library.

I remember being very impressed with the React Hooks announcement, this talk had a similar effect on me.

Here, Eric Snow (part of Microsoft’s Faster CPython team), and author of PEP 684 and PEP 554, gave this talk on Python 3.12’s per-interpreter GIL. To make a per-interpreter GIL feature possible, over 4000 shared process globals from CPython first had to be addressed, and over 8 PEPs were ultimately made!

A per-interpreter GIL enables multicore parallelism, matching or outperforming both multithreading and multiprocessing:

  • Short-running requests: multithreading definitively outperforms multiprocessing. A per-interpreter GIL outperformed multithreading
  • Long-running requests: multiprocessing outperforms multithreading. A per-interpreter GIL equally performed multiprocessing

A per-interpreter GIL will be the fifth method of parallelism in Python (see Łukasz’s talk for other supported modes). It’s accessible in Python 3.12 via the third party interpreters package and PEP 554 will create a built-in for Python 3.13.

Python has an Iterator Protocol that generators implement. Generators also offer lesser known methods send and throw. Reuven’s talk describes how these two facts together enable generators to create a stateful “nanoservice”.

Some might think yield from is just syntactic sugar for yielding within a for loop. The talk is tied together with a meaningful use case for yield from to connect subroutines within the nanoservice.

Day 2

Best coffee of the conference
Best coffee of the conference

Brett Cannon is a core developer of Python, with over 1000 commits to CPython as of June 2023.

His talk was a thought experiment: which parts of Python 3.8 syntax are mandatory, and which can be considered syntactic sugar? He found 10 pieces of syntax were mandatory (to name a few: integers, function calls + def, while, raise), and here’s the full analysis. The talk also reviews the Python data model in depth.

Bloomberg has open sourced a memory profiling tool memray, of which Pablo is a main contributor. This visually appealing talk walks through the interaction between Python and the host OS, how a memory profiler can be inserted between them, and ways a memory profiler could function.

Mark Shannon initially proposed how to speed CPython ~5X, now being enacted by the Faster CPython team (he’s on it).

This talk primarily talked about the optimizations on the memory overhead required for Python classes. To name a few of the iterations: Python 3.2 used 352 bytes/class, Python 3.6 used 192 bytes/class, and Python 3.12 used 96 bytes/class. Future optimization can bring this below 80 bytes/class. Mark also went over how specialization works (also see Brandt Bucher’s adaptive interpreter talk) and a few other Faster Cpython team efforts.

A notable saying from the talk:

  • Nothing is faster than nothing

Day 3

Guido van Rossum, the creator of Python, came to PyCon USA 2023 and gave a talk on the history of the many Python organization(s). He shared many success and failure stories of conference evolution, the ancestors of the Python Software Foundation (PSF), and the history of PyCon itself.

A notable saying from the talk:

  • Programming languages are a way to communicate ideas to other people, not just computers

Miscellaneous Facts and Sayings

Memorable quotes or ideas:

  • Lower case and upper case names originate from the printing press days
  • “ChatGPT is a stochastic parrot”
  • Dogfooding: being a user of one’s own products
  • There are 122740 ways to write self with Python interpreter’s parser’s unicode normalization

Python language learnings:

  • PEP 701 in Python 3.12 allows for arbitrary code in f-strings. No more alternation of "" with ''
  • Confusion of str.lstrip vs str.removeprefix and str.rstrip vs str.removesuffix is a huge source of bugs
  • There’s active development on direct integration of Python with web apps and mobile apps

Miscellaneous tooling findings:

  • ARCHITECTURE.md is a standard filename for documenting architecture, especially architecture invariants and design boundaries
  • Structured concurrency can be accomplished using asyncio.TaskGroup
  • PyCharm’s inspection tool is available independently from PyCharm as the tool Qodana
  • PyPI is adding support for organization accounts
  • etckeeper enables version controls for /etc, such that apt install or apt upgrade make an easily revert-able VCS commit
  • The Python Packaging Authority has a tool cibuildwheel to build and test wheels for multiple platforms
  • Rust’s unofficial mascot Ferris the crab is cute: Rustacean.net

Memorable lightning talks: