You can use the rename command to rename an existing proc:
rename N __orig_N proc N {arg1 arg2} { if { $arg1 != "GOOD_VALUE" } { puts stderr "arg1 is bad" exit 1 } return [uplevel 1 __orig_N $arg1 $arg2] }
This is actually a bit more complicated than the original python, since using uplevel effectively completely eliminates the shell from the call stack, which may not be necessary in your case, but it is nice to be able to do this.
source share