Rob Williscroft wrote:

Riko Wichmann wrote in news:[EMAIL PROTECTED] in comp.lang.python:

Dear all,

is there a way in Python to comment out blocks of code without putting a # in front of each line? Somethings like C's

/*
    block of code here is commented out
*/

if False:

 (indented) block of code here is commented out

I've no idea how efficient it is compared to triple-quoted strings
or line by line comments. But (at least with the editors I use) it
does retain the syntax highlighting, which I quite like YMMV.

BTW for C and C++:

#if 0

block of code here is commented out
/* with embeded comments ! */

#endif

Rob.

Actually, it's infinitly [sp?] more defficient
(contrary of efficient?) than triple-quoted strings
or line-by-line comments, because those two never
make it to execution stage, because they're dropped
by the compiler. :-)
--
Gustavo Córdova Avila <[EMAIL PROTECTED]> <mailto:[EMAIL PROTECTED]>
*Tel:* +52 (81) 8130-1919 ext. 127
Integraciones del Norte, S.A. de C.V.
Padua #6047, Colonia Satélite Acueducto
Monterrey, Nuevo León, México.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to