Python Forum
getting a file in memory - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: getting a file in memory (/thread-29422.html)



getting a file in memory - Skaperen - Sep-01-2020

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?


RE: getting a file in memory - buran - Sep-01-2020

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


RE: getting a file in memory - ndc85430 - Sep-02-2020

Also consider looking at the test suite for the library. Tests are executable documentation! Writing learning tests may also be useful.


RE: getting a file in memory - DeaD_EyE - Sep-02-2020

help() could help.


RE: getting a file in memory - Skaperen - Sep-04-2020

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.