[Fwd: Re: [SQLObject] SQLObject and Zope 2.7.3/2.8.0a1]
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Nick <ni...@dd...> - 2004-11-26 15:55:12
|
I think a polite note to tell me that I had accidentally hit "reply" instad of "reply all" would have nicer. I sincerely apologize that you got hit, as I didn't reply to the original message but the latest I saw in the thread. Unfortunately I deleted the original messages already, so I'm not sure of the context of the reply anymore (I've since read over 100 messages in my inbox this morning), but if you are in a situation where you need a list but the result may be None instead of a list, you can indeed use list(x or ()) where x is either an iterable or None. () is slightly faster as a literal than []. Nick -------- Forwarded Message -------- From: Oleg Broytmann <ph...@ph...> Reply-To: Oleg Broytmann <ph...@ph...> To: Nick <ni...@dd...> Subject: Re: [SQLObject] SQLObject and Zope 2.7.3/2.8.0a1 Date: Fri, 26 Nov 2004 18:27:04 +0300 On Fri, Nov 26, 2004 at 09:21:13AM -0600, Nick wrote: > On Fri, 2004-11-26 at 14:36 +0300, Oleg Broytmann wrote: > > > Readability. I like list() because it seems just a tiny bit more clear > > > than [], even though the end result is the same. > > > > Oops. My readability taste says opposite! :) I prefer [] to list(). > > The matter of taste... > > > > > > > According to the errorlog the error occurs on the line where I do the > > > > > for-loop, which means that the problem is the list(p) call. I am > > > > No. .select() cannot find a module or class. > > > > > > Ahh.. and .select() returns None, and the list(p) then fails because > > > list(None) does not make sense, since None is not iterable. > > list(p or ()) Don't send my private messages, please. At least do Cc to the list. BTW, I'm not the person with the problem... and anyway your solution is wrong. Oleg. -- |