Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'arguments': 0.05; 'snippet': 0.07; 'though.': 0.07; 'positional': 0.09; 'sun,': 0.09; 'pm,': 0.11; 'wrote:': 0.14; 'defined': 0.15; 'subject:() ': 0.16; 'two?': 0.16; 'variable.': 0.16; '\xa0def': 0.16; 'argument': 0.16; 'stack': 0.16; 'code.': 0.18; 'stuff': 0.18; 'trace': 0.19; 'header:In-Reply-To:1': 0.22; 'posted': 0.22; 'correct,': 0.23; 'received:209.85.161.46': 0.26; 'received:mail- fx0-f46.google.com': 0.26; 'message-id:@mail.gmail.com': 0.28; 'looks': 0.28; 'received:209.85.161': 0.29; 'error': 0.29; 'class': 0.29; 'forgot': 0.29; 'receives': 0.29; 'helpful.': 0.31; 'typeerror:': 0.31; 'does': 0.31; 'actual': 0.31; 'to:addr:python- list': 0.32; 'usually': 0.36; 'think': 0.36; 'two': 0.37; 'received:209.85': 0.37; 'exactly': 0.37; 'received:google.com': 0.38; 'but': 0.38; 'help': 0.39; 'to:addr:python.org': 0.39; 'subject: (': 0.39; 'received:209': 0.39; 'takes': 0.40; 'include': 0.40; 'header:Received:5': 0.40; 'might': 0.40; '2011': 0.62; 'full': 0.62; 'signature.': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type:content-transfer-encoding; bh=ftUd5gTKNuPZnNSjZ1uE6j4hhRBsE3j67jXqwyBSdjY=; b=T2PauWh/waZVGb9cWqN12NLpVFYV0dD8NWYc6UwBGrZybj51SIodr6ZC378zoqAZLQ M2/R9K5St6fnFYV8dz3czQ75NmEonds2l7MtxtKgig1PVdrEtLFaGhOPPIuviqH6RsMM HT2YYGYK0Faanyx5BqazxHqlJ40r/TVVgbL+A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=Y1Kd5VRW4O+OEzIILDiGAnlKLVsO89E/Wbjv9IC4Rt69Uh+iZeaW0dH2XbOuWeCQPz X5LzaOccJTtdR2jiB7zVbrW6HSy9Tu6oF1chPVV6jAbG0tGDqiAvEAyJi9gtI5/SAo1V TyW1IG5qvt9MF7oxVcmteRvJjnTutHCsxwPes= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Sun, 15 May 2011 22:12:47 -0600 Subject: Re: TypeError: __init__() takes exactly 1 positional argument (2 given) To: Python Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305519199 news.xs4all.nl 81475 [::ffff:82.94.164.166]:55733 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5477 On Sun, May 15, 2011 at 9:53 PM, Gnarlodious wrote: > class GnomonBase(object): > =A0 =A0def __init__(self, bench): > =A0 =A0 =A0 =A0# 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? Usually this error means that you forgot to include "self" in the method signature. As a result it receives two arguments (self and bench) but only has one defined (bench). The snippet you posted looks correct, though. It might be easier to help if you posted the actual code. Also the full stack trace might be helpful.