[Python-ideas] `to_file()` method for strings
Brett Cannon
brett at python.org
Tue Mar 29 18:44:23 EDT 2016
On Tue, 29 Mar 2016 at 15:11 Chris Barker <chris.barker at noaa.gov> wrote:
> On Tue, Mar 29, 2016 at 5:06 AM, Eric V. Smith <eric at trueblade.com> wrote:
>
>> > 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.
>>
>
> Again -- this is a thought experiment, not a proposal, but:
>
> It's only relevant for other implementations -- cPython already cleans up
> the file object (any object) when it is no longer referenced.
>
> And I do move the thought experiment along -- it was never specific to
> file objects, but rather:
>
> In the case of temporary objects that are never referred to outside a
> single line of code -- delete it right away.
>
> in theory, this could help all implementations leave a little less garbage
> lying around.
>
> Whether that is possible or desirable, I have no idea.
>
It's not desirable to dictate what various Python implementations must make
sure that their garbage collector supports direct collection like this for
this specific case rather than staying general. It would very much be a
shift in the definition of the Python project where we have purposefully
avoided dictating how objects need to behave in terms of garbage collection.
-Brett
>
> -CHB
>
>
>
>
>
>
>
>>
>> Eric.
>>
>> _______________________________________________
>> Python-ideas mailing list
>> Python-ideas at python.org
>> https://mail.python.org/mailman/listinfo/python-ideas
>> Code of Conduct: http://python.org/psf/codeofconduct/
>>
>
> --
>
> Christopher Barker, Ph.D.
> Oceanographer
>
> Emergency Response Division
> NOAA/NOS/OR&R (206) 526-6959 voice
> 7600 Sand Point Way NE (206) 526-6329 fax
> Seattle, WA 98115 (206) 526-6317 main reception
>
> Chris.Barker at noaa.gov
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20160329/1432d994/attachment.html>
More information about the Python-ideas
mailing list