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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T15:35:01+00:00 2026-06-02T15:35:01+00:00

I am using python language for Squish Automation Tool. This tool extends python with

  • 0

I am using python language for Squish Automation Tool. This tool extends python with some custom objects and functions. This is what they say in the manual:

Squish’s Python-specific extension modules are loaded automatically by
internally executing the equivalent of the following statements:

Python
import test
import testData
import object
import objectMap
import squishinfo
from squish import *

This means that it is not necessary to import them yourself unless you
are developing your own standalone module.

By doing so they redefine object automatically (to this), so my attempts to do the New-Style Classes (like class NewClass(object): ) throw me an error:

TypeError: Error when calling the metaclass bases. module.__init__()
takes at most 2 arguments (3 given)

So I’m trying to get the object back.
After reading the amazing article about metaclasses I’m trying to get the object with the following code:

class OrigObject:
    __metaclass__ = type

class NewClass(OrigObject):
    pass

My question is: is that the same as inheriting from the original object class?

UPDATE: I’m limited to use the Python 2.4 (if that matters)

Thanks!

  • 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-02T15:35:05+00:00Added an answer on June 2, 2026 at 3:35 pm

    From the very page you linked:

    Squish’s object module has the same name as the base class of all Python 2 new-style classes, and of all Python 3 classes. In practice this is very rarely a problem. For Python 2 we can just create old-style classes or do import __builtin__ and inherit from __builtin__.object instead of object. For Python 3 there is no need to do anything since we don’t ever explicitly inherit object since it is inherited by default if no other class is specified.

    So:

    >>> import __builtin__
    >>> __builtin__.object
    <type 'object'>
    >>> class SomeOldStyleClass():
    ...    pass
    ... 
    >>> SomeOldStyleClass.__subclasses__()
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: class SomeOldStyleClass has no attribute '__subclasses__'
    >>> class SomeClass(__builtin__.object):
    ...    pass
    ... 
    >>> SomeClass.__subclasses__()
    []
    

    Although, I would note that I think this is an incredibly poor decision on the part of the creators of said module, they should have called it something else. Even if it’s aimed at Python 3.x, if they are distributing it for 2.x, they should have thought for a moment, it would have done them no harm to call it something else, and by calling it object they create problems.

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

Sidebar

Related Questions

I am using Python as a script language to do some data processing and
Language: Python v2.6.2 OS: AIX 5.3 I'm using Python to restore some files from
I am using python programming language,I want to join to wav file one at
I have bumped into this concept using Python distutils2/packaging . I did google it,
I've been automating some tests against a web application using Python and COM. My
Remember, this is using python. Well, I was fiddling around with an app I
I'm using Python 2.7 and Pygame but any language answer will do. I'm trying
This is really a python language question, but its wrapped around a Google appengine
Im trying to write a script using python language(abc.py). I need to take few
So I'm using Python (though another language suggestion like C# or VB is fine

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.