Why not allow empty code blocks?

Antoon Pardon antoon.pardon at rece.vub.ac.be
Fri Jul 29 04:58:35 EDT 2016


Op 23-07-16 om 16:19 schreef Chris Angelico:
> On Sun, Jul 24, 2016 at 12:00 AM, BartC <bc at freeuk.com> wrote:
>> Or, for debugging or other reasons, when you need to comment out the
>> contents of a block. Then pass needs to be added.
> How often do you comment out an entire block and not its header? I
> don't remember the last time I did that. It's certainly not so common
> that adding 'pass' takes up a significant part of a debugging session.
>
> ChrisA

As BartC already mentions it happens fairly often during debugging.
Something like.

try:
   Some code
except Some_Exception:
   # Commented code for when I am debugging <Some code>
   pass




More information about the Python-list mailing list