Re: [Tutor] python memory management

2016-09-04 Thread monik...@netzero.net
Thank you all for your explanations. I really enjoy learning about things like that. Monika -- Original Message -- From: Alan Gauld via Tutor <tutor@python.org> To: zakaria <zemmoura.kha...@gmail.com>, tutor@python.org Subject: Re: [Tutor] python memory management

Re: [Tutor] python memory management

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 23:20, zakaria wrote: > Is there any practical usage of using reference cycling? There are a (very) few cases where data structures require the creation of cyclic references. One example I've used is in managing comms networks where nodes are multiply and/or cyclically linked and you

Re: [Tutor] python memory management

2016-09-03 Thread zakaria
Is there any practical usage of using reference cycling? On Sat, 2016-09-03 at 14:56 +0100, Alan Gauld via Tutor wrote: > On 03/09/16 04:25, monik...@netzero.net wrote: > > > > > Is this what you mean?  > > a = 5 > > b = a > > a = b > > No, you are confusing variable names with objects. >

Re: [Tutor] python memory management

2016-09-03 Thread monik...@netzero.net
So what does [...] mean? -- Original Message -- From: Peter Otten <__pete...@web.de> To: tutor@python.org Subject: Re: [Tutor] python memory management Date: Sat, 03 Sep 2016 14:26:12 +0200 monik...@netzero.net wrote: > > By: > "reference cycles: if one ob

Re: [Tutor] python memory management

2016-09-03 Thread Steven D'Aprano
On Thu, Sep 01, 2016 at 08:21:36PM +, monik...@netzero.net wrote: > Thank you for your explanation. It is very clear and confirms what I > thought I knew. However, I had a job interview and the interview said > it was a mistake that I did not say that in cases when there are > multiple

Re: [Tutor] python memory management

2016-09-03 Thread Alan Gauld via Tutor
On 03/09/16 04:25, monik...@netzero.net wrote: > Is this what you mean? > a = 5 > b = a > a = b No, you are confusing variable names with objects. Here you only have one object - the number 5. For a cycle you need at least 2 objects and those objects must be able to reference another object. In

Re: [Tutor] python memory management

2016-09-03 Thread Random832
On Fri, Sep 2, 2016, at 23:25, monik...@netzero.net wrote: > > By: > "reference cycles: if one object has a reference to another, and > that second object also has a reference to the first, that's a cycle." > > Is this what you mean? > a = 5 > b = a > a = b > > I just want to make sure I

Re: [Tutor] python memory management

2016-09-03 Thread Peter Otten
monik...@netzero.net wrote: > > By: > "reference cycles: if one object has a reference to another, and > that second object also has a reference to the first, that's a cycle." > > Is this what you mean? > a = 5 > b = a > a = b No. int instances are immutable. The assignments above bind both

Re: [Tutor] python memory management

2016-09-03 Thread monik...@netzero.net
- Original Message -- From: Steven D'Aprano <st...@pearwood.info> To: tutor@python.org Subject: Re: [Tutor] python memory management Date: Fri, 2 Sep 2016 04:10:02 +1000 On Thu, Sep 01, 2016 at 02:12:11PM +, monik...@netzero.net wrote: > Hi: > Can somebody please explain

Re: [Tutor] python memory management

2016-09-01 Thread Joel Goldstick
t; -- Original Message -- > From: Steven D'Aprano <st...@pearwood.info> > To: tutor@python.org > Subject: Re: [Tutor] python memory management > Date: Fri, 2 Sep 2016 04:10:02 +1000 > > On Thu, Sep 01, 2016 at 02:12:11PM +, monik...@netzero.net wrote:

Re: [Tutor] python memory management

2016-09-01 Thread monik...@netzero.net
this situation should be handled? Thank you Monika -- Original Message -- From: Steven D'Aprano <st...@pearwood.info> To: tutor@python.org Subject: Re: [Tutor] python memory management Date: Fri, 2 Sep 2016 04:10:02 +1000 On Thu, Sep 01, 2016 at 02:12:11PM +, monik...@netze

Re: [Tutor] python memory management

2016-09-01 Thread Steven D'Aprano
On Thu, Sep 01, 2016 at 02:12:11PM +, monik...@netzero.net wrote: > Hi: > Can somebody please explain how memory is managed by python? What kind > of memory it uses? What structures use what kind of memory? > If many people work on the same project and have many instances of the > same

Re: [Tutor] python memory management

2016-09-01 Thread Alan Gauld via Tutor
On 01/09/16 15:12, monik...@netzero.net wrote: > Can somebody please explain how memory is managed by python? > What kind of memory it uses? What structures use what kind of memory? I'm not sure what you have in mind? Do you want to know the internal structure of the various data types? Do you

[Tutor] python memory management

2016-09-01 Thread monik...@netzero.net
Hi: Can somebody please explain how memory is managed by python? What kind of memory it uses? What structures use what kind of memory? If many people work on the same project and have many instances of the same object how do they ensure that all instances are killed before the programs exit?