There is no Python factor Error TypeError: Queue() takes no arguments

Asked 2 weeks ago, Updated 2 weeks ago, 1 views

strong text

TypeError: Queue() takes no arguments Queue() keeps saying that there is no factor, but isn't maxsize=10 in ()?

python

2022-09-20 10:47

1 Answers

TypeError: Queue() takes no arguments

Queue() means that you receive a factor that does not exist, that is, you do not accept a factor.

class Queue:
    maxsize = None

    def __init__(self, maxsize):
        self.items = maxsize

queue = Queue(maxsize = 10)
print(queue.items) # 10 Output

I think the indentation is wrong.


2022-09-20 10:47

If you have any answers or tips


© 2022 pinfo. All rights reserved.