mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs [queue] (GH-13950)
This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. fourth step: queue.py https://bugs.python.org/issue36373
This commit is contained in:
		
							parent
							
								
									57ea335606
								
							
						
					
					
						commit
						9008be303a
					
				
					 2 changed files with 8 additions and 0 deletions
				
			
		|  | @ -32,6 +32,10 @@ Queue | ||||||
|    the queue is always known and can be returned by calling the |    the queue is always known and can be returned by calling the | ||||||
|    :meth:`qsize` method. |    :meth:`qsize` method. | ||||||
| 
 | 
 | ||||||
|  |    .. deprecated-removed:: 3.8 3.10 | ||||||
|  |       The *loop* parameter. | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
|    This class is :ref:`not thread safe <asyncio-multithreading>`. |    This class is :ref:`not thread safe <asyncio-multithreading>`. | ||||||
| 
 | 
 | ||||||
|    .. attribute:: maxsize |    .. attribute:: maxsize | ||||||
|  |  | ||||||
|  | @ -2,6 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| import collections | import collections | ||||||
| import heapq | import heapq | ||||||
|  | import warnings | ||||||
| 
 | 
 | ||||||
| from . import events | from . import events | ||||||
| from . import locks | from . import locks | ||||||
|  | @ -34,6 +35,9 @@ def __init__(self, maxsize=0, *, loop=None): | ||||||
|             self._loop = events.get_event_loop() |             self._loop = events.get_event_loop() | ||||||
|         else: |         else: | ||||||
|             self._loop = loop |             self._loop = loop | ||||||
|  |             warnings.warn("The loop argument is deprecated since Python 3.8, " | ||||||
|  |                           "and scheduled for removal in Python 3.10.", | ||||||
|  |                           DeprecationWarning, stacklevel=2) | ||||||
|         self._maxsize = maxsize |         self._maxsize = maxsize | ||||||
| 
 | 
 | ||||||
|         # Futures. |         # Futures. | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Emmanuel Arias
						Emmanuel Arias