How "return" no return ?

kaerbuhez kaerbuhez at yahoo.fr
Thu May 12 17:01:47 EDT 2005


Ximo a écrit :
> I am doing my own interpreter with the Python languaje.
> 
> Do you understand me?
> 

I will do my best : I guess that you are about to write your own non 
python interpreter (I mean, it will interpret some language that is not 
Python) and your interpreter sadly writes "None" when there is none to 
write.
Is that correct ?
If yes, I suggest that you replace somewhere in your code:
print result
by
if result is not None: print result

I know that this is not the question but if it is right that your 
interpreter is not a python interpreter and that you build a console on 
top of it (I know many assumptions, ...), I would like to kindly suggest 
you to use something else that the Python prompt (">>>") - at least on 
this NG - I am afraid that _this_ didn't help anybody to understand what 
you meant.

If by pure coincidence, this helped you, it would unexpectingly enlight 
my day ... and please don't tell me that my english is perfect, I know 
it perfectly well.




More information about the Python-list mailing list