Functions, Operators, and Overloading?

Michael Yanowitz m.yanowitz at kearfott.com
Mon Jul 24 13:00:19 EDT 2006


Hello:

   Maybe I am missing something, but from what I've seen,
it is not possible to overload functions in Python. That
is I can't have a
  def func1 (int1, string1):
   and a 
  def func1 (int1, int3, string1, string2):
    without the second func1 overwriting the first.

   However, operators can be overloaded. 
   So can I define a new operator?  If so, can I
define func1 as an operator?

(on the side, I have always wanted to define the
++ operator as +=1. Is that possible?)

Thanks in advance:
Michael Yanowitz




More information about the Python-list mailing list