object types, mutable or not?

2018-05-13 Thread Mike McClain
I'm new to Python and OOP. Python en 2.7.14 Documentation The Python Language Reference 3. Data model 3.1. Objects, values and types An object's type is also unchangeable. [1] [1] It is possible in some cases to change an object's type, under certain controlled conditions. It appears to

Re: object types, mutable or not?

2018-05-15 Thread Mike McClain
On Sun, May 13, 2018 at 07:10:11PM -0400, Richard Damon wrote: > On 5/13/18 4:02 PM, Mike McClain wrote: > > I'm new to Python and OOP. > > Python en 2.7.14 Documentation The Python Language Reference > > 3. Data model > > 3.1. Objects, values and types > >

stock quotes off the web, py style

2018-05-15 Thread Mike McClain
Initially I got my quotes from a broker daily to plug into a spreadsheet, Then I found Yahoo and wrote a perl script to grab them. When Yahoo quit supplying quotes I found AlphaVantage.co and rewrote the perl script. AlphaVantage.co has been down since last week and I found iextrading.com h

Re: stock quotes off the web, py style

2018-05-16 Thread Mike McClain
For Friedrich's, Peter's and the many other responses, many thanks. I will get a handle on python eventually and the many teachers on this list are making that easier. Mike -- "There are three kinds of men. The ones who learn by reading. The few who learn by observation. The rest of them have to p

Re: stock quotes off the web, py style

2018-05-16 Thread Mike McClain
On Wed, May 16, 2018 at 02:33:23PM +0200, Friedrich Rentsch wrote: > > I didn't know the site you mention. I've been getting quotes from > Yahoo daily. The service they discontinued was for up to 50 symbols > per page. I now parse a separate page of some 500K of html for each > symbol! This site i

Re: object types, mutable or not?

2018-05-17 Thread Mike McClain
On Thu, May 17, 2018 at 07:28:44PM +1000, Chris Angelico wrote: > On Thu, May 17, 2018 at 7:16 PM, Anders Wegge Keller wrote: > > P?? Wed, 16 May 2018 14:48:27 +0100 > > Paul Moore skrev: > > > >> C++ called that an "rvalue". And then went on to define things that > >> could go on the left hand s

decorat{or,ion}

2018-05-18 Thread Mike McClain
Let's say I want something that does most or all of foo's functionality plus a little more and maybe tweek some of foo's output, so I write a wrapper around foo and call it bar. If inside bar are the call to foo, as well as methods baz(), buz() and bug() that make their magic and bar ends up pe

Re: decorat{or,ion}

2018-05-19 Thread Mike McClain
On Sat, May 19, 2018 at 08:22:59AM +0200, dieter wrote: > Mike McClain writes: > > An "object", in general, is something that can have attributes > (holding the object state) and methods (defining often operations on > the object state but in some cases also general ope

Re: decorat{or,ion}

2018-05-19 Thread Mike McClain
On Sat, May 19, 2018 at 07:22:28AM +, Steven D'Aprano wrote: > On Fri, 18 May 2018 18:31:16 -0700, Mike McClain wrote: > > I *think* you are describing something like this: Real close! > def foo(x): > return x + 1 > > def bar(arg): > a = baz(arg) # do so

Re: decorat{or,ion}

2018-05-23 Thread Mike McClain
On Mon, May 21, 2018 at 09:11:02AM +0200, dieter wrote: < lots if good info snipped > Hi dieter, I'm still working my way through the info you posted and making sense of it (mostly) but didn't want to wait any longer to say 'Thanks.' Thanks, Mike -- Even duct tape can't fix stupid ... But it

'_' and '__'

2018-05-26 Thread Mike McClain
In their discussion of 'List replication operator' Steven D'Aprano and Ben Finney used these '_' and '__'. Steve said, "[[] for _ in range(5)]". Ben said, "[ [] for __ in range(5) ]". These aren't listed separately in the index, where might I find written discussion of these? Thanks, Mike

Re: '_' and '__'

2018-05-29 Thread Mike McClain
To the many who responded, many thanks. I,too, found Nick Coghlan's answer iluminating. Mike -- There are always gossips everywhere you go and few of them limit themselves to veracity when what they consider a good story is available to keep their audience entertained. - MM -- https://mail

... (ellipsis)

2018-05-31 Thread Mike McClain
I'm having understanding the use if the ellipsis. I keep reading that it is used in slices but every time I use it I get 'Syntax error' in 2.7 if 'Type error' in 3.2. In python2.7: l=range(15) l[...:11] Syntax error l[3:...] Syntax error l[3:...:11] Syntax error In python3.2 it becomes 'Type

version

2018-05-31 Thread Mike McClain
OK so I installed python 3.2, which is the latest available as a package in Debian Wheezy, because I've seen so many folks say it's a waste of time to play with Py2.7. Immediately my python playground 'my.python.py' failed as soon as I changes the '#!' line to python3.2. Most of the err

Re: ... (ellipsis)

2018-06-01 Thread Mike McClain
On Thu, May 31, 2018 at 11:00:13PM -0400, Terry Reedy wrote: > On 5/31/2018 10:26 PM, Mike McClain wrote: > > I'm having understanding the use if the ellipsis. > >I keep reading that it is used in slices > > By numpy for numpy multidimensional arrays, which have thei

Re: version

2018-06-01 Thread Mike McClain
On Thu, May 31, 2018 at 07:44:35PM -0700, Mike McClain wrote: > Is there a way in a script to know which version of python is being > run so I can write: > If (version == 2.7): > do it this way > elsif (version == 3.2): > do it another way > Thanks fo

Re: version

2018-06-01 Thread Mike McClain
On Fri, Jun 01, 2018 at 08:02:27AM -0700, Mike McClain wrote: > On Thu, May 31, 2018 at 07:44:35PM -0700, Mike McClain wrote: > > > Is there a way in a script to know which version of python is being > > run so I can write: > > If (version == 2.7): > >