On Sun, 25 Feb 2001, Steve Alexander wrote:
I wasn't reading the code clearly the first time around.
By far the simplest place to return copied results from methodB is to
change the last line to
Thanks, it all works nice. Nearly, that is.
The reverse problem is now gone. But the fact
On Mon, 26 Feb 2001, Erik Enge wrote:
I only get this when a ConflictError occur.
Nope, it occurs every time I change to another object. I need to do some
more testing here. It seems as if the 'objects' variable of 'methodB' is
semi-persistent or something. Weired.
; [EMAIL PROTECTED]
To: "Steve Alexander" [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Monday, February 26, 2001 5:46 AM
Subject: Re: [Zope-dev] Zope 2.3.1b1, strange things when ConflictError.
On Sun, 25 Feb 2001, Steve Alexander wrote:
I wasn't reading the code clearly the first ti
Chris McDonough wrote:
The use of a literal anonymous list in methodb's signature for "objects" may
have something to do with the results you're getting on conflict. Try
assigning "objects" to an empty list in the method body instead.
Of course! Yet another demonstration of the dangers of
Erik Enge wrote:
The reverse problem is now gone. But the fact that every time I get
a ConflictError it doesn't "flush" the 'objects' of methodB, and
just seems to append to it, still remains.
I only get this when a ConflictError occur.
I don't know exactly why this might happen.
On Mon, 26 Feb 2001, Steve Alexander wrote:
Chris McDonough wrote:
The use of a literal anonymous list in methodb's signature for "objects" may
have something to do with the results you're getting on conflict. Try
assigning "objects" to an empty list in the method body instead.
Of
Erik Enge wrote:
On Mon, 26 Feb 2001, Steve Alexander wrote:
Chris McDonough wrote:
The use of a literal anonymous list in methodb's signature for "objects" may
have something to do with the results you're getting on conflict. Try
assigning "objects" to an empty list in the method
I have two nice methods. One of them (methodA) is called via the web.
These belong to one class; classA.
class classA:
"doc string"
def methodA(self):
"doc string"
objects = self.methodB(self)
objects.reverse()
attrib = ''
for object in
Erik,
You're returning a mutable object from methodB. You should either return
an immutable object (such as a tuple or a string), or return a *copy* of
your mutable object.
some_list.reverse() reverses the list in-place. That's why you're seeing
the strange reversal results you report.
The
I wasn't reading the code clearly the first time around.
By far the simplest place to return copied results from methodB is to
change the last line to
return objects[:]
Erik Enge wrote:
def methodB(self, object, skip=[], stop=[], objects=[]):
"doc string"
10 matches
Mail list logo