I find the need for that regularly. And I use the obvious syntax which
everyone else uses:

if not seq:
    print("This page is intentionally left blank")
    for i in seq:

Not so easy for an iterator though.

I’m more likely to do something like this:

Page = NewPage()
For content in iterable:

If not Page:
    print("This page is intentionally left blank")

(Sorry For the non PEP8 compliant capitalization— damn phone)


Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython