On Fri, 2010-07-09 at 15:58 +, Steven D'Aprano wrote:
> On Fri, 09 Jul 2010 15:02:25 +0200, Frederic Rentsch wrote:
>
> > I develop in an IDLE window.
> >
> > Module M says 'from service import *'. Next I correct a mistake in
> > function '
On Fri, 2010-07-09 at 19:38 +0200, Jean-Michel Pichavant wrote:
> Frederic Rentsch wrote:
> > I develop in an IDLE window.
> >
> > Module M says 'from service import *'.
> > Next I correct a mistake in function 'service.f'.
> > Now 'servic
uld create a list of all objects whose .number is 100. No need
to cycle through a loop. If .number doesn't repeat get your object at
index 0. The approach may seem inefficient for the purpose of extracting
a single item, but the list needs to be gone through in any case and the
list comprehension is surely the most efficient way to do it.
Frederic
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 2010-08-16 at 23:17 +, Steven D'Aprano wrote:
> On Mon, 16 Aug 2010 20:40:52 +0200, Frederic Rentsch wrote:
>
> > How about
> >
> >>>> [obj for obj in dataList if obj.number == 100]
> >
> > That should create a list of all objects wh
a): pass
> > >
> > > Does Python compute set(a) twice?
> >
> > CPython does. Shed Skin might optimize. Don't know
> > about Iron Python.
>
> I doubt any actual Python implementation optimizes this -- how could it?
And why should it if a prog
On Fri, 2010-09-03 at 13:29 +0200, Virgil Stokes wrote:
> A more direct question on accessing stock information from Yahoo.
>
> First, use your browser to go to: http://finance.yahoo.com/q/cp?s=%
> 5EGSPC+Components
>
> Now, you see the first 50 rows of a 500 row table of information on
> S&P 50
On Fri, 2010-09-03 at 16:48 +0200, Virgil Stokes wrote:
> On 03-Sep-2010 15:45, Frederic Rentsch wrote:
> > On Fri, 2010-09-03 at 13:29 +0200, Virgil Stokes wrote:
> >> A more direct question on accessing stock information from Yahoo.
> >>
> >> Fir
#
> # them in an approrpriate file
> symbols.extend (s [:-3])
>
> return symbols
> # Not quite 500 -- which is correct (for example p. 2 has only 49
> symbols!)
> # Actually the S&P 500 as shown does not contain 500 stocks (
101 - 108 of 108 matches
Mail list logo