mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	python: Simplify with str.removeprefix, str.removesuffix.
These are available in Python ≥ 3.9. https://docs.python.org/3/library/stdtypes.html#str.removeprefix Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Tim Abbott
					
				
			
			
				
	
			
			
			
						parent
						
							1ec4539550
						
					
				
				
					commit
					91ade25ba3
				
			@@ -610,7 +610,7 @@ def client_label_map(name: str) -> str:
 | 
			
		||||
    if name in ["ZulipPython", "API: Python"]:
 | 
			
		||||
        return "Python API"
 | 
			
		||||
    if name.startswith("Zulip") and name.endswith("Webhook"):
 | 
			
		||||
        return name[len("Zulip") : -len("Webhook")] + " webhook"
 | 
			
		||||
        return name.removeprefix("Zulip").removesuffix("Webhook") + " webhook"
 | 
			
		||||
    return name
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user