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

  • SEARCH
  • Home
  • 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 6582745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:19:10+00:00 2026-05-25T16:19:10+00:00

super has 2 args, super(type, obj_of_type-or-subclass_of_type) I understand how and why to use super

  • 0

super has 2 args,

super(type, obj_of_type-or-subclass_of_type)

I understand how and why to use super with the 2nd arg being obj_of_type.
But I don’t understand the matter for the 2nd arg being subclass.

Anyone can show why and how?

  • 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-25T16:19:10+00:00Added an answer on May 25, 2026 at 4:19 pm

    You pass an object if you want to invoke an instance method. You pass a class if you want to invoke a class method.

    The classic example for using super() for class methods is with factory methods, where you want all the superclass factory methods to be called.

    class Base(object):
        @classmethod
        def make(cls, *args, **kwargs):
            print("Base.make(%s, %s) start" % (args, kwargs))
            print("Base.make end")
    
    class Foo(Base):
        @classmethod
        def make(cls, *args, **kwargs):
            print("Foo.make(%s, %s) start" % (args, kwargs))
            super(Foo, cls).make(*args, **kwargs)
            print("Foo.make end")
    
    class Bar(Base):
        @classmethod
        def make(cls, *args, **kwargs):
            print("Bar.make(%s, %s) start" % (args, kwargs))
            super(Bar, cls).make(*args, **kwargs)
            print("Bar.make end")
    
    class FooBar(Foo,Bar):
        @classmethod
        def make(cls, *args, **kwargs):
            print("FooBar.make(%s, %s) start" % (args, kwargs))
            super(FooBar, cls).make(*args, **kwargs)
            print("FooBar.make end")
    
    fb = FooBar.make(1, 2, c=3)
    

    “Invoking a superclass’s class methods in Python” has a real-world example.

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

Sidebar

Related Questions

A bug has been filed and fixed (super quickly) in SWT: https://bugs.eclipse.org/bugs/show_bug.cgi?id=305294 Just to
Ok, this has got to be a super simple problem. I just can't seem
I'm trying to overwrite a __init__ method, but when I call the super method
I realize this has been asked before, but I wasn't able to find a
I feel my problem is quite obvious and has trivial solution, but I can't
I have a custom TagField form field. class TagField(forms.CharField): def __init__(self, *args, **kwargs): super(TagField,
Assuming the following Model: class Model < ActiveRecord::Base def initialize(*args) super self.du = 1000
Super-newbie question! I've been looking for a list of all the classes that come
pre tags are super-useful for code blocks in HTML and for debugging output while
When using Python's super() to do method chaining, you have to explicitly specify your

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.