Guido van Rossum wrote:
> On 4/19/07, Brett Cannon <[EMAIL PROTECTED]> wrote:
>> On 4/19/07, Guido van Rossum <[EMAIL PROTECTED]> wrote:
>> * "Also pop, popitem, setdefault?"
>>
>> Eh, my gut reaction is "no". But you do have 'pop' on MutableSequence.
>
> But for sequences it trivially maps on core methods. pop() for
> mappings is a little more convoluted (how to pick a random key? Just
> pick the first one I guess?)
pop() on dict requires you to say which key to pop, so a concrete
Mapping.pop might look something like:
_sentinel=object()
def pop(self, k, d=_sentinel):
try:
v = self[k]
except KeyError:
if d is _sentinel:
raise
v = d
else:
del self[k]
return v
>> I really don't like the name of Finite. When I read the name before
>> knowing what it represented I really had no clue what it represented.
>> In hindsight it makes sense, but it not immediately obvious.
>
> I have been playing with Sizeable and Lengthy, but rejected both as
> being too cute. Other suggestions?
Sized? Still not wonderful, but probably easier to figure out and
remember than Finite.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe:
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com