Re: Basic inheritance question

2008-01-21 Thread Lie
> > Please stop taking my words to its letters. > > So we're supposed to actually guess what you really mean ??? That's what human does, otherwise you'll "Fail the Turing Test". > >> Personally, I've seen many C++ programs with complex class designs > >> where it definitely helps to consistently

Re: Basic inheritance question

2008-01-21 Thread Bruno Desthuilliers
Lie a écrit : > On Jan 16, 9:23 pm, Bjoern Schliessmann [EMAIL PROTECTED]> wrote: >> Lie wrote: >>> [EMAIL PROTECTED]> wrote: I used to systematically use it - like I've always systematically used 'this' in C++ and Java. >>> And that is what reduces readability. >> IMHO not, IOPHO not.

Re: Basic inheritance question

2008-01-20 Thread Bjoern Schliessmann
(messed up references?) Lie wrote: > Please again, stop taking letters to the words Please don't mix up followups. Regards, Björn -- BOFH excuse #11: magnetic interference from money/credit cards -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic inheritance question

2008-01-20 Thread Lie
On Jan 16, 9:23 pm, Bjoern Schliessmann wrote: > Lie wrote: > > [EMAIL PROTECTED]> wrote: > >> I used to systematically use it - like I've always systematically > >> used 'this' in C++ and Java. > > > And that is what reduces readability. > > IMHO not, IOPHO not. This is the nth time (n >> 1) thi

Re: Basic inheritance question

2008-01-16 Thread Bruno Desthuilliers
Lie a écrit : > On Jan 15, 9:00 pm, Bruno Desthuilliers [EMAIL PROTECTED]> wrote: >> Lie a écrit : >> >> >> >>> On Jan 7, 2:46 am, Bruno Desthuilliers >>> <[EMAIL PROTECTED]> wrote: Lie a écrit : (snip) > No, seriously it isn't Java habits only, most other languages wouldn't > need ex

Re: Basic inheritance question

2008-01-16 Thread Bjoern Schliessmann
Lie wrote: > [EMAIL PROTECTED]> wrote: >> I used to systematically use it - like I've always systematically >> used 'this' in C++  and Java. > > And that is what reduces readability. IMHO not, IOPHO not. This is the nth time (n >> 1) this discussion comes up here. If I have learned one thing fr

Re: Basic inheritance question

2008-01-16 Thread Lie
On Jan 15, 9:00 pm, Bruno Desthuilliers wrote: > Lie a écrit : > > > > > On Jan 7, 2:46 am, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > >> Lie a écrit : > > >>> On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > Jeroen Ruigrok van der Werven wrote: > > Shouldn't this be: > > self.

Re: Basic inheritance question

2008-01-15 Thread Bruno Desthuilliers
Lie a écrit : > On Jan 7, 2:46 am, Bruno Desthuilliers > <[EMAIL PROTECTED]> wrote: >> Lie a écrit : >> >>> On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: Jeroen Ruigrok van der Werven wrote: > Shouldn't this be: > self.startLoc = start > self.stopLoc = stop Thanks! Of course it

Re: Basic inheritance question

2008-01-14 Thread Lie
On Jan 7, 2:46 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Lie a écrit : > > > On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > > >>Jeroen Ruigrok van der Werven wrote: > > >>>Shouldn't this be: > > >>>self.startLoc = start > >>>self.stopLoc = stop > > >>Thanks! Of course it should. Old Java

Re: Basic inheritance question

2008-01-06 Thread Neil Cerutti
On Jan 6, 2008 6:59 PM, Dan Bishop <[EMAIL PROTECTED]> wrote: > > My employer has us use the "m_" convention. > > I wonder why Bjarne made "this->" optional in the first place. > -- > http://mail.python.org/mailman/listinfo/python-list > I think implicit this-> is somewhat more defensible. If 'th

Re: Basic inheritance question

2008-01-06 Thread Dan Bishop
On Jan 5, 4:53 am, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > Jeroen Ruigrok van der Werven wrote: > >> self.startLoc = start > >> self.stopLoc = stop > > > Thanks! Of course it should. Old Java habits die slowly. > > That's not really a Java habit. In Java and C++, personally I lik

Re: Basic inheritance question

2008-01-06 Thread Francesco Guerrieri
On Jan 5, 2008 11:31 AM, <[EMAIL PROTECTED]> wrote: > import tok > > class code: > def __init__( self, start, stop ): > startLoc = start > stopLoc = stop > > class token(code): > pass > Apart from the missing self, remember that the __init__(...) of the base classes is no

Re: Basic inheritance question

2008-01-06 Thread Bruno Desthuilliers
Lie a écrit : > On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > >>Jeroen Ruigrok van der Werven wrote: >> >> >>>Shouldn't this be: >> >>>self.startLoc = start >>>self.stopLoc = stop >> >>Thanks! Of course it should. Old Java habits die slowly. > > > No, seriously it isn't Java habits only, most ot

Re: Basic inheritance question

2008-01-05 Thread Lie
On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > Jeroen Ruigrok van der Werven wrote: > > > Shouldn't this be: > > > self.startLoc = start > > self.stopLoc = stop > > Thanks! Of course it should. Old Java habits die slowly. No, seriously it isn't Java habits only, most other languages wouldn't need e

Re: Basic inheritance question

2008-01-05 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > Jeroen Ruigrok van der Werven wrote: >> self.startLoc = start >> self.stopLoc = stop > > Thanks! Of course it should. Old Java habits die slowly. That's not really a Java habit. In Java and C++, personally I like to write this.startLoc = start this.stopLoc = stop It

Re: Basic inheritance question

2008-01-05 Thread MartinRinehart
Jeroen Ruigrok van der Werven wrote: > Shouldn't this be: > > self.startLoc = start > self.stopLoc = stop Thanks! Of course it should. Old Java habits die slowly. -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic inheritance question

2008-01-05 Thread Paul Hankin
On Jan 5, 10:31 am, [EMAIL PROTECTED] wrote: > ... > class code: >     def __init__( self, start, stop ): >         startLoc = start >         stopLoc = stop > ... You've forgotten the explicit self. def __init__( self, start, stop ): self.startLoc = start self.stopLoc = sto

Re: Basic inheritance question

2008-01-05 Thread Jeroen Ruigrok van der Werven
-On [20080105 11:36], [EMAIL PROTECTED] ([EMAIL PROTECTED]) wrote: >class code: >def __init__( self, start, stop ): >startLoc = start >stopLoc = stop Shouldn't this be: self.startLoc = start self.stopLoc = stop ? -- Jeroen Ruigrok van der Werven / asmodai イェルーン ラウフロック ヴァン

Basic inheritance question

2008-01-05 Thread MartinRinehart
Working on parser for my language, I see that all classes (Token, Production, Statement, ...) have one thing in common. They all maintain start and stop positions in the source text. So it seems logical to have them all inherit from a base class that defines those, but this doesn't work: import to