Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Overloading __init__ & Function overloading

Reply
Thread Tools

Re: Overloading __init__ & Function overloading

 
 
Fredrik Lundh
Guest
Posts: n/a
 
      09-30-2005
"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/progra...hods-in-python

</F>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RE: Overloading __init__ & Function overloading Iyer, Prasad C Python 4 09-30-2005 08:01 PM
Re: Overloading __init__ & Function overloading Fredrik Lundh Python 0 09-30-2005 03:59 PM
Overloading __init__ & Function overloading Iyer, Prasad C Python 3 09-30-2005 02:17 PM
Re: Overloading __init__ & Function overloading Steve Holden Python 0 09-30-2005 01:58 PM
__new__ does not call __init__ as described in descrintro.html (WAS:Can __new__ prevent __init__ from being called?) Steven Bethard Python 2 02-16-2005 06:50 AM



Advertisments