Returning from a multiple stacked call at once

2020-12-11 Thread ast
Hello In case a function recursively calls itself many times, is there a way to return a data immediately without unstacking all functions ? -- https://mail.python.org/mailman/listinfo/python-list

Re: Function returns old value

2020-12-11 Thread Terry Reedy
On 12/11/2020 8:25 PM, Bischoop wrote: I've function asking question and comparing it, if is not matching 'yes' it does call itself to ask question again. The problem is that when function is called second time it returns old value or with additional else statement it returns none. Code: https:

Re: Letter replacer - suggestions?

2020-12-11 Thread Bischoop
On 2020-12-07, Grant Edwards wrote: > On 2020-12-07, MRAB wrote: > >> Avoid a 'bare' except unless you _really_ mean it, which is >> virtually never. Catch only those exceptions that you're going to >> handle. > > And sometimes "handling" is just printing some extra stuff and then > re-raising th

Re: Function returns old value

2020-12-11 Thread Chris Angelico
On Sat, Dec 12, 2020 at 1:39 PM dn via Python-list wrote: > > On 12/12/2020 15:25, Chris Angelico wrote: > > On Sat, Dec 12, 2020 at 1:23 PM dn via Python-list > > wrote: > >> > >> Speaking personally, I prefer the code to be included in the email. > >> However, it would be better to use spaces r

Re: Function returns old value

2020-12-11 Thread dn via Python-list
On 12/12/2020 15:25, Chris Angelico wrote: On Sat, Dec 12, 2020 at 1:23 PM dn via Python-list wrote: Speaking personally, I prefer the code to be included in the email. However, it would be better to use spaces rather than tabs (Python's preferred style, per PEP-8) because many email packages

Re: Function returns old value

2020-12-11 Thread Chris Angelico
On Sat, Dec 12, 2020 at 1:23 PM dn via Python-list wrote: > > Speaking personally, I prefer the code to be included in the email. > However, it would be better to use spaces rather than tabs (Python's > preferred style, per PEP-8) because many email packages implement > tab-stops as eight-spaces a

Re: Function returns old value

2020-12-11 Thread dn via Python-list
On 12/12/2020 15:09, Bischoop wrote: On 2020-12-12, dn wrote: On 12/12/2020 14:25, Bischoop wrote: I've function asking question and comparing it, if is not matching 'yes' it does call itself to ask question again. The problem is that when function is called second time it returns old value

Re: Function returns old value

2020-12-11 Thread Bischoop
On 2020-12-12, Joe Pfeiffer wrote: > Bischoop writes: > >> I've function asking question and comparing it, if is not matching 'yes' >> it does call itself to ask question again. The problem is that when >> function is called second time it returns old value or with additional >> else statement it

Re: Function returns old value

2020-12-11 Thread Paul Bryan
Sorry, actually, if you do not answer yes, will always return None, not the first answer as I suggested. On Fri, 2020-12-11 at 18:55 -0700, Joe Pfeiffer wrote: > Bischoop writes: > > > I've function asking question and comparing it, if is not matching > > 'yes' > > it does call itself to ask que

Re: Function returns old value

2020-12-11 Thread Bischoop
On 2020-12-12, dn wrote: > On 12/12/2020 14:25, Bischoop wrote: >> >> >> >> I've function asking question and comparing it, if is not matching 'yes' >> it does call itself to ask question again. The problem is that when >> function is called second time it returns old value or with additional >

Re: Function returns old value

2020-12-11 Thread Paul Bryan
It won't return until the inner call to question (and it's not using the return value on inner call). Eventually, (and not until you answer yes) it will return the first answer. On Fri, 2020-12-11 at 18:55 -0700, Joe Pfeiffer wrote: > Bischoop writes: > > > I've function asking question and comp

Re: Letter replacer - suggestions?

2020-12-11 Thread Bischoop
On 2020-12-07, Marco Sulla wrote: > Not sure why you want to do this (it's schoolwork)? >Anyway, this is my version: > Thanks, seems nicer I think not to mention those exceptions. So far I'm just learning and doing everythin only for myself so do not think on others users but I know it's good

Re: Function returns old value

2020-12-11 Thread Joe Pfeiffer
Bischoop writes: > I've function asking question and comparing it, if is not matching 'yes' > it does call itself to ask question again. The problem is that when > function is called second time it returns old value or with additional > else statement it returns none. > > Code: https://bpa.st/KVG

Re: Letter replacer - suggestions?

2020-12-11 Thread Bischoop
On 2020-12-07, MRAB wrote: > > word = input( f'input word you want to change letters in: ') Yes, I've learn already that should use only when want to use variables I just started using this new f' string method. > > There's no need for the f prefix. > > > print(f' Your word to change: ,{word}')

Re: Function returns old value

2020-12-11 Thread dn via Python-list
On 12/12/2020 14:25, Bischoop wrote: I've function asking question and comparing it, if is not matching 'yes' it does call itself to ask question again. The problem is that when function is called second time it returns old value or with additional else statement it returns none. Code: https:

Function returns old value

2020-12-11 Thread Bischoop
I've function asking question and comparing it, if is not matching 'yes' it does call itself to ask question again. The problem is that when function is called second time it returns old value or with additional else statement it returns none. Code: https://bpa.st/KVGA How this functions shou

Planet Python

2020-12-11 Thread dn via Python-list
Has something happened to the Planet Python feed? - Last update: December 07, 2020 04:48 PM UTC -- Regards, =dn -- https://mail.python.org/mailman/listinfo/python-list