TypeError: __init__() takes exactly 1 positional argument (2 given)

Ian Kelly ian.g.kelly at gmail.com
Mon May 16 00:54:03 EDT 2011


On Sun, May 15, 2011 at 10:30 PM, Gnarlodious <gnarlodious at gmail.com> wrote:
> I don't have a trace because I am using mod_wsgi under Apache. Maybe
> there is a way to debug using mod_wsgi but I haven't been able to
> figure out how.

http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

> My problem is that in order to run mod_wsgi I had to downgrade to
> Python 3.1.3 which may be causing the problem. This website was
> running fine in Py3.2.
>
> I did find an explanation that sounds like this is an intentional
> deprecation in Python:
> <http://stackoverflow.com/questions/625083/python-init-and-self-what-
> do-they-do>
> <http://svn.python.org/view?revision=54539&view=revision>

I don't think those are related.  If it were an intentional change in
Python from 2007, then you would be seeing the error in both versions.
 I don't see how the stackoverflow link has any bearing on the error
at all.

> It looks like we are now expected to initialize instance variables
> with a setter statement?

You mean like this?

x = Foo()
x.y = z

No, there is no such expectation.



More information about the Python-list mailing list