Python Forum

Full Version: getting a file in memory
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
you are creating a script using a new module. it has just one function. the documentation is very short and simple and says that the return value of the function is "a text file". what do you expect to get?
this looks like poor documentation (ambiguous), so I will just look at the source code or test what the return value is. And probably would raise issue or (if possible) fix the docs and make a pull request
Also consider looking at the test suite for the library. Tests are executable documentation! Writing learning tests may also be useful.
help() could help.
i'm trying to determine which would be more pythonic for text, a single big string with embedded newlines, or a list of strings with no newlines and each line in a list item. functions that operate on these can check what they get but functions that create text need to be specific.