mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	gh-122858: Deprecate asyncio.iscoroutinefunction (#122875)
				
					
				
			Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
		
							parent
							
								
									3aaed083a3
								
							
						
					
					
						commit
						bc9d92c679
					
				
					 10 changed files with 27 additions and 8 deletions
				
			
		|  | @ -18,7 +18,16 @@ def _is_debug_mode(): | |||
| 
 | ||||
| 
 | ||||
| def iscoroutinefunction(func): | ||||
|     import warnings | ||||
|     """Return True if func is a decorated coroutine function.""" | ||||
|     warnings._deprecated("asyncio.iscoroutinefunction", | ||||
|                          f"{warnings._DEPRECATED_MSG}; " | ||||
|                          "use inspect.iscoroutinefunction() instead", | ||||
|                          remove=(3,16)) | ||||
|     return _iscoroutinefunction(func) | ||||
| 
 | ||||
| 
 | ||||
| def _iscoroutinefunction(func): | ||||
|     return (inspect.iscoroutinefunction(func) or | ||||
|             getattr(func, '_is_coroutine', None) is _is_coroutine) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wulian
						Wulian