classification
Title: Curious problem with my choice of variables
Type: behavior Stage: resolved
Components: Versions: Python 3.5
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: Phil Dream, matrixise, remi.lapeyre
Priority: normal Keywords:

Created on 2019-02-06 10:03 by Phil Dream, last changed 2019-02-06 10:15 by Phil Dream. This issue is now closed.

Files
File name Uploaded Description Edit
sirext.py Phil Dream, 2019-02-06 10:03
Messages (5)
msg334913 - (view) Author: Phil Dream (Phil Dream) Date: 2019-02-06 10:03
Firstable I am not a software expert just a hobby user so please be indulgent

I use a Raspberry Pi3B+ with raspbian lite and Python 3.5.3

In my script, I need 2 nested "while" loops so I chose two variables to incriment them 'i' and j. This script don't work and I made a certain time to understand (I did not think Python could play me a trick).

I needed to reset 'j' to go through the inner loop a few times and in fact I realized that when I initialized 'j', 'i' was also initialized !?!?

Very curious isn't it ?

I replaced 'i' by 'y' and no more problem, my script works very well.
msg334915 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2019-02-06 10:07
Hi @Phil Dream, you reuse i in your inner loop, in the for statement.

By the way, I suggest you look at range() to replace your while loop: https://docs.python.org/3/library/functions.html#func-range.


For your others questions, the mailing list are more appropriate than the bug tracker.

Have a nice day!
msg334916 - (view) Author: Stéphane Wirtel (matrixise) * (Python committer) Date: 2019-02-06 10:10
Hi Phil,

This bug tracker is more for the core-dev and the contributors of CPython.

I suggest to you to use the right mailing list for your issues.
or use #python-fr on freenode

Mailing list: https://mail.python.org/mailman/listinfo/python-list

I close this issue because it's not related to the internals of Python.
msg334917 - (view) Author: Phil Dream (Phil Dream) Date: 2019-02-06 10:13
OK, I am sorry I didn’t know
Best regards

De : Stéphane Wirtel
Envoyé le :mercredi 6 février 2019 11:10
À : philsdream@gmail.com
Objet :[issue35910] Curious problem with my choice of variables

Stéphane Wirtel <stephane@wirtel.be> added the comment:

Hi Phil,

This bug tracker is more for the core-dev and the contributors of CPython.

I suggest to you to use the right mailing list for your issues.
or use #python-fr on freenode

Mailing list: https://mail.python.org/mailman/listinfo/python-list

I close this issue because it's not related to the internals of Python.

----------
nosy: +matrixise
resolution:  -> wont fix
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue35910>
_______________________________________
msg334919 - (view) Author: Phil Dream (Phil Dream) Date: 2019-02-06 10:15
OK, I am sorry I didn’t know
Thanks for the advice
Best regards

De : Rémi Lapeyre
Envoyé le :mercredi 6 février 2019 11:07
À : philsdream@gmail.com
Objet :[issue35910] Curious problem with my choice of variables

Rémi Lapeyre <remi.lapeyre@henki.fr> added the comment:

Hi @Phil Dream, you reuse i in your inner loop, in the for statement.

By the way, I suggest you look at range() to replace your while loop: https://docs.python.org/3/library/functions.html#func-range.

For your others questions, the mailing list are more appropriate than the bug tracker.

Have a nice day!

----------
nosy: +remi.lapeyre

_______________________________________
Python tracker <report@bugs.python.org>
<https://bugs.python.org/issue35910>
_______________________________________
History
Date User Action Args
2019-02-06 10:15:02Phil Dreamsetmessages: + msg334919
2019-02-06 10:13:52Phil Dreamsetmessages: + msg334917
2019-02-06 10:10:19matrixisesetstatus: open -> closed

nosy: + matrixise
messages: + msg334916

resolution: wont fix
stage: resolved
2019-02-06 10:07:12remi.lapeyresetnosy: + remi.lapeyre
messages: + msg334915
2019-02-06 10:03:18Phil Dreamcreate