Re: How return no return ?

2005-05-13 Thread Jeff Epler
At the interactive prompt, a result is printed when both these things are true: * The entered code is an expression, not any other kind of statement * The result of the expression is not 'None' If an expression occurs, information about it will be printed instead. So the interpreter won't

How return no return ?

2005-05-12 Thread Ximo
Hello, I want that the return sentence don't return anything, how can I do it?. If i do only return it returns None, and pass don't run too. Can anyone help me?, thanks. XIMO -- http://mail.python.org/mailman/listinfo/python-list

Re: How return no return ?

2005-05-12 Thread Joseph Garvin
Ximo wrote: Hello, I want that the return sentence don't return anything, how can I do it?. If i do only return it returns None, and pass don't run too. Can anyone help me?, thanks. XIMO Returning None is the same as returning nothing. What exactly are you trying to do? -- http

Re: How return no return ?

2005-05-12 Thread Tim Williams
Ximo [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello, I want that the return sentence don't return anything, how can I do it?. If i do only return it returns None, and pass don't run too. Can anyone help me?, thanks. XIMO Just don't use a return statement at all, or do

Re: How return no return ?

2005-05-12 Thread Ximo
[EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Ximo wrote: Hello, I want that the return sentence don't return anything, how can I do it?. If i do only return it returns None, and pass don't run too. Can anyone help me?, thanks. XIMO Returning None is the same as returning

Re: How return no return ?

2005-05-12 Thread François Pinard
[Ximo] I want that the return sentence don't return anything, how can I do it? `return' always return something (if we except the case of generators). Used without arguments, it returns None, as you discovered already. If a function falls through its end, None is implicitely returned

Re: How return no return ?

2005-05-12 Thread Corrado Gioannini
On Thu, May 12, 2005 at 04:42:34PM +0100, Tim Williams wrote: Just don't use a return statement at all, or do something like [function body] if not val = None: return val [end of function] i didn't understood that. if you don't return nothing explicitly the function returns None. (or

Re: How return no return ?

2005-05-12 Thread Ximo
I am doing my own interpreter with the Python languaje. Do you understand me? Fredrik Lundh [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Ximo wrote: I am doing a interpret of lines and it show me a prompt, and I want if I write a declaration as int a my progrtam return

Re: How return no return ?

2005-05-12 Thread Bill Mill
On 5/12/05, Ximo [EMAIL PROTECTED] wrote: I am doing my own interpreter with the Python languaje. Do you understand me? Well, to be frank, no. However, Frederik's point still stands; in the python langage, int a is syntactically invalid. If you're writing your own interpreter, it should still

Re: How return no return ?

2005-05-12 Thread Michael Spencer
Ximo wrote: I am doing my own interpreter with the Python languaje. Do you understand me? Fredrik Lundh [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Ximo wrote: I am doing a interpret of lines and it show me a prompt, and I want if I write a declaration as int a

Re: How return no return ?

2005-05-12 Thread kaerbuhez
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