[Python-ideas] `to_file()` method for strings
Eric V. Smith
eric at trueblade.com
Tue Mar 29 08:06:24 EDT 2016
On 3/28/2016 10:21 PM, Ethan Furman wrote:
> [Sorry, Nick, didn't mean to just send it to you.]
>
> On 03/28/2016 11:16 AM, Nick Eubank wrote:
>
>> Just to make sure I follow: Chris, you're proposing a modification to
>> garbage collection to clean up `open()` if `open()` is used by not
>> closed and not assigned to anything so that `open(file).write(stuff)` is
>> safe?
>
> Even if he is, I don't see it happening. Modifying the garbage
> collector to act sooner on one particular type of object when we already
> have good, if very mildly inconvenient, solutions is not going to be a
> high-priority item -- especially if it has /any/ negative impact on
> performance.
I agree this is not likely to ever happen. It's especially problematic
that we'd be making this a requirement for implementations other than
CPython.
Eric.
More information about the Python-ideas
mailing list