For some reason I am having trouble getting my head around __init__ and __new__. I have a bunch of code that runs fine from the terminal, but when I load it as a plugin for Google Quick Search Box, I get the error TypeError: default __new__ takes no parameters.
I have been reading about the error, and it’s kind of making my brain spin. As it stands I have 3 classes, with no sub-classes, each class has it’s own defs. I never use def __init__ or def __new__, but I have gotten the distinct feeling that these are the functions (or the lack thereof) that would be giving me the error.
I have no idea how to summarize the code down to a snippet that would be helpful here, since I’m a bit over my head, but the entire script can be found at github. Not expecting anyone to bugfix my code for me, I am just at my wit’s end on this. A simple (plain english, not the quote from the python docs which I have read 20 times and still don’t really understand) explination of why this error would pop up, or why I should be, or not be, using the __init__ and/or __new__ functions would be seriously appreciated.
Simplest way to reproduce your problem:
So it looks like there’s a class in your code (not when run from the terminal, but then you do very different imports then) that has no
__init__defined, and you’re somewhere calling the class with some parameters. In the error traceback you should get the location where the call happens (if not, e.g. due to GUI subtleties, you can use a try/except around everything and make sure you dump the traceback to a /tmp file in the except clause, use moduletracebackfrom the standard library).