greg wrote:
> You need to stop using the term "copy by reference",
> because it's meaningless. Just remember that assignment
I agree that "copy by reference" is a bad choice of words. I meant pass
by reference and assign by reference. But the effect is to make a
virtual copy, so although the phr
In <[EMAIL PROTECTED]>, Beliavsky wrote:
>> ISTM the big catch for Fortran programmers is when a mutable container
>> is referenced from multiple places; thus a change via one reference
>> will confusingly show up via the other one.
>
> As a Fortranner, I agree. Is there an explanation online of
Carl Banks wrote:
> Niels L Ellegaard wrote:
> > Marc 'BlackJack' Rintsch wrote:
> > > In <[EMAIL PROTECTED]>, Niels L
> > > Ellegaard wrote:
> > > > I have been using scipy for some time now, but in the beginning I made
> > > > a few mistakes with copying by reference.
> > > But "copying by refer
Russ wrote:
> The copy by reference semantics of Python give it great
> efficiency but are also its achille's heel for tough-to-find bugs.
You need to stop using the term "copy by reference",
because it's meaningless. Just remember that assignment
in Python is always reference assignment. If you w
Niels L Ellegaard wrote:
> Marc 'BlackJack' Rintsch wrote:
> > In <[EMAIL PROTECTED]>, Niels L
> > Ellegaard wrote:
> > > I have been using scipy for some time now, but in the beginning I made
> > > a few mistakes with copying by reference.
> > But "copying by reference" is the way Python works.
Russ wrote:
> If a debugger could tell you how many references exist to an object,
> that would be helpful.
import sys
sys.getrefcount(a)
But I doubt it would be very helpful.
Carl Banks
--
http://mail.python.org/mailman/listinfo/python-list
Niels L Ellegaard wrote:
> I wanted to warn the user whenever he tried to
> change an object that was being refered to by a living object.
To see how fundamentally misguided this idea is,
consider that, under your proposal, the following
program would produce a warning:
a = 1
The reason being
On 9 dic, 09:08, "Niels L Ellegaard" <[EMAIL PROTECTED]> wrote:
> Now some of my fortran-using friends would like to use python to
> analyze their data files. I wanted them to avoid making the same
> mistakes as I did so I thought it would be good if they could get some
> nanny-like warnings say
> I think what you want is a namespace that requires each object to have
> exactly one reference - the namespace. Of course, additional references
> will be created during evaluation of expressions. So the best you can do
It's not enough. It won't catch the case where a list holds many
reference
On Sat, 09 Dec 2006 05:58:22 -0800, Niels L Ellegaard wrote:
> I wanted a each object to know whether or not it was being referred to
> by a living object, and I wanted to warn the user whenever he tried to
> change an object that was being refered to by a living object. As far
> as I can see th
Niels L Ellegaard wrote:
> I wanted a each object to know whether or not it was being referred to
> by a living object, and I wanted to warn the user whenever he tried to
> change an object that was being refered to by a living object. As far
> as I can see the garbage collector module would al
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, Niels L
> Ellegaard wrote:
> > I have been using scipy for some time now, but in the beginning I made
> > a few mistakes with copying by reference.
> But "copying by reference" is the way Python works. Python never copies
> objects unless y
In <[EMAIL PROTECTED]>, Niels L
Ellegaard wrote:
> I have been using scipy for some time now, but in the beginning I made
> a few mistakes with copying by reference.
But "copying by reference" is the way Python works. Python never copies
objects unless you explicitly ask for it. So what you wan
Gabriel Genellina wrote:
> I think you got in trouble with something and you're trying to avoid it
> again - but perhaps this is not the right way. Could you provide some
> example?
I have been using scipy for some time now, but in the beginning I made
a few mistakes with copying by reference. The
On 9 dic, 02:22, "Niels L Ellegaard" <[EMAIL PROTECTED]> wrote:
> Is there a module that allows me to find errors that occur due to copy
> by reference?
What do you mean by "copy by reference"?
> I am looking for something like the following:
>
> >>> import mydebug
> >>> mydebug.checkcopybyrefer
Is there a module that allows me to find errors that occur due to copy
by reference? I am looking for something like the following:
>>> import mydebug
>>> mydebug.checkcopybyreference = True
>>> a=2
>>> b=[a]
>>> a=4
Traceback (most recent call last):
File "", line 1, in ?
CopyByReferenceError:
16 matches
Mail list logo