mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	mypy: Improve return type of internal_notify_view decorator.
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							5c3af83229
						
					
				
				
					commit
					232bcd98b3
				
			@@ -575,9 +575,9 @@ def client_is_exempt_from_rate_limiting(request):
 | 
			
		||||
             settings.DEBUG_RATE_LIMITING))
 | 
			
		||||
 | 
			
		||||
def internal_notify_view(is_tornado_view):
 | 
			
		||||
    # type: (bool) ->  Callable[..., HttpResponse]
 | 
			
		||||
    # This function can't be typed perfectly because returning a generic function
 | 
			
		||||
    # isn't supported in mypy - https://github.com/python/mypy/issues/1551.
 | 
			
		||||
    # type: (bool) ->  Callable[[Callable[..., HttpResponse]], Callable[..., HttpResponse]]
 | 
			
		||||
    # The typing here could be improved by using the Extended Callable types:
 | 
			
		||||
    # https://mypy.readthedocs.io/en/latest/kinds_of_types.html#extended-callable-types
 | 
			
		||||
    """Used for situations where something running on the Zulip server
 | 
			
		||||
    needs to make a request to the (other) Django/Tornado processes running on
 | 
			
		||||
    the server."""
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user