"Learning Python" 2nd ed. p479 error?

  • Thread starter AbrahamLincolnIllinois
  • Start date
A

AbrahamLincolnIllinois

Hello all.

On page 479, the 2nd edition of the "Learning Python" book, this code
appears

class Derived(Base):
def __init__(self, arg, *args, **kw):
self.__init__(self, *args, **kw)

Surely self.__init__ should be

Base.__init__

Everything else in the book has been crystal clear. Up to page 479!
It doesn't appear in the errata. What am I misunderstanding?


Regards,

Abraham
 
F

Fredrik Lundh

On page 479, the 2nd edition of the "Learning Python" book, this code
appears

class Derived(Base):
def __init__(self, arg, *args, **kw):
self.__init__(self, *args, **kw)

Surely self.__init__ should be

Base.__init__

I don't have a copy within reach, but from what you say, it sure looks
like a typo.
It doesn't appear in the errata. What am I misunderstanding?

nothing, except perhaps what's the best place to report errors in
O'Reilly books (I'm quite sure they don't read this newsgroup ;-)

there's a "view/submit errata" link on this page:

http://www.oreilly.com/catalog/lpython2/

</F>
 
M

Mel Wilson

Hello all.

On page 479, the 2nd edition of the "Learning Python" book, this code
appears

class Derived(Base):
def __init__(self, arg, *args, **kw):
self.__init__(self, *args, **kw)

Surely self.__init__ should be

Base.__init__

Everything else in the book has been crystal clear. Up to page 479!
It doesn't appear in the errata. What am I misunderstanding?

Seems to be a typo:

Python 2.4.2 (#1, Jan 23 2006, 21:24:54)
[GCC 3.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more
information..... def __init__ (self):
.... print 'Constructing A'
........ def __init__ (self):
.... self.__init__ (self)
....Traceback (most recent call last):
File "<stdin>", line 1, in ?
.... def __init__ (self):
.... A.__init__ (self)
....Constructing A
<__main__.C object at 0x402cf5ac>




Mel.
 
A

AbrahamLincolnIllinois

Thanks for your help, guys. I'm convinced it is a bug, not a
misunderstanding. I submitted it to the errata page at O'Reilly.


Regards,

Abraham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top