Jignesh Sutar <jsu...@gmail.com> Wrote in message:
>
> 
 Hi I'm trying to exclude a certain line of code if the function is called by 
another function, see illustration below:

Your code example is all confused, so perhaps you are as well. 

Why should any of your code in function A care who calls it? The
 main point about making functions is to reuse code without caring
 who is calling it. If the function is going to have variable
 behavior,  control that by passing parameters.

Or perhaps this is testing code or debugging code.  In that case, 
 look at docs.python.org/2/library/inspect.org and look at
 function inspect.getouterframes ()

Can you give a nontrivial use example,  and without using recursion? 


-- 
DaveA

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to