def give_date(
sdate: date,
edate: date,
) -> Iterator[date]:
delta = edate - sdate
print("This is executing")
for i in range(delta.days + 1):
day = sdate + timedelta(days=i)
print("Today is", day)
yield day
in this case when i call this fun each time it returns one day then another like this, so still the for loop works continuously right, i think yes?
but when i came to see the code there,
def get_session():
with Session(engine) as session:
yield session
i found here is not any loop or iterator so how it send new session each time after one yield session has done, next time what happens, what iterator it get and return what session value?
