Am 2010-10-15 um 16:32 schrieb Paul McNett:

> On 10/15/10 7:16 AM, Henning Hraban Ramm wrote:
>> Since I struggled too long while trying to append items to
>> dDropdownList.Choices:
>>
>> Would you care to add a hint to the docstrings of dControlItemMixin
>> that list properties aren't usable like normal Python lists?
>
> Do you mean that you can't do:
>
> lst.Choices = ["a", "b", "c"]
> lst.Choices.append("d")

Yes, that's what I meant.

> but that you instead have to:
>
> lst = lst.Choices = ["a", "b", "c"]
> lst.Choices.append("d")
> lst.Choices = lst.Choices

I guess you meant something like?:
l = lst.Choices = ["a", "b", "c"]
l.append("d")
lst.Choices = l

At least I don't understand why you'd overwrite your list control with  
the choices list etc.

> This has struck me as kind of awkward, too. I wonder if we could  
> make it better all
> around by accepting any sequence type to Choices, but converting  
> that sequence to a
> tuple, so that if someone tries to modify it in place, they'd get an  
> exception and
> understand immediately that they have to reassign the whole sequence.

I don't see the need to make the code more complicated, if the docs  
are clear.


Greetlings from Lake Constance!
Hraban
---
http://www.fiee.net/texnique/
http://wiki.contextgarden.net
https://www.cacert.org (I'm an assurer)

_______________________________________________
Post Messages to: Dabo-users@leafe.com
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: 
http://leafe.com/archives/byMID/a6485448-83e9-4b46-8e36-74f7f031e...@fiee.net

Reply via email to