- None is the return value of your function. Module is is the function which returned which in your case is the actual module.
- The first occurrence of
->def fun():
is where the function gets defined. The second one it got called. - I don't now why the signature of your module looks like this. It might be because you are debuging it and it's run inside pdb.
pdb - What does the output mean?
Question
test.py
:
def fun():
print 'Function'
if __name__ == '__main__':
fun()
$ python -m pdb test.py
:
> /home/h/CARDIO/WorkSpace/PDB/test.py(4)<module>()
-> def fun():
(Pdb) n
> /home/h/CARDIO/WorkSpace/PDB/test.py(7)<module>()
-> if __name__ == '__main__':
(Pdb) n
> /home/h/CARDIO/WorkSpace/PDB/test.py(8)<module>()
-> fun()
(Pdb) n
Function
--Return--
> /home/h/CARDIO/WorkSpace/PDB/test.py(8)<module>()->None
-> fun()
(Pdb) n
--Return--
> <string>(1)<module>()->None
(Pdb) n
The program finished and will be restarted
- What does the
<module>
and->None
refer to ? - It seems
fun()
took twon
to finish.fun()
is a single statement, shouldn'tn
step one statement at a time ? Why doesfun()
take twon
? - I really don't know the meaning of
--Return-- > <string>(1)<module>()->None
. Not a single word or sign.
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow