No method overloadin I suppose ?

Thomas SMETS tsmets at altern.org
Wed Apr 12 17:15:42 CEST 2000


## Beginning of Python program ...
class Lister:
  def __init__(self):
    print 'In constructor ...'
    __init__(1)

  def __init__(self, lValue):
    print 'In constructor with parameter'
    self.l = lValue

  def __repr__(self):
    print '\n******\n\tValue is : ', l, '\n********'

if __name__ == "__main__":
  x = Lister()
  y = Lister (2)
## End of python program

Trace of execution is :
Traceback (innermost last):
  File "Minheritence.py", line 14, in ?
  x = Lister()
TypeError: not enough arguments; expected 2, got 1
End of trace ...

I guess I can't do methods overloadin', as shown... WHY is that ? I'm
wrong ?

Thomas,


-- 

Thomas SMETS                           Phone : +32 (0)2 742. 05. 94.
Av. de la Brabançonne 133 / 3          e-mail : tsmets @altern.org
1030 Bruxelles

==== Quote of the day =========
1 1 was a race-horse, 2 2 was 1 2. When 1 1 1 1 race, 2 2 1 1 2.
 ======= End of Quote =========
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tsmets.vcf
Type: text/x-vcard
Size: 182 bytes
Desc: Card for Thomas SMETS
URL: <http://mail.python.org/pipermail/python-list/attachments/20000412/1c966570/attachment.vcf>


More information about the Python-list mailing list