[issue26605] Feature request: string method `to_file`

nickeubank report at bugs.python.org
Mon Mar 21 13:00:15 EDT 2016


New submission from nickeubank:

As a social scientists trying to help other social scientists move from language like R, Stata, and Matlab into Python, one of the behaviors I've found unnecessarily difficult to explain is the "file.open()/file.close()" idiom (or, alternatively, context managers). In normal operating systems, and many high level languages, saving is a one-step operation. 

I understand there are situations where an open file handle is useful, but it seems a simple `to_file` method on strings (essentially wrapping a context-manager) would be really nice, as it would save users from learning this idiom. 

Any chance it's feasible? Sadly, I have no real C skills so can't implement myself. :(

----------
components: IO
messages: 262141
nosy: nickeubank
priority: normal
severity: normal
status: open
title: Feature request: string method `to_file`
type: enhancement

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26605>
_______________________________________


More information about the Python-bugs-list mailing list