[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Maks Bleo


Change by Maks Bleo :


--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 
<https://bugs.python.org/issue40310>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Maks Bleo

Maks Bleo  added the comment:

I don't think that it will overwrite element from for loop. In my mind it
was a bug.

Thank you.

On Fri, Apr 17, 2020, 1:59 PM Rémi Lapeyre  wrote:

>
> Rémi Lapeyre  added the comment:
>
> Hi Maks, when you report a bug please write a minimal example that show
> the bug so we don't have to read the whole application (
> https://stackoverflow.com/help/minimal-reproducible-example).
>
> I think in this case that the issue is that you overrride model on line 65
> `model = car[1]` hence the error on the next iteration, model has been
> replaced.
>
> This bug tracker is for bugs in the Python interpreter, for help in using
> Python please use the python-help mailing list or a forum like
> StackOverflow.
>
> --
> nosy: +remi.lapeyre
>
> ___
> Python tracker 
> <https://bugs.python.org/issue40310>
> ___
>

--

___
Python tracker 
<https://bugs.python.org/issue40310>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue40310] If use element from for in while loop it will have bad iterate.

2020-04-17 Thread Maks Bleo


New submission from Maks Bleo :

Windows 10
Version 1909 (OS Build18363.778)
Python 3.7.7 x64

cars_av_by_spider_scr.py - py file for scrapy.
bash command to use
scrapy runspider cars_av_by_spider_scr.py -o cars_av_by_spider_scr.json > 
cars_av_by_spider_scr.txt 2>&1

Bad behavior in line 52. (In comment fixed version)

When while loop iterate on second step instead of using
model[0], model[1] it start use model[1][0] and model[1][1].
On third step it  crash, out of range.

But if assign value before while loop and use it in while loop everything work 
fine. 


It's my first bug report.

--
components: Interpreter Core
files: cars_av_by_spider_scr.py
messages: 366652
nosy: Maks Bleo
priority: normal
severity: normal
status: open
title: If use element from for in while loop it will have bad iterate.
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file49071/cars_av_by_spider_scr.py

___
Python tracker 
<https://bugs.python.org/issue40310>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com