This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Python 3.6.3: JSON loop fails using elif
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Francesco Mantovani, eric.smith, steven.daprano
Priority: normal Keywords:

Created on 2017-10-16 10:14 by Francesco Mantovani, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Test_log_bug.py Francesco Mantovani, 2017-10-16 10:14 Google API test script
Messages (4)
msg304465 - (view) Author: Francesco Mantovani (Francesco Mantovani) Date: 2017-10-16 10:14
I attach here a file with 3 different way to parse Google Places API.

Please put your Google API key token into the variable [PutHereYourGoogleAPIKey] to make the script work.

The script contains 3 loops:
- the first loop works and that's how I fixed the problem 
- the second loop fail because of the `elif`
- the third loop works because all `elif` were removed
msg304469 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) Date: 2017-10-16 12:30
Hi, Francesco.

This isn't the appropriate place to ask for help with your script.

I suggest trying the python-list mailing list.
msg304470 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2017-10-16 12:33
What are you claiming is the bug? I don't understand what you think the problem is.

Don't dump a large script in our laps and expect us to get a Google API key to run it. Forget that, it isn't going to happen. Simplify your code to make the smallest, simplest demonstration you can.

Please read: http://sscce.org/

Then tell us:

- what you expect to happen
- what actually happens
- show any output you get
- including any exception.


To start with, there's no need to query five fields, if one field is enough. Make your code as simple as you can. Don't leave "dead code" commented out, delete it.
msg304471 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2017-10-16 12:35
Oops, accidentally messed up the status. Fixing now.

Francesco, if you simplify your code and come back with a detailed description of what you think the bug is, then we will investigate.
History
Date User Action Args
2022-04-11 14:58:53adminsetgithub: 75978
2017-10-16 12:35:50steven.dapranosetstatus: open -> closed

nosy: + eric.smith
messages: + msg304471

resolution: not a bug
stage: resolved
2017-10-16 12:33:03steven.dapranosetstatus: closed -> open
nosy: + steven.daprano, - eric.smith
messages: + msg304470

resolution: not a bug -> (no value)
stage: resolved -> (no value)
2017-10-16 12:30:43eric.smithsetstatus: open -> closed

nosy: + eric.smith
messages: + msg304469

resolution: not a bug
stage: resolved
2017-10-16 10:14:43Francesco Mantovanicreate