~/talk

Consistent importing

Talkat PyCon Greece 2025 · 2025-08-29..08-30· at 12:10· Innovathens Stage· [python, software-architecture]
links:none on file
slides:none on file

Explains why a re-exporting pattern was removed because it hides imports while preventing package-level cycles, and describes a small toolchain: Ruff for grouping, one-per-line and absolute-import rules, lazy loading for heavy libs like PyTorch, and using typing.TYPE_CHECKING to avoid runtime imports. Describes building a forked ImportLint to detect package-cycle contracts and running it on Django, producing 167 cyclic dependencies with 88 package-level cycles, arguing that enforcing a no-cycle rule improves modularity and maintainability.

AI-written summary · about

  1. 0:00Introduction and speaker
  2. 1:15Why consistent importing
  3. 4:15How Python imports work
  4. 8:43Importing recommendations
  5. 15:51Imports impact code design
  6. 20:18Tools to enforce rules
  7. 23:44Summary and conclusion
~/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.