Python Forum
Type Error: 'in' object is not callable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Type Error: 'in' object is not callable
#2
All of your method names apart from __init__, when called assign the method name to an attribute value.
Example
class stats:
    
    def mode(self): # method name is mode
        self.mode = s.mode(self.value) # mode is now assigned as an attribute value
        return(self.mode)
        ...
        ...
When mode is called the first time it works, but when it is called a second time it doesn't because it is now an int that can't be called.
Reply


Messages In This Thread
Type Error: 'in' object is not callable - by nman52 - May-01-2021, 03:41 AM
RE: Type Error: 'in' object is not callable - by Yoriz - May-01-2021, 08:00 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  error in class: TypeError: 'str' object is not callable akbarza 2 559 Dec-30-2023, 04:35 PM
Last Post: deanhystad
  TypeError: 'NoneType' object is not callable akbarza 4 1,076 Aug-24-2023, 05:14 PM
Last Post: snippsat
  [NEW CODER] TypeError: Object is not callable iwantyoursec 5 1,435 Aug-23-2023, 06:21 PM
Last Post: deanhystad
  Wrong type error rowan_bradley 6 1,293 Aug-07-2023, 10:44 AM
Last Post: rowan_bradley
  Need help with 'str' object is not callable error. Fare 4 874 Jul-23-2023, 02:25 PM
Last Post: Fare
  Type Error: Unsupported Operand jhancock 2 1,261 Jul-22-2023, 11:33 PM
Last Post: jhancock
  TypeError: 'float' object is not callable #1 isdito2001 1 1,106 Jan-21-2023, 12:43 AM
Last Post: Yoriz
  'SSHClient' object is not callable 3lnyn0 1 1,196 Dec-15-2022, 03:40 AM
Last Post: deanhystad
  declaring object parameters with type JonWayn 2 920 Dec-13-2022, 07:46 PM
Last Post: JonWayn
  TypeError: 'float' object is not callable TimofeyKolpakov 3 1,498 Dec-04-2022, 04:58 PM
Last Post: TimofeyKolpakov

Forum Jump:

User Panel Messages

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