Renaming or Overloading In Python

gamename namesagame-usenet at yahoo.com
Sun Mar 18 15:17:52 EDT 2007


Hi,

I'm a recent convert from TCL.  One of the more powerful aspects of
TCL is the ability to rename a function at will (generally for testing
purposes).

Example from the tcl doc:

rename ::source ::theRealSource
set sourceCount 0
proc ::source args {
    global sourceCount
    puts "called source for the [incr sourceCount]'th time"
    uplevel 1 ::theRealSource $args
}

So, is such a thing possible in Python?

Thanks,
-T




More information about the Python-list mailing list