On 2017-08-05, Tim Daneliuk wrote:
> On 08/05/2017 03:21 PM, Chris Angelico wrote:
>> so the object's lifetime shouldn't matter to you.
>
> I disagree with this most strongly. That's only true when the
> machine resources being consumed by your Python object are small in
> size. But when you're
On 08/05/2017 05:36 PM, Ned Batchelder wrote:
> On 8/5/17 5:41 PM, Tim Daneliuk wrote:
>> On 08/05/2017 11:16 AM, Ned Batchelder wrote:
>>> It uses
>>> reference counting, so most objects are reclaimed immediately when their
>>> reference count goes to zero, such as at the end of local scopes.
>>
On 08/05/2017 05:36 PM, Ned Batchelder wrote:
> On 8/5/17 5:41 PM, Tim Daneliuk wrote:
>> On 08/05/2017 11:16 AM, Ned Batchelder wrote:
>>> It uses
>>> reference counting, so most objects are reclaimed immediately when their
>>> reference count goes to zero, such as at the end of local scopes.
>>
On 08/05/2017 05:58 PM, Chris Angelico wrote:
> On Sun, Aug 6, 2017 at 7:32 AM, Tim Daneliuk wrote:
>> On 08/05/2017 03:21 PM, Chris Angelico wrote:
>>> After a 'with' block,
>>> the object *still exists*, but it has been "exited" in some way
>>> (usually by closing/releasing an underlying resourc
On 08/05/2017 05:58 PM, Chris Angelico wrote:
> On Sun, Aug 6, 2017 at 7:32 AM, Tim Daneliuk wrote:
>> On 08/05/2017 03:21 PM, Chris Angelico wrote:
>>> After a 'with' block,
>>> the object *still exists*, but it has been "exited" in some way
>>> (usually by closing/releasing an underlying resourc
On Sun, Aug 6, 2017 at 7:32 AM, Tim Daneliuk wrote:
> On 08/05/2017 03:21 PM, Chris Angelico wrote:
>> After a 'with' block,
>> the object *still exists*, but it has been "exited" in some way
>> (usually by closing/releasing an underlying resource).
>
> The containing object exists, but the things
On 8/5/17 5:41 PM, Tim Daneliuk wrote:
> On 08/05/2017 11:16 AM, Ned Batchelder wrote:
>> It uses
>> reference counting, so most objects are reclaimed immediately when their
>> reference count goes to zero, such as at the end of local scopes.
> Given this code:
>
> class SomeObject:
> .
>
On 2017-08-05 22:41, Tim Daneliuk wrote:
On 08/05/2017 11:16 AM, Ned Batchelder wrote:
It uses
reference counting, so most objects are reclaimed immediately when their
reference count goes to zero, such as at the end of local scopes.
Given this code:
class SomeObject:
.
for foo in
Tim Daneliuk :
> Are you saying that each time a,b,c are reassigned to new instances of
> SomeObject the old instance counts go to 0 and are immediately - as in
> synchronously, right now, on the spot - removed from memory?
That depends on the implementation of Python. CPython employs reference
c
On 08/05/2017 11:16 AM, Ned Batchelder wrote:
> It uses
> reference counting, so most objects are reclaimed immediately when their
> reference count goes to zero, such as at the end of local scopes.
Given this code:
class SomeObject:
.
for foo in somelist:
a = SomeObject(foo)
b
On 08/05/2017 03:21 PM, Chris Angelico wrote:
> After a 'with' block,
> the object *still exists*, but it has been "exited" in some way
> (usually by closing/releasing an underlying resource).
The containing object exists, but the things that the closing
logic explicitly released do not. In some
On Sun, Aug 6, 2017 at 1:23 AM, Tim Daneliuk wrote:
> On 08/04/2017 07:00 PM, Chris Angelico wrote:
>> Again, don't stress about exactly when objects get
>> disposed of; it doesn't matter.
>
>
> Respectfully, I disagree strongly. Objects get build on the heap and
> persist even when they go out o
On 8/5/17 11:23 AM, Tim Daneliuk wrote:
> On 08/04/2017 07:00 PM, Chris Angelico wrote:
>> Again, don't stress about exactly when objects get
>> disposed of; it doesn't matter.
>
> Respectfully, I disagree strongly. Objects get build on the heap and
> persist even when they go out of scope until s
Tim Daneliuk :
> On 08/04/2017 07:00 PM, Chris Angelico wrote:
>> Again, don't stress about exactly when objects get disposed of; it
>> doesn't matter.
>
> Respectfully, I disagree strongly. Objects get build on the heap and
> persist even when they go out of scope until such time garbage
> collec
On 08/04/2017 07:00 PM, Chris Angelico wrote:
> Again, don't stress about exactly when objects get
> disposed of; it doesn't matter.
Respectfully, I disagree strongly. Objects get build on the heap and
persist even when they go out of scope until such time garbage
collection takes place. This i
On Sat, Aug 5, 2017 at 9:47 AM, Jon Forrest wrote:
> Perhaps the reason the variable isn't destroyed is
> shown by the following (again, in the same session):
>
import sys
sys.getrefcount(1578505988392)
> 3
>
> So, maybe it's not destroyed because there are still
> references to it. But,
16 matches
Mail list logo