mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #26809: Add __all__ to string module. Patch by Emanuel Barry
This commit is contained in:
		
							parent
							
								
									78b642c6b2
								
							
						
					
					
						commit
						c17a0b87a6
					
				
					 2 changed files with 9 additions and 3 deletions
				
			
		|  | @ -14,6 +14,10 @@ | |||
| 
 | ||||
| """ | ||||
| 
 | ||||
| __all__ = ["ascii_letters", "ascii_lowercase", "ascii_uppercase", "capwords", | ||||
|            "digits", "hexdigits", "octdigits", "printable", "punctuation", | ||||
|            "whitespace", "Formatter", "Template"] | ||||
| 
 | ||||
| import _string | ||||
| 
 | ||||
| # Some strings for ctype-style character classification | ||||
|  | @ -46,7 +50,7 @@ def capwords(s, sep=None): | |||
| 
 | ||||
| #################################################################### | ||||
| import re as _re | ||||
| from collections import ChainMap | ||||
| from collections import ChainMap as _ChainMap | ||||
| 
 | ||||
| class _TemplateMetaclass(type): | ||||
|     pattern = r""" | ||||
|  | @ -104,7 +108,7 @@ def substitute(*args, **kws): | |||
|         if not args: | ||||
|             mapping = kws | ||||
|         elif kws: | ||||
|             mapping = ChainMap(kws, args[0]) | ||||
|             mapping = _ChainMap(kws, args[0]) | ||||
|         else: | ||||
|             mapping = args[0] | ||||
|         # Helper function for .sub() | ||||
|  | @ -134,7 +138,7 @@ def safe_substitute(*args, **kws): | |||
|         if not args: | ||||
|             mapping = kws | ||||
|         elif kws: | ||||
|             mapping = ChainMap(kws, args[0]) | ||||
|             mapping = _ChainMap(kws, args[0]) | ||||
|         else: | ||||
|             mapping = args[0] | ||||
|         # Helper function for .sub() | ||||
|  |  | |||
|  | @ -131,6 +131,8 @@ Core and Builtins | |||
| Library | ||||
| ------- | ||||
| 
 | ||||
| - Issue #26809: Add ``__all__`` to :mod:`string`.  Patch by Emanuel Barry. | ||||
| 
 | ||||
| - Issue #26373: subprocess.Popen.communicate now correctly ignores | ||||
|   BrokenPipeError when the child process dies before .communicate() | ||||
|   is called in more/all circumstances. | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zachary Ware
						Zachary Ware