Function override?

Bjorn Pettersen bjorn at
Thu Mar 30 23:25:01 CEST 2000

Don't try to program C++ in Python (you'll just waste a lot of time).

The "right" way to do this is something similar to:

	class over:
		def somefunInt(self, bakeint):
		def somefunString(self, bakestr):

I'm sure others will chime in with various workarounds...

Python-doesn't-have-function-overloading-so-don't-use-it'ly y'rs

Arint? wrote:
> I have a class similar to this:
> class over:
>    somefun(self, bakeint):
>       ...
>    somefun(self, bakeStr):
> If the user uses a string then I want to use the 2nd one, else an
> Integer then use the 1st one?
> How can I get this?  And what is this call in c, the word escapes me
> right now.
> Sent via
> Before you buy.
> --

More information about the Python-list mailing list