The Python documentation on pickle clearly states that the function code isnt saved while pickling. Dont ask me why i didnt look there before posting to this group coz I feel extremely stupid already ;-) sincere apologies.