Re: [Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/schema/interfaces.py - add IIterableChoice and note the desire to depricate vocabularies

2005-09-05 Thread Fred Drake
On 9/5/05, Stuart Bishop [EMAIL PROTECTED] wrote: Urgh... I hadn't noticed that in vocabularies before. I believe this has other side effects too, such as if I do list(mysource), Python calls mysource.__len__ (if it exists) to preallocate the list size. Wierd things can happen if your class

Re: [Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/schema/interfaces.py - add IIterableChoice and note the desire to depricate vocabularies

2005-09-05 Thread Tim Peters
[Fred Drake, on returning sys.maxint from __len__ if you don't know the length, which Tim strongly advises against] Interesting. I seem to remember this coming from Guido several times in discussions. Not me. Googling on site:mail.python.org maxint __len__ guido finds 9 hits, all

[Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/schema/interfaces.py - add IIterableChoice and note the desire to depricate vocabularies

2005-09-04 Thread Benji York
Stuart Bishop wrote: If this is a way of saying I'm iterable, but I don't want to tell you how long I am Right. shouldn't an exeption be raised? Otherwise 'for i in range(0,len(source)): foo = source[i]' could start blowing up if the source changes. Of course, that particular spelling

Re: [Zope3-dev] Re: [Zope3-checkins] SVN: Zope3/trunk/src/zope/schema/interfaces.py - add IIterableChoice and note the desire to depricate vocabularies

2005-09-04 Thread Stuart Bishop
Benji York wrote: Stuart Bishop wrote: If this is a way of saying I'm iterable, but I don't want to tell you how long I am Right. shouldn't an exeption be raised? Otherwise 'for i in range(0,len(source)): foo = source[i]' could start blowing up if the source changes. Of