Re: Overloading __init__ & Function overloading

Discussion in 'Python' started by Fredrik Lundh, Sep 30, 2005.

  1. "Iyer, Prasad C" wrote:

    > a. Is there something like function overloading in python?


    not in the usual sense, no. function arguments are not typed, so there's nothing
    to dispatch on. there are several cute tricks you can use to add dispatching on
    top of "raw" python, but that's nothing you should do unless you have very good
    reasons.

    > b. Can I overload __init__ method


    not in the usual sense, no. same reason as above.

    also see:

    http://www.python.org/doc/faq/programming.html#how-can-i-overload-constructors-or-methods-in-python

    </F>
     
    Fredrik Lundh, Sep 30, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steven Bethard
    Replies:
    2
    Views:
    462
    Steven Bethard
    Feb 16, 2005
  2. Iyer, Prasad C

    Overloading __init__ & Function overloading

    Iyer, Prasad C, Sep 30, 2005, in forum: Python
    Replies:
    3
    Views:
    6,428
    Fredrik Lundh
    Sep 30, 2005
  3. Steve Holden
    Replies:
    0
    Views:
    437
    Steve Holden
    Sep 30, 2005
  4. Iyer, Prasad C
    Replies:
    4
    Views:
    585
    John J. Lee
    Sep 30, 2005
  5. Fredrik Lundh
    Replies:
    0
    Views:
    410
    Fredrik Lundh
    Sep 30, 2005
Loading...

Share This Page