For context, i have a class that is instantiated after json.loads is called. I started to get some strange results, so I added print statements inside the init to find out that it was getting called twice. Once by intention and once without intention. When i removed it from the code, it worked (albeit parsing errors followed)
In order to test this, I added a default argument for the class ‘called=true/false’ to test if I called it or not. i only have one instance of this class in my app, and purposely set it to ‘called=true’. with json.loads getting called before the class, it would get called once and work exactly as expected (parsing everything else) and then, for some strange reason, run once more with called=false (indicating that it ran without me calling it, weird).
When commenting out the json.loads that gets called before the class, the error goes away. the only thing i see is the ‘called=true’. This tells me without a doubt that json.loads is having a problem, forcing some rerun code or something. For me, that is unexpected behavior.
Could anyone explain this to me?