Attualmente sto usando NetBeans IDE con Jython 2.5.1Il debugger Python viene eseguito nei generatori?
Quando il debug il mio progetto passo dopo passo, non appena viene rilevato un iterazione su un generatore, il debugger va dritto fino alla fine del codice. L'output funziona correttamente, ma è impossibile eseguire il debug passo dopo volta che viene raggiunto il primo generatore.
Si tratta di un comportamento standard per il debug di Python in tutti gli IDE Python? Non è possibile eseguire il debug del codice "yield after yield" nello stesso modo in cui possiamo eseguire il debug di VBA per ogni elemento di un ciclo "for" (mi dispiace per la menzione di VBA :)?
Grazie.
EDIT
Senza il generatore
Codice:
def example(n):
i = 1
while i <= n:
yield i
i += 1
print "hello"
print "goodbye"
uscita:
hello
goodbye
Debugging:
[LOG]PythonDebugger : overall Starting
[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive debugging context aware Python Shell
[LOG]where you can enter python console commands while debugging
(...)
>>>[stdout:]hello
>>>[stdout:]goodbye
Debug session normal end
Con il generatore di
Codice:
def example(n):
i = 1
while i <= n:
yield i
i += 1
print "hello"
for n in example(3):
print n
print "goodbye"
uscita:
hello
1
2
3
goodbye
Debug:
[LOG]PythonDebugger : overall Starting
[LOG]PythonDebugger.taskStarted : I am Starting a new Debugging Session ...
[LOG]This window is an interactive debugging context aware Python Shell
[LOG]where you can enter python console commands while debugging
(...)
>>>[stdout:]hello
>>>None['GeneratorExit
deamon ended
']
Debug session normal end
Invia il tuo codice. Chiarirà la tua domanda. – Blender