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 6150961
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:41:56+00:00 2026-05-23T19:41:56+00:00

class MM(dict): def __init__(self, indexed, *args, **kwargs): super(MM, self).__init__(*args, **kwargs) #must do it. self[‘name’]

  • 0
class MM(dict):
    def __init__(self, indexed, *args, **kwargs):
        super(MM, self).__init__(*args, **kwargs) #must do it.
        self['name'] = 'hello, this is a value'
        self.go()

    def go(self, kwargs):
        print kwargs #I want this to print out the kwargs

How come this class creates an error when I try to initalize it?

>> m = MM()

TypeError: metaMod_Distance() takes exactly 2 arguments (1 given)
  • 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-23T19:41:57+00:00Added an answer on May 23, 2026 at 7:41 pm

    You probably want to do:

    def go(self, **kwargs):
        print kwargs
    

    To take keyword only arguments. So the function call will work.

    Also you have to pass something else to your constructor (because of unused argument indexed):

    m = MM(1) #or whatever
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

class Meta(dict): def __init__(self, indexed, method, *args, **kwargs): super(Meta, self).__init__(*args, **kwargs) print self How
class attrdict(dict): def __init__(self, *args, **kwargs): dict.__init__(self, *args, **kwargs) self.__dict__ = self a =
This is not the result I expect to see: class A(dict): def __init__(self, *args,
class MyDict(dict): def __init__(self, *args): #fill in here How do I write the constructor
I currently have a class called Polynomial, The initialization looks like this: def __init__(self,
I have a polynomial class: class Polynomial: def __init__(self, *termpairs): self.termdict = dict(termpairs) To
Given the following module: class Dummy(dict): def __init__(self, data): for key, value in data.iteritems():
def makecounter(): return collections.defaultdict(int) class RankedIndex(object): def __init__(self): self._inverted_index = collections.defaultdict(list) self._documents = []
I have the following code. class person(object): def __init__(self, keys): for item in keys:
I have a class like the following: class User: def __init__(self): self.data = []

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.