Class declaration fails and complains about number of arguments

by Mikko Ohtamaa last modified Dec 30, 2008 03:08 PM
For example: class Record(BaseBTreeFolder): TypeError: function takes at most 2 arguments (3 given)

During the development of your Plone/Zope Python code you have encountered a mysterious error. For some reason, subclassing complains about number of arguments.

You have imported a module instead of a class

E.g.

from Products.PloneLocalFolderNG import PloneLocalFolderNG 
# imports PloneLocalFolderNG.py module

Correct is

from Products.PloneLocalFolderNG.PloneLocalFolderNG import PloneLocalFolderNG 
# imports PloneLocalFolderNG class from PloneLocalFolderNG.py module