O'Reilly logo
  • Chris Kang thinks this is interesting:

with tt: ...statements printing output to be enclosed in a matched open/close `sometag` pair

From

Cover of Python in a Nutshell, 3rd Edition

Note

"with tt" will call enter in tt, which has been created with 'sometag' initializer. This will print the open tag. After ".....statement.." is run, tt will call exit. This will print the close tag.