Skip to content

gh-107906 Remove unused maxsize argument from _init method of queue.Queue #107907

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/asyncio/queues.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def __init__(self, maxsize=0):
self._unfinished_tasks = 0
self._finished = locks.Event()
self._finished.set()
self._init(maxsize)
self._init()

# These three are overridable in subclasses.

def _init(self, maxsize):
def _init(self):
self._queue = collections.deque()

def _get(self):
Expand Down Expand Up @@ -221,7 +221,7 @@ class PriorityQueue(Queue):
Entries are typically tuples of the form: (priority number, data).
"""

def _init(self, maxsize):
def _init(self):
self._queue = []

def _put(self, item, heappush=heapq.heappush):
Expand All @@ -234,7 +234,7 @@ def _get(self, heappop=heapq.heappop):
class LifoQueue(Queue):
"""A subclass of Queue that retrieves most recently added entries first."""

def _init(self, maxsize):
def _init(self):
self._queue = []

def _put(self, item):
Expand Down
8 changes: 4 additions & 4 deletions Lib/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Queue:

def __init__(self, maxsize=0):
self.maxsize = maxsize
self._init(maxsize)
self._init()

# mutex must be held whenever the queue is mutating. All methods
# that acquire mutex must release it before returning. mutex
Expand Down Expand Up @@ -203,7 +203,7 @@ def get_nowait(self):
# These will only be called with appropriate locks held

# Initialize the queue representation
def _init(self, maxsize):
def _init(self):
self.queue = deque()

def _qsize(self):
Expand All @@ -226,7 +226,7 @@ class PriorityQueue(Queue):
Entries are typically tuples of the form: (priority number, data).
'''

def _init(self, maxsize):
def _init(self):
self.queue = []

def _qsize(self):
Expand All @@ -242,7 +242,7 @@ def _get(self):
class LifoQueue(Queue):
'''Variant of Queue that retrieves most recently added entries first.'''

def _init(self, maxsize):
def _init(self):
self.queue = []

def _qsize(self):
Expand Down