Re: ownership problem?

2005-11-27 Thread Gabriel Zachmann
> the problem isn't determining who owns it, the problem is determining > who's supposed to release it. that's not a very common problem in a that's about what i meant. i think, in c++, the "ownership problem" means the problem to determine who and when is t

Re: ownership problem?

2005-11-22 Thread Fredrik Lundh
Alex Martelli wrote: > Python 2.5 should introduce a 'with' statement that may go partways > towards meeting your qualms; it's an approved PEP, though I do not > recall its number offhand. http://www.python.org/peps/pep-0343.html (this is one in a series of PEP:s based on the observation that th

Re: ownership problem?

2005-11-21 Thread Alex Martelli
Jeffrey Schwab <[EMAIL PROTECTED]> wrote: ... > > You may be gratified to learn that Python's main storage model > > is reference counted objects, and when an object falls out of > > all referenced scopes its finalizers run immediately. > > Thanks, that's good to know! For some reason I had it

Re: ownership problem?

2005-11-21 Thread Jeffrey Schwab
Donn Cave wrote: > In article <[EMAIL PROTECTED]>, > Jeffrey Schwab <[EMAIL PROTECTED]> wrote: > > >>Yes it is. Memory is only one type of resource. There are still files >>and sockets to close, pipes to flush, log messages to be printed, GDI >>contexts to free, locks to release, etc. I

Re: ownership problem?

2005-11-21 Thread Donn Cave
In article <[EMAIL PROTECTED]>, Jeffrey Schwab <[EMAIL PROTECTED]> wrote: ... > Yes it is. Memory is only one type of resource. There are still files > and sockets to close, pipes to flush, log messages to be printed, GDI > contexts to free, locks to release, etc. In C++, these things are >

Re: ownership problem?

2005-11-21 Thread Jeffrey Schwab
Fredrik Lundh wrote: > Jeffrey Schwab wrote: > > >the problem isn't determining who owns it, the problem is determining >who's supposed to release it. that's not a very common problem in a >garbage-collected language... Yes it is. Memory is only one type of resource. >>> >>

Re: ownership problem?

2005-11-21 Thread Fredrik Lundh
Jeffrey Schwab wrote: > >>>the problem isn't determining who owns it, the problem is determining > >>>who's supposed to release it. that's not a very common problem in a > >>>garbage-collected language... > >> > >>Yes it is. Memory is only one type of resource. > > > > Python's garbage collector

Re: ownership problem?

2005-11-21 Thread Jeffrey Schwab
Fredrik Lundh wrote: > Jeffrey Schwab wrote: > > >>>the problem isn't determining who owns it, the problem is determining >>>who's supposed to release it. that's not a very common problem in a >>>garbage-collected language... >> >>Yes it is. Memory is only one type of resource. > > > Python's

Re: ownership problem?

2005-11-20 Thread Fredrik Lundh
Jeffrey Schwab wrote: > > the problem isn't determining who owns it, the problem is determining > > who's supposed to release it. that's not a very common problem in a > > garbage-collected language... > > Yes it is. Memory is only one type of resource. Python's garbage collector deals with obj

Re: ownership problem?

2005-11-20 Thread elbertlev
Yes! Python uses auto garbage collection. As soon as the object reference count becomes 0 it is removed from existence. So the problem typical for C/C++: accessing pointers to already deleted objects does not exist in Python. -- http://mail.python.org/mailman/listinfo/python-list

Re: ownership problem?

2005-11-20 Thread Jeffrey Schwab
Fredrik Lundh wrote: > Jeffrey Schwab wrote: > > >>>Is it correct to say that the typical ownership problem, which >>>frequently arises in C++, does not occur normally in Python? >> >>What "typical ownership problem" do you feel frequently arise

Re: ownership problem?

2005-11-20 Thread Fredrik Lundh
Jeffrey Schwab wrote: > > Is it correct to say that the typical ownership problem, which > > frequently arises in C++, does not occur normally in Python? > > What "typical ownership problem" do you feel frequently arises in C++? > If you are referring to

Re: ownership problem?

2005-11-20 Thread Jeffrey Schwab
Gabriel Zachmann wrote: > Is it correct to say that the typical ownership problem, which > frequently arises in C++, does not occur normally in Python? What "typical ownership problem" do you feel frequently arises in C++? If you are referring to the sometimes difficult tas

Re: ownership problem?

2005-11-20 Thread Ben Finney
Gabriel Zachmann <[EMAIL PROTECTED]> wrote: > Is it correct to say that the typical ownership problem, which > frequently arises in C++, does not occur normally in Python? Could you explain what you mean by "the typical ownership problem"? -- \ "Jealousy: The th

Re: ownership problem?

2005-11-20 Thread Bruno Desthuilliers
Gabriel Zachmann a écrit : > Is it correct to say that the typical ownership problem, which > frequently arises in C++, does not occur normally in Python? What is this "typical ownership problem" ? -- http://mail.python.org/mailman/listinfo/python-list

ownership problem?

2005-11-20 Thread Gabriel Zachmann
Is it correct to say that the typical ownership problem, which frequently arises in C++, does not occur normally in Python? Best regards, Gabriel. -- /---\ | Any intelligent fool can make things bigger, more complex