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
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
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
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
[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
[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
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
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
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
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
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
11 matches
Mail list logo