Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5476

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

References <fb474512-8d88-424b-b7ef-01e20d04478e@h36g2000pro.googlegroups.com>
Date 2011-05-15 21:10 -0700
Subject Re: TypeError: __init__() takes exactly 1 positional argument (2 given)
From Chris Rebert <clp2@rebertia.com>
Newsgroups comp.lang.python
Message-ID <mailman.1617.1305519015.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Sun, May 15, 2011 at 8:53 PM, Gnarlodious <gnarlodious@gmail.com> wrote:
> Can someone please explain what I am doing wrong?
>
> Calling script:
>
> from Gnomon import GnomonBase
> Gnomon=GnomonBase(3)
>
>
> Called script:
>
> class GnomonBase(object):
>    def __init__(self, bench):
>        # do stuff
>
> But all I get is:
> TypeError: __init__() takes exactly 1 positional argument (2 given)
>
> I don't understand, I am only sending one variable. What does it think
> I am sending two?

Please post the *full* exception Traceback.

Cheers,
Chris

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

TypeError: __init__() takes exactly 1 positional argument (2 given) Gnarlodious <gnarlodious@gmail.com> - 2011-05-15 20:53 -0700
  Re: TypeError: __init__() takes exactly 1 positional argument (2 given) harrismh777 <harrismh777@charter.net> - 2011-05-15 22:59 -0500
  Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Chris Rebert <clp2@rebertia.com> - 2011-05-15 21:10 -0700
  Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-15 22:12 -0600
    Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Gnarlodious <gnarlodious@gmail.com> - 2011-05-15 21:30 -0700
      Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Chris Rebert <clp2@rebertia.com> - 2011-05-15 21:44 -0700
        Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Gnarlodious <gnarlodious@gmail.com> - 2011-05-15 21:53 -0700
      Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Ian Kelly <ian.g.kelly@gmail.com> - 2011-05-15 22:54 -0600
        Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Gnarlodious <gnarlodious@gmail.com> - 2011-05-15 22:08 -0700
  Re: TypeError: __init__() takes exactly 1 positional argument (2 given) Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2011-05-16 04:31 +0000

csiph-web