> 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")
> else:
>     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:
    Page.Add_stuff(content)

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

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

-CHB

>
> --
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/X4QS35WBHA5JJR67MG7QE4A5CMK4CKK5/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to