Re: [Zope] dtml-in and tuples

2000-08-15 Thread Chris Withers
"R. David Murray" wrote: On Mon, 14 Aug 2000, Jonothan Farr wrote: Well in Python a list is mutable and a tuple is not. Right, but he's asking why dtml-in treats tuples in a special way, and exactly what that behavior is. That's right :-) ..and in particular why it's so weird. It seems

Re: [Zope] dtml-in and tuples

2000-08-15 Thread Shane Hathaway
Chris Withers wrote: "R. David Murray" wrote: On Mon, 14 Aug 2000, Jonothan Farr wrote: Well in Python a list is mutable and a tuple is not. Right, but he's asking why dtml-in treats tuples in a special way, and exactly what that behavior is. That's right :-) ..and in

Re: [Zope] dtml-in and tuples

2000-08-15 Thread Chris Withers
Shane Hathaway wrote: Looking at the code, it appears that if you pass a list of two-element tuples, dtml-in will sort by the first element of each pair and render the second element. Unluckilly, that's exactly what I was passing it. But not the result I was looking for :S If, on the

Re: [Zope] dtml-in and tuples

2000-08-15 Thread Shane Hathaway
Chris Withers wrote: Shane Hathaway wrote: Looking at the code, it appears that if you pass a list of two-element tuples, dtml-in will sort by the first element of each pair and render the second element. Unluckilly, that's exactly what I was passing it. But not the result I was

Re: [Zope] dtml-in and tuples

2000-08-15 Thread Chris Withers
Shane Hathaway wrote: snip tuple confusion I don't know of any place. It ought to be in the DTML reference. I guess I'll hope and wait for the Zope Book :-) cheers, Chris ___ Zope maillist - [EMAIL PROTECTED]

Re: [Zope] dtml-in and tuples

2000-08-15 Thread Dieter Maurer
Chris Withers writes: Why and how are python tuples (like, this) handled differently (and not in a logical way I can see...) than python lists [like, this]? The "how" has been explained already. The "why" is only my guess: support for the widespread idiom "dict.items()", "objectItems" etc.

[Zope] dtml-in and tuples

2000-08-14 Thread Chris Withers
Hi, Why and how are python tuples (like, this) handled differently (and not in a logical way I can see...) than python lists [like, this]? cheers, Chris ___ Zope maillist - [EMAIL PROTECTED] http://lists.zope.org/mailman/listinfo/zope ** No

Re: [Zope] dtml-in and tuples

2000-08-14 Thread Jonothan Farr
Well in Python a list is mutable and a tuple is not. --jfarr - Original Message - From: Chris Withers [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, August 14, 2000 3:38 PM Subject: [Zope] dtml-in and tuples Hi, Why and how are python tuples (like, this) handled differently