One line python method that opens a file in read/write mode, reads the raw contents, right strips the content string, and returns it. The question is "what's wrong with the method?"
Anonymous
The obvious things: the file should be opened in read only mode; the file should be closed in the method (or opened with context so it gets automatically closed); the name of the method doesn't accurately describe what it's doing and should be changed; the method doesn't really need to exist since it's doing something that's pretty common across a code base and it's better to avoid abstracting something like this unless there's a clear need. I guess I missed talking about not loading the entire file into memory. Should've asked about the context of its use instead of making assumptions.
Check out your Company Bowl for anonymous work chats.