UserLinux chooses Python as "interpretive language" of choice

Jarek Zgoda jzgoda at gazeta.usun.pl
Sun Dec 21 02:16:33 EST 2003


Jp Calderone <exarkun at intarweb.us> pisze:

>> > Unless you design some silly rules to determine when empty parenthesis
>> > should be allowed - did a get assigned the return value of sys.exit()?
>> >  (yes I know it doesn't have one)
>> 
>> It has. The returned value is None.
> 
>   A function must return to have a return value.  When does sys.exit()
> return?

Something, that is of type NoneType.

#v+
>>> def f():
...     print 'function'
... 
>>> type(f)
<type 'function'>
>>> a = f()
function
>>> a
>>> type(a)
<type 'NoneType'>
>>> a__str__()
'None'
#v-

Anyway, isn't that function always returns value, even without explicit
"return" statement?

-- 
Jarek Zgoda
Unregistered Linux User # -1
http://www.zgoda.biz/ JID:zgoda at chrome.pl http://zgoda.jogger.pl/




More information about the Python-list mailing list