Re: Newbie look at Python and OO

2007-05-12 Thread walterbyrd
> > You started this thread with a list of conceptual problems you were > having. Are they now cleared up? > Yes. Thank you, and everybody else. I'm still learning, and still getting used to Python. But, I understand the concepts that I was having trouble with before. -- http://mail.python.org

Re: Newbie look at Python and OO

2007-05-11 Thread Steven D'Aprano
On Fri, 11 May 2007 20:07:36 -0700, walterbyrd wrote: >> He's thinking in Pascal, not C. >> > > Actually, I have programmed in many languages. I just first learned in > Pascal. > > For me, going from Pascal, to basic,c,cobol,fortran . . was not that > difficult. Python, however, feels strange.

Re: Newbie look at Python and OO

2007-05-11 Thread Grant Edwards
On 2007-05-12, walterbyrd <[EMAIL PROTECTED]> wrote: >> He's thinking in Pascal, not C. > > Actually, I have programmed in many languages. I just first learned in > Pascal. > > For me, going from Pascal, to basic,c,cobol,fortran . . was not that > difficult. That's because those languages are al

Re: Newbie look at Python and OO

2007-05-11 Thread Grant Edwards
On 2007-05-12, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Thu, 10 May 2007 16:25:35 +, Grant Edwards wrote: > >>> I know why, but this is not what I would ordinarilly expect, >> >> Stop thinking in "C". ;) > > Dude! Did you miss the Original Poster's VERY FIRST SENTENCE??? > > "I learned

Re: Newbie look at Python and OO

2007-05-11 Thread walterbyrd
> He's thinking in Pascal, not C. > Actually, I have programmed in many languages. I just first learned in Pascal. For me, going from Pascal, to basic,c,cobol,fortran . . was not that difficult. Python, however, feels strange. As crazy as this may sound: Python, in some ways, reminds me of asse

Re: Newbie look at Python and OO

2007-05-11 Thread Steven D'Aprano
On Thu, 10 May 2007 16:25:35 +, Grant Edwards wrote: >> I know why, but this is not what I would ordinarilly expect, > > Stop thinking in "C". ;) Dude! Did you miss the Original Poster's VERY FIRST SENTENCE??? "I learned to program with Pascal, way back when." He's thinking in Pascal, not

Re: Newbie look at Python and OO

2007-05-11 Thread Grant Edwards
On 2007-05-11, Duncan Booth <[EMAIL PROTECTED]> wrote: > Grant Edwards <[EMAIL PROTECTED]> wrote: > >> http://www.ariel.com.au/jokes/An_Interview_with_Bjarne_Stroustrup.html >> >> Maybe BS thought he was joking, but IMO, it's true. >> >> "Stroustrup: Remember the length of the average-sized 'C'

Re: Newbie look at Python and OO

2007-05-11 Thread Duncan Booth
Grant Edwards <[EMAIL PROTECTED]> wrote: > http://www.ariel.com.au/jokes/An_Interview_with_Bjarne_Stroustrup.html > > Maybe BS thought he was joking, but IMO, it's true. > > "Stroustrup: Remember the length of the average-sized 'C' >project? About 6 months. Not nearly long enough for a guy

Re: Newbie look at Python and OO

2007-05-11 Thread Grant Edwards
On 2007-05-10, Gabriel Genellina <[EMAIL PROTECTED]> wrote: > En Thu, 10 May 2007 18:21:42 -0300, <[EMAIL PROTECTED]> escribió: > >> These conversations are funny to me. I use Python every day and I >> have never actually thought about the implications of binding objects >> to names, or two names

Re: Newbie look at Python and OO

2007-05-10 Thread Gabriel Genellina
En Thu, 10 May 2007 18:21:42 -0300, <[EMAIL PROTECTED]> escribió: > These conversations are funny to me. I use Python every day and I > have never actually thought about the implications of binding objects > to names, or two names pointing to the same object. Problems of this > sort just never c

Re: Newbie look at Python and OO

2007-05-10 Thread Bruno Desthuilliers
[EMAIL PROTECTED] a écrit : (snip) > After thought: > > I do run into problems testing boolean values on a regular basis. FWIW, booleans were a late add-on. Originally, Python didn't had a bool type, only rules about the boolean value of a given object, mostly: 0, 0.0, '', [], (,), {} and None

Re: Newbie look at Python and OO

2007-05-10 Thread half . italian
On May 10, 2:21 pm, [EMAIL PROTECTED] wrote: > walterbyrd wrote: > > I learned to program with Pascal, way back when. Went into software > > development for a while, then went into systems admin. Have programmed > > in several languages, just learning Python. > > > Some things I find odd: > > > 1)

Re: Newbie look at Python and OO

2007-05-10 Thread half . italian
walterbyrd wrote: > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 == -3? > > 2) list assignment handling, pointing tw

Re: Newbie look at Python and OO

2007-05-10 Thread Bruno Desthuilliers
walterbyrd a écrit : > Thanx for all the replies, I may be slowly getting it. But, can > anybody explain this? > > a = 'hello' b = 'hello' a is b > > True > a = 'hello there' b = 'hello there' a is b > > False > Python - well, CPython (the reference C implementation) a

Re: Newbie look at Python and OO

2007-05-10 Thread walterbyrd
Nevermind my previous question. I found the answer in "Learning Python" >> Python internally caches and reuses short strings as an optimization, there really is just a single string, 'spam', in memory, shared by S1 and S2; hence, the is identity test reports a true result. To trigger the normal be

Re: Newbie look at Python and OO

2007-05-10 Thread walterbyrd
Thanx for all the replies, I may be slowly getting it. But, can anybody explain this? >>> a = 'hello' >>> b = 'hello' >>> a is b True >>> a = 'hello there' >>> b = 'hello there' >>> a is b False -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie look at Python and OO

2007-05-10 Thread Bruno Desthuilliers
walterbyrd a écrit : > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 == -3? integer division. > 2) list assignment

Re: Newbie look at Python and OO

2007-05-10 Thread Neil Cerutti
On 2007-05-10, walterbyrd <[EMAIL PROTECTED]> wrote: > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 == -3? Any math

Re: Newbie look at Python and OO

2007-05-10 Thread jmg3000
On May 10, 11:58 am, walterbyrd <[EMAIL PROTECTED]> wrote: >[snip] > > 2) list assignment handling, pointing two vars to the same list: > > With simple data types:>>> a = 5 > >>> b = a > >>> a = 3 > >>> a,b > > (3, 5) > > Which is what I'd expect, since I have changed a, but not b. > > But with lis

Re: Newbie look at Python and OO

2007-05-10 Thread Larry Bates
walterbyrd wrote: > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 == -3? > > 2) list assignment handling, pointing

Re: Newbie look at Python and OO

2007-05-10 Thread Chris Mellon
On 10 May 2007 08:58:54 -0700, walterbyrd <[EMAIL PROTECTED]> wrote: > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 =

Re: Newbie look at Python and OO

2007-05-10 Thread Grant Edwards
On 2007-05-10, walterbyrd <[EMAIL PROTECTED]> wrote: > 2) list assignment handling, pointing two vars to the same list: Python doesn't have variables. It has objects to which you can bind names. > But with lists: a = list("1234") That creates a list object and binds the name "a" to it.

Re: Newbie look at Python and OO

2007-05-10 Thread Carsten Haese
On Thu, 2007-05-10 at 08:58 -0700, walterbyrd wrote: > I learned to program with Pascal, way back when. Went into software > development for a while, then went into systems admin. Have programmed > in several languages, just learning Python. > > Some things I find odd: > > 1) 5/-2 == -3? Divisio

Newbie look at Python and OO

2007-05-10 Thread walterbyrd
I learned to program with Pascal, way back when. Went into software development for a while, then went into systems admin. Have programmed in several languages, just learning Python. Some things I find odd: 1) 5/-2 == -3? 2) list assignment handling, pointing two vars to the same list: With sim