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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:19:27+00:00 2026-06-17T07:19:27+00:00

This should be easy, but for I am missing something. I have an object

  • 0

This should be easy, but for I am missing something.

I have an object that works exactly as I expect.

class TextElement(ContentItemElement):
    '''
    Single String Elements, for example, headlines
    '''
    def __init__(self, name, data):
       super(TextElement, self).__init__()
       self.name=name
       self.text=data


    def prettyPrint(self):
        printstring =  u'*HTML* '
        self.name.encode('utf-8')
        printstring += u'<h3> '+self.name+u' </h3>'
        self.text.encode('utf-8')
        printstring += u'<p> '+self.text+u' </h3>'
        print printstring 

Ok, great, I can instantiate that, and it does exactly what I want it to. But I really would like to create a more specific version of TextObjects. so I do this:

class CiteElement(TextElement):
    '''
    Single String Elements, for example, headlines
    '''
    def __init__(self, name, data):
        super(CiteElement, self).__init__()
        self.validValues=['Crap I make up', 'Crap I found on the web']

but when I try to instantiate it, this works:

ee = TextElement(element, self.raw[element])
ee.validValues=['Crap I make up', 'Crap I found on the web']

but this Does not

ee = CiteElement(element, self.raw[element])

Instead giving me this error:

TypeError: __init__() takes exactly 3 arguments (1 given)

Obviously I am missing something small. Something key to python objects. Something I should darn well know, but have been coding around for years. But what is it?

  • 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-06-17T07:19:28+00:00Added an answer on June 17, 2026 at 7:19 am

    Because the constructor of your base class is defined as

    def __init__(self, name, data):
    ....
    

    And you are calling it without parameters from your derived class.

    def __init__(self, name, data):
        super(CiteElement, self).__init__()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Feel like this should be something easy that I'm missing. I have a table
This should be easy, but I am missing something. I have the following form:
OK, I'm feeling like this should be easy but am obviously missing something fundamental
Seems like this should be easy but I must just be missing something... I
This seemed like it should be easy, but I have had trouble getting it
This seems like it should be an easy answer, but I have searched everywhere
I am sure this should be easy, perhaps I am missing something obvious. I
This seems like it should be easy yet I must be missing something. I
This should be an extremely easy fix, but for some reason I am missing
It seems this should be easy but I'm having a lot of difficulty using

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.