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!
From the very page you linked:
So:
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
objectthey create problems.