Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problemindebug #3195

Open
akbzam opened this issue May 15, 2024 · 1 comment
Open

problemindebug #3195

akbzam opened this issue May 15, 2024 · 1 comment
Labels
Milestone

Comments

@akbzam
Copy link

akbzam commented May 15, 2024

#test.py
def gen():
    for i in range(3):
        print("before yeild")
        yield i*i
        print("after yield ")
    return

my_gen=gen()
print(my_gen.__next__())
print(my_gen.__next__())
print(my_gen.__next__())
#print(my_gen.__next__())


my_gen=gen()
for i in gen():
    print(i)
    
def my_range(stop):
    number = 0
    while number < stop:
        yield number
        number = number + 1
    return


for number in my_range(10):
    print(number)
        
        
def count(n):
    print("%d"%n)
    while n>0:
        yield n
        n-=1
    return
co= count(10)                   #line38
co.__next__()
co.__next__()
co.__next__()
co.close()
#co.__next__()


print('-'*30)
g1=count(10)
print(list(g1))


in debugging the above code,i set a breakpoint in line 38 and then after ctrl+F5, i pressed F6 key four times.
the debugger finished the debugging process and neglected other lines(that is the last three lines)and jumped of them
and finished debugging.
why that is occured?

@aivarannamaa
Copy link
Member

Thanks! I'll try to reproduce and fix this later.

@aivarannamaa aivarannamaa added this to the 5.0.x milestone May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants