User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Python section within the Software Development category of DaniWeb, a massive community of 361,604 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,037 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Python advertiser:
Views: 143 | Replies: 1
Reply
Join Date: Apr 2008
Posts: 21
Reputation: FreezeBlink is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
FreezeBlink FreezeBlink is offline Offline
Newbie Poster

Extremely odd error.

  #1  
May 17th, 2008
cell.health -= fighters[0].compDmg(fighters[0],cell)
TypeError: compDmg() takes exactly 2 arguments (3 given)
Both fighters[0] and cell are object instances. How on earth does it see 3 arguments in this? I don't think wider context is needed, but just ask if it is.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 32
Reputation: solsteel is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 8
solsteel solsteel is offline Offline
Light Poster

Re: Extremely odd error.

  #2  
May 17th, 2008
obj.compDmg(), being a method of fighters[0], will automatically be passed the instance object. In effect, the method receives three arguments in your case. Try this:
  1. cell.health -= fighters[0].compDmg(cell)
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb Python Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the Python Forum

All times are GMT -4. The time now is 5:27 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC