List to string? Docstrings?

François Pinard pinard at iro.umontreal.ca
Mon Sep 13 17:37:53 EDT 1999


Hello, people.  Still learning Python.  I wrote around 6000 Python lines
in the last 10 days! :-)  I have two quick questions for you.

1) For converting a string into a list, I used:

        chars = list(text)

   For getting back the string from the list, I tried:

        import operator
        text = reduce(operator.concat, chars)

   but still, I wonder if you would not have a better suggestion...

2) I still miss the purpose of __doc__ strings.  It's true that I can write:

        print module.__doc__
        print function.__doc__

   and sometimes get useful information from these.  But what would I be
   loosing, for my own things, if I was using mere `#' comments instead?

-- 
François Pinard   http://www.iro.umontreal.ca/~pinard





More information about the Python-list mailing list