Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 666699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T23:50:49+00:00 2026-05-13T23:50:49+00:00

For some reason I am having trouble getting my head around __init__ and __new__

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T23:50:50+00:00Added an answer on May 13, 2026 at 11:50 pm

    Simplest way to reproduce your problem:

    >>> class Bah(object): pass
    ... 
    >>> x = Bah(23)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
    TypeError: default __new__ takes no parameters
    

    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 module traceback from the standard library).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble working with Time.now. For some reason when I save an object
So, I'm having trouble with some php OO stuff. I think the code will
I've got an admin section setup, but am having trouble getting the update route
I'm having trouble changing the image in a DataGridViewImageCell on mouseover. According to a
i ave been having trouble with a simple select sql query. using php PDO.
I'm having trouble figuring out this issue I'm having with cookies and asp.net applications.
Trying to get Rails up on ubuntu, and I’m having trouble installing sqlite3-ruby –
I've created a custom VS template which uses an IWizard class to do some
I am trying to change an <iframe src=... > when someone clicks a radio
How do I turn off the tips temporarily? I see the ability referenced on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.