Re: 'reload M' doesn't update 'from M inport *'

2010-07-09 Thread Frederic Rentsch
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 '

Re: 'reload M' doesn't update 'from M inport *'

2010-07-09 Thread Frederic Rentsch
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

Re: Simple Problem but tough for me if i want it in linear time

2010-08-16 Thread Frederic Rentsch
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

Re: Simple Problem but tough for me if i want it in linear time

2010-08-18 Thread Frederic Rentsch
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

Re: expression in an if statement

2010-08-18 Thread Frederic Rentsch
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

Re: Financial time series data

2010-09-03 Thread Frederic Rentsch
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

Re: Financial time series data

2010-09-03 Thread Frederic Rentsch
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

Re: Financial time series data

2010-09-04 Thread Frederic Rentsch
# > # 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 (

<    1   2