Re: [Python-Dev] Possible language summit topic: buildbots

2009-10-27 Thread Antoine Pitrou
Martin v. Löwis  v.loewis.de> writes:
> 
> It's not really reproducible. I think it sometimes happens when I
> restart the master; sometimes, some clients fail to reconnect
> (properly).

Another common problem is that some buildbot fails in the middle of the test
suite, with the following kind of message:

command timed out: 1800 seconds without output, killing pid 12325
process killed by signal 9
program finished with exit code -1
elapsedTime=10910.362981

See for example :
http://www.python.org/dev/buildbot/trunk.stable/builders/ia64%20Ubuntu%20trunk/builds/73/steps/test/logs/stdio

(notice, by the way, the elapsed time (10910s, that is, close to 3 hours...))

Regards

Antoine.


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Possible language summit topic: buildbots

2009-10-27 Thread Zooko O'Whielacronx
Right, how do developers benefit from a buildbot?

>From my experience (five large buildbots with many developers plus two
with only a couple of developers), a buildbot does little good unless
the tests are reliable and not too noisy.  "Reliable" is best achieved
by having tests be deterministic and reproducible.  "Not too noisy"
means that the builders are all green all the time (at least for a
"supported" subset of the buildslaves).

Beyond that, then I think there has to be a culture change where the
development team decides that it is really, really not okay to leave a
builder red after you turned it red, and that instead you need to
revert the patch that made it go from green to red before you do
anything else.  It has taken me a long time to acculturate to that and
I wouldn't expect most people to do it quickly or easily.

(It is interesting to think of what would happen if that policy were
automated -- any patch which caused any "supported" builder to go from
green to red would be automatically be reverted.)

Also, of course, this is mostly meaningless unless the code that is
being changed by the patches is well-covered by tests.

Regards,

Zooko
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Georg Brandl
Chris Bergstresser schrieb:

>I like the proposed set.get() method, personally.  list.get(index)
> gets the item at that index, dict.get(key) gets the item associated
> with that key, set.get() gets an item, but doesn't place any
> guarantees on which item is returned.

Sorry to nitpick, but there is no list.get().

Georg


-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Chris Bergstresser
On Tue, Oct 27, 2009 at 11:06 AM, Georg Brandl  wrote:
> Sorry to nitpick, but there is no list.get().

   No?  How ... odd.  I guess it wouldn't have come up, but I was sure
there was a .get method which took an optional default parameter if
the index didn't exist, mirroring the dict method.  Still, I think my
point stands--it's a clear extrapolation from the existing dict.get().

-- Chris
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Georg Brandl
Chris Bergstresser schrieb:
> On Tue, Oct 27, 2009 at 11:06 AM, Georg Brandl  wrote:
>> Sorry to nitpick, but there is no list.get().
> 
>No?  How ... odd.  I guess it wouldn't have come up, but I was sure
> there was a .get method which took an optional default parameter if
> the index didn't exist, mirroring the dict method.  Still, I think my
> point stands--it's a clear extrapolation from the existing dict.get().

I don't see that.  Both dict.get() and your hypothetical list.get() are
variants of the [] subscription operator, i.e. __getitem__, that have a
default value, defaulting to None.  The [] operator retrieves an element
from the object at the specified "position", be it dict key, list index
or some other abstract position.

Contrary to that, sets don't support subscript access, there is no notion
of a value at a specified position, so I would find the set.get() naming
confusing.

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Raymond Hettinger


[Chris Bergstresser]
 Still, I think my

point stands--it's a clear extrapolation from the existing dict.get().


Not really.  One looks-up a key and supplies a default value if not found.
The other, set.get(), doesn't have a key to lookup.

A dict.get() can be meaningfully used in a loop (because the key can vary).
A set.get() returns the same value over and over again (because there is no 
key).


Raymond
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Alexander Belopolsky
On Tue, Oct 27, 2009 at 1:33 PM, Chris Bergstresser  wrote:
> On Tue, Oct 27, 2009 at 11:06 AM, Georg Brandl  wrote:
>> Sorry to nitpick, but there is no list.get().
>
>   No?  How ... odd.

Odd indeed.  My first reaction was: it is not needed because lists
support slicing, but when I tried to construct a list.get() using
slicing the best I could come up with was the following hack

>>> def lget(l, i, v):  return (l[i:] or [v])[0]
...
>>> lget(range(10), 20, 200)
200
>>> lget(range(10), 5, 50)
5

Yet for some reason I never missed this functionality ...
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Antoine Pitrou
Raymond Hettinger  rcn.com> writes:
> 
> [Chris Bergstresser]
>   Still, I think my
> > point stands--it's a clear extrapolation from the existing dict.get().
> 
> Not really.  One looks-up a key and supplies a default value if not found.
> The other, set.get(), doesn't have a key to lookup.

set.getone() then ?



___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 1:59 PM, Antoine Pitrou  wrote:
> Raymond Hettinger  rcn.com> writes:
>>
>> [Chris Bergstresser]
>>   Still, I think my
>> > point stands--it's a clear extrapolation from the existing dict.get().
>>
>> Not really.  One looks-up a key and supplies a default value if not found.
>> The other, set.get(), doesn't have a key to lookup.
>
> set.getone() then ?

ugh- other spellings much preferred.

Geremy Condra
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Oleg Broytman
On Tue, Oct 27, 2009 at 02:20:04PM -0400, geremy condra wrote:
> On Tue, Oct 27, 2009 at 1:59 PM, Antoine Pitrou  wrote:
> > Raymond Hettinger  rcn.com> writes:
> > set.getone() then ?
> 
> ugh- other spellings much preferred.

   set[] ? (Just kidding, really.)

Oleg.
-- 
 Oleg Broytmanhttp://phd.pp.ru/[email protected]
   Programmers don't die, they just GOSUB without RETURN.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Terry Reedy

Raymond Hettinger wrote:


A dict.get() can be meaningfully used in a loop (because the key can vary).
A set.get() returns the same value over and over again (because there is 
no key).


There are two ideas of set.get floating about:
1) get an arbitrary object
2) get the object in the set with the same 'value'(hash+eq) as an input 
arg (the intern case). In this case, there is a 'key', even if it is 
somewhat abstract rather that being an object.


Both could be done with the same method, depending on whether an arg is 
passed or not. The former is not useful in a loop; the latter could be.


If there is no match in case 2, the method could a) raise an exception, 
b) return None (which by its nature would never sensibly be looked up), 
or c) return an object specified by 'default=xxx' keyword arg.


Terry Jan Reedy

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Chris Bergstresser
On Tue, Oct 27, 2009 at 12:47 PM, Raymond Hettinger  wrote:
> [Chris Bergstresser]
>  Still, I think my
>>
>> point stands--it's a clear extrapolation from the existing dict.get().
>
> Not really.  One looks-up a key and supplies a default value if not found.
> The other, set.get(), doesn't have a key to lookup.

Right, which is why dict.get() takes a key as an argument, while
the proposed set.get() wouldn't.

> A dict.get() can be meaningfully used in a loop (because the key can vary).
> A set.get() returns the same value over and over again (because there is no
> key).

I don't think "can it be used meaningfully in a loop?" is an
especially interesting or useful way of evaluating language features.
Besides, why would set.get() necessarily return the same value
over and over again?  I thought it would be defined to return an
arbitrary value--which could be the same value over and over again,
but could just as easily be defined to return a round-robin value, or
the minimum value, or some *other* value as the container defined it.
   The fact is, set.get() succinctly describes an action which is
otherwise obscure in Python.  It doesn't come up all that frequently,
but when it does the alternatives are poor at best.  Add in the
uncertainty about which is optimized (imagine the situation where the
set you're calling is actually a proxy for an object across the
network, and constructing an iterator is expensive) and you start to
see the value.

-- Chris
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread [email protected]


On Oct 27, 2009, at 2:50 PM, Terry Reedy wrote more and more and more  
and more and more and more and more and more and more:


This topic needs its own flippin' newsgroup.

S

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] RELEASED Python 2.6.4

2009-10-27 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Barry Warsaw wrote:
> On behalf of the Python community, I'm happy to announce the  
> availability of Python 2.6.4.  This is the latest production-ready  
> version in the Python 2.6 series.
> 
> We had a little trouble with the Python 2.6.3 release; a number of  
> unfortunate regressions were introduced.  I take responsibility for  
> rushing it out, but the good news is that Python 2.6.4 fixes the known  
> regressions in 2.6.3.  We've had a lengthy release candidate cycle  
> this time, and are confident that 2.6.4 is a solid release.  We highly  
> recommend you upgrade to Python 2.6.4.
> 
> Please see the NEWS file for all the gory details.
> 
>  http://www.python.org/download/releases/2.6.4/NEWS.txt
> 
> Source tarballs and the Windows installers can be downloaded from the  
> Python 2.6.4 page.  The Mac OS X disk image will be uploaded soon.
> 
> http://www.python.org/download/releases/2.6.4/
> 
> For more information on Python 2.6 in general, please see
> 
> http://docs.python.org/whatsnew/2.6.html
> 
> Please report bugs for any Python version in the Python tracker.
> 
> http://bugs.python.org

Congratulations, and thaks for working to correct the issues with the
earlier release so quickly.


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [email protected]
Palladion Software   "Excellence by Design"http://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkrnRaEACgkQ+gerLs4ltQ5yHACgt9CqCyIE8HfkKCNjSEAU3MB1
A70AoL/yJB9lcI+RrBe3/BlqChCweXvr
=K/lR
-END PGP SIGNATURE-

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Jesse Noller
On Tue, Oct 27, 2009 at 3:06 PM, [email protected]
 wrote:
>
> On Oct 27, 2009, at 2:50 PM, Terry Reedy wrote more and more and more and
> more and more and more and more and more and more:
>
> This topic needs its own flippin' newsgroup.
>
> S

Don't like it? Mute the conversation (thank you gmail) or unsub.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Guido van Rossum
On Tue, Oct 27, 2009 at 11:50 AM, Terry Reedy  wrote:
> There are two ideas of set.get floating about:
> 1) get an arbitrary object
> 2) get the object in the set with the same 'value'(hash+eq) as an input arg
> (the intern case). In this case, there is a 'key', even if it is somewhat
> abstract rather that being an object.
>
> Both could be done with the same method, depending on whether an arg is
> passed or not.

My gut tells me it is bad API design to collapse these two use cases.
Probably because the implementations won't have much in common: (1)
should just pick the first valid element, while (2) should use the
normal hash lookup algorithm (shared with 'in', .add() etc.).

-- 
--Guido van Rossum (python.org/~guido)
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 3:13 PM, Guido van Rossum  wrote:
> On Tue, Oct 27, 2009 at 11:50 AM, Terry Reedy  wrote:
>> There are two ideas of set.get floating about:
>> 1) get an arbitrary object
>> 2) get the object in the set with the same 'value'(hash+eq) as an input arg
>> (the intern case). In this case, there is a 'key', even if it is somewhat
>> abstract rather that being an object.
>>
>> Both could be done with the same method, depending on whether an arg is
>> passed or not.
>
> My gut tells me it is bad API design to collapse these two use cases.
> Probably because the implementations won't have much in common: (1)
> should just pick the first valid element, while (2) should use the
> normal hash lookup algorithm (shared with 'in', .add() etc.).
>
> --
> --Guido van Rossum (python.org/~guido)


Was it ever decided whether this would fall under the moratorium?

Geremy Condra
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-10-27 Thread Raymond Hettinger


[geremy condra]

Was it ever decided whether this would fall under the moratorium?


Decided isn't the right word:
http://mail.python.org/pipermail/python-dev/2009-October/093373.html

FWIW, I'm a strong -1 on both proposals.

Just add a short get_one() function and a get_equivalent() recipe
to your utils directory.  That will get the job done (thought I don't
expect that you will *ever* make much use of either one).
No need to complexify a type that is currently very simple. 



Raymond



P.S.  get_equivalent:  http://code.activestate.com/recipes/499299/
get_one = lambda s, default=None:  next(iter(s), default)

The first works with all type that defines __contains__.
The second works for any iterable.
Neither of these concepts are specific to set objects.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] Refactoring installation schemes

2009-10-27 Thread Tarek Ziadé
Hello,

Since the addition of PEP 370, (per-user site packages), site.py and
distutils/command/install.py are *both* providing the various
installation directories for Python,
depending on the system and the Python version.

We have also started to discuss lately in various Mailing Lists the
addition of new schemes for IronPython and Jython, meaning that we
might add some more in both places.

I would like to suggest a simplification by adding a dedicated module
to manage these installation schemes in one single place in the
stdlib.

This new independant module would be used by site.py and distutils and
would also make it easier for third party code to work with these
schemes.
Of course this new module would be rather simple and not add any new
import statement to avoid any overhead when Python starts and loads
site.py

Regards
Tarek
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Terry Reedy

[email protected] wrote:


On Oct 27, 2009, at 2:50 PM, Terry Reedy wrote more and more and more 
and more and more and more and more and more and more:


Actually, I wrote 7 succinct lines that summarized and made a proposal.
In general, I snip when quoting and write concisely as possible.


This topic needs its own flippin' newsgroup.


You need to learn politeness. You could have said just that, appropriate 
or not, without dumping on anyone in particular.


Terry Jan Reedy


___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread [email protected]


On Oct 27, 2009, at 11:02 PM, Terry Reedy wrote:


[email protected] wrote:



This topic needs its own flippin' newsgroup.
You could have said just that, appropriate or not, without dumping  
on anyone in particular.


I was not trying to dump on you in particular, I picked a random  
message of the trillions that went by and happened to get you.  I  
apologize if you felt dumped on.


No offense intended to you in particular but this thread has gone on  
and on and on and on and on and on...


S

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a setwithoutremoving it

2009-10-27 Thread geremy condra
On Tue, Oct 27, 2009 at 3:49 PM, Raymond Hettinger  wrote:
>
> [geremy condra]
>>
>> Was it ever decided whether this would fall under the moratorium?
>
> Decided isn't the right word:
> http://mail.python.org/pipermail/python-dev/2009-October/093373.html
>



I'm unclear- does that imply that this is this going to be decided on a
case-by-case basis in the future or have the details for the big M just
not been hammered out yet?

Geremy Condra
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Python Package Management Roadmap in Python Releases

2009-10-27 Thread David Lyon
On Thu, 22 Oct 2009 10:20:03 + (UTC), Antoine Pitrou
 wrote:
> (*) Remember, however, that Tarek and work on Distribute, and also on
> bringing pieces of setuptools/Distribute functionality into distutils.

But if that's the case then why not work on any third party tool..? like 
pip or setuptools?

It seems are very longwinded process if the only way to work on
python is to work on distutils but before doing that you have to
first work on distribute and then wait for all the changes to work
their way back up the chain..

Actually, I have finally worked out what I want. That is shell support
in the python windows distribution so that you can right click an
.egg and install it.

I don't see how that can be achieved by following the workprocess
that you describe above.

David

___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] nonlocal keyword in 2.x?

2009-10-27 Thread Lennart Regebro
2009/10/22 "Martin v. Löwis" :
> What use has such a stepping stone? Why, and (more importantly) when
> would anybody currently supporting 2.x give up 2.6 and earlier, and
> only support 2.7? And, if they chose to do so, why would they not move
> the code base to 3.x right away?

Python 2 support is not only about supporting old versions of Python,
but also supporting users of Python2-only modules.

If you have a module that runs only on Python 2.7, the people who for
some reason can not move to Python 3 yet, can still use it, by running
Python 2.7. For that your module doesn't have to run on 2.6 or 2.5.


So 2.7 support will for the most part be a case not of supporting
Python versions, but Python *users*.
Which is a good thing.

-- 
Lennart Regebro: Python, Zope, Plone, Grok
http://regebro.wordpress.com/
+33 661 58 14 64
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-10-27 Thread Nick Coghlan
Guido van Rossum wrote:
> My gut tells me it is bad API design to collapse these two use cases.
> Probably because the implementations won't have much in common: (1)
> should just pick the first valid element, while (2) should use the
> normal hash lookup algorithm (shared with 'in', .add() etc.).

As a side note, a fairly obvious method name for "add if missing and
then return canonical representation" did occur to me: s.intern(x)

I'd be -0 on expanding the set API for this though (since the cookbook
recipe overloading __eq__ already provides an efficient solution).

As far as the moratorium in general goes, perhaps we should draw a line
between API changes that affect the ABCs in collections and numbers and
new convenience methods on the builtin types themselves?

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
---
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Retrieve an arbitrary element from a set without removing it

2009-10-27 Thread Nick Coghlan
Alexander Belopolsky wrote:
> Odd indeed.  My first reaction was: it is not needed because lists
> support slicing, but when I tried to construct a list.get() using
> slicing the best I could come up with was the following hack
> 
 def lget(l, i, v):  return (l[i:] or [v])[0]
> ...
 lget(range(10), 20, 200)
> 200
 lget(range(10), 5, 50)
> 5
> 
> Yet for some reason I never missed this functionality ...

People tend to do length checks on lists to decide which items are and
are not present. You can't do that with a dict.

Cheers,
Nick.

-- 
Nick Coghlan   |   [email protected]   |   Brisbane, Australia
---
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com