Python Forum
[PyGame] TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod'
Thread Rating:
  • 2 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[PyGame] TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod'
#2
In line 38 you define the attribute sneek_width without any effect, because it's not bound to the instance nor to the class. In line 44 you define a method sneek_width of the class snek. Later you try to divide an integer with an instance method. You've forgotten to call the instance method.

But from where comes get_width? It looks for me like brute force programing with copied and pasted code.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


Messages In This Thread
RE: TypeError: unsupported operand type(s) for -: 'int' and 'instancemethod' - by DeaD_EyE - Oct-05-2017, 05:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyGame] PLEASE HELP! TypeError: unsupported operand type(s) for +: 'pygame.Surface' and 'int' keyfive 1 5,354 Jun-19-2018, 01:20 PM
Last Post: volcano63

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020