Embedded comments in Python?

Ernie eadorio at yahoo.com
Mon May 3 07:30:39 EDT 2004


Hi,
Whats the legal way in Python to embed comments in Python code? 
Example:

def foo(a <:int>, b <:float>): <:array>
     return [a, b] 

Want the CPython interpreter to ignore the <:int>, <:float> and
<:array>(this one can be written as #array). Using triple quoted
strings would be  longer and is invalid syntax. This would be
extremely useful for those who write tools for processing Python
scripts. In C/C++, this would be no problem with /* */.

Regards,

Ernie



More information about the Python-list mailing list