Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

unintuitive-python

Things that might not be obvious when writing Python and other oddities.

unintuitive_python.ipynb is committed with its outputs, so GitHub renders every result inline and you can just read it.

Running it

uv is the only prerequisite. It fetches the pinned interpreter and installs the kernel from uv.lock, so everyone gets the same environment.

uv sync

That creates .venv on Python 3.11 with a Jupyter kernel in it. Point your editor at .venv and open the notebook, or bring your own frontend:

uv run --with jupyterlab jupyter lab

Use uv run --with, not uvx. uvx would build an isolated environment on whatever Python it likes.

Run the cells top to bottom.

Why 3.11–3.13

The annotation example relies on annotations being evaluated when the def runs. PEP 649 made them lazy in 3.14, and walrus in an annotation is now a SyntaxError.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages