Favorite non-python language trick?

Uwe Mayer merkosh at hadiko.de
Fri Jun 24 03:25:38 EDT 2005


Friday 24 June 2005 09:18 am Enrico wrote:

[...]
>> --This code will, because the first two dashes make the rest a comment,
>> breaking the block
>> ---[[
>> print(10)
>> --]]
[...]

> python:
> 
> """
> print 10
> """
> 
> and
> 
> #"""
> print 10
> #"""
> 
> C++:
> 
> /*
> print(10);
> */
> 
> and
> 
> ///*
> print(10);
> //*/
> 
> ?

I think the *trick* here was that if you had larger blocks you'd only have
to change one side of the comment, i.e. the opening line, to de-comment the
block without searching the end of it and commenting that out aswell.

Ciao
Uwe     



More information about the Python-list mailing list