Python Forum
Why am I getting this TypeError?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why am I getting this TypeError?
#5
This example runs with no error.
class Queue:
    def __init__(self, name: str, sim):
        pass

new_queue = Queue("New", True)
The error message says that Queue is defined like this:
class Queue:
    def __init__(self, name=""):
I think Queue is not what you think it us. Is Queue a class you wrote, or is it imported?
Reply


Messages In This Thread
Why am I getting this TypeError? - by pitosalas - Oct-14-2023, 12:22 PM
RE: Why am I getting this TypeError? - by menator01 - Oct-14-2023, 12:28 PM
RE: Why am I getting this TypeError? - by pitosalas - Oct-14-2023, 01:46 PM
RE: Why am I getting this TypeError? - by menator01 - Oct-14-2023, 02:49 PM
RE: Why am I getting this TypeError? - by deanhystad - Oct-14-2023, 04:00 PM
RE: Why am I getting this TypeError? - by DeaD_EyE - Oct-15-2023, 01:00 PM

Forum Jump:

User Panel Messages

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