mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	[3.9] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28512)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>.
(cherry picked from commit 8f943ca257)
Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
			
			
This commit is contained in:
		
							parent
							
								
									09390c837a
								
							
						
					
					
						commit
						5482db5800
					
				
					 27 changed files with 43 additions and 44 deletions
				
			
		|  | @ -89,7 +89,7 @@ To get at submitted form data, use the :class:`FieldStorage` class. If the form | ||||||
| contains non-ASCII characters, use the *encoding* keyword parameter set to the | contains non-ASCII characters, use the *encoding* keyword parameter set to the | ||||||
| value of the encoding defined for the document. It is usually contained in the | value of the encoding defined for the document. It is usually contained in the | ||||||
| META tag in the HEAD section of the HTML document or by the | META tag in the HEAD section of the HTML document or by the | ||||||
| :mailheader:`Content-Type` header).  This reads the form contents from the | :mailheader:`Content-Type` header.  This reads the form contents from the | ||||||
| standard input or the environment (depending on the value of various | standard input or the environment (depending on the value of various | ||||||
| environment variables set according to the CGI standard).  Since it may consume | environment variables set according to the CGI standard).  Since it may consume | ||||||
| standard input, it should be instantiated only once. | standard input, it should be instantiated only once. | ||||||
|  |  | ||||||
|  | @ -163,7 +163,7 @@ in :mod:`logging` itself) and defining handlers which are declared either in | ||||||
|       :func:`listen` socket and sending a configuration which runs whatever |       :func:`listen` socket and sending a configuration which runs whatever | ||||||
|       code the attacker wants to have executed in the victim's process. This is |       code the attacker wants to have executed in the victim's process. This is | ||||||
|       especially easy to do if the default port is used, but not hard even if a |       especially easy to do if the default port is used, but not hard even if a | ||||||
|       different port is used). To avoid the risk of this happening, use the |       different port is used. To avoid the risk of this happening, use the | ||||||
|       ``verify`` argument to :func:`listen` to prevent unrecognised |       ``verify`` argument to :func:`listen` to prevent unrecognised | ||||||
|       configurations from being applied. |       configurations from being applied. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -650,7 +650,7 @@ OpenerDirector Objects | ||||||
|    optional *timeout* parameter specifies a timeout in seconds for blocking |    optional *timeout* parameter specifies a timeout in seconds for blocking | ||||||
|    operations like the connection attempt (if not specified, the global default |    operations like the connection attempt (if not specified, the global default | ||||||
|    timeout setting will be used). The timeout feature actually works only for |    timeout setting will be used). The timeout feature actually works only for | ||||||
|    HTTP, HTTPS and FTP connections). |    HTTP, HTTPS and FTP connections. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| .. method:: OpenerDirector.error(proto, *args) | .. method:: OpenerDirector.error(proto, *args) | ||||||
|  |  | ||||||
|  | @ -479,7 +479,6 @@ is semantically equivalent to:: | ||||||
|       The specification, background, and examples for the Python :keyword:`with` |       The specification, background, and examples for the Python :keyword:`with` | ||||||
|       statement. |       statement. | ||||||
| 
 | 
 | ||||||
| 
 |  | ||||||
| .. index:: | .. index:: | ||||||
|    single: parameter; function definition |    single: parameter; function definition | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -416,7 +416,7 @@ enum PyUnicode_Kind { | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| /* Fast check to determine whether an object is ready. Equivalent to
 | /* Fast check to determine whether an object is ready. Equivalent to
 | ||||||
|    PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any) */ |    PyUnicode_IS_COMPACT(op) || ((PyUnicodeObject*)(op))->data.any */ | ||||||
| 
 | 
 | ||||||
| #define PyUnicode_IS_READY(op) (((PyASCIIObject*)op)->state.ready) | #define PyUnicode_IS_READY(op) (((PyASCIIObject*)op)->state.ready) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -482,7 +482,7 @@ def customize_compiler(_config_vars): | ||||||
| 
 | 
 | ||||||
|     This customization is performed when the first |     This customization is performed when the first | ||||||
|     extension module build is requested |     extension module build is requested | ||||||
|     in distutils.sysconfig.customize_compiler). |     in distutils.sysconfig.customize_compiler. | ||||||
|     """ |     """ | ||||||
| 
 | 
 | ||||||
|     # Find a compiler to use for extension module builds |     # Find a compiler to use for extension module builds | ||||||
|  |  | ||||||
|  | @ -83,7 +83,7 @@ def check_metadata(self): | ||||||
|             name, version, URL |             name, version, URL | ||||||
| 
 | 
 | ||||||
|         Recommended fields: |         Recommended fields: | ||||||
|             (author and author_email) or (maintainer and maintainer_email)) |             (author and author_email) or (maintainer and maintainer_email) | ||||||
| 
 | 
 | ||||||
|         Warns if any are missing. |         Warns if any are missing. | ||||||
|         """ |         """ | ||||||
|  |  | ||||||
|  | @ -673,7 +673,7 @@ def manifest_get_embed_info(self, target_desc, ld_args): | ||||||
|         # If a manifest should be embedded, return a tuple of |         # If a manifest should be embedded, return a tuple of | ||||||
|         # (manifest_filename, resource_id).  Returns None if no manifest |         # (manifest_filename, resource_id).  Returns None if no manifest | ||||||
|         # should be embedded.  See http://bugs.python.org/issue7833 for why |         # should be embedded.  See http://bugs.python.org/issue7833 for why | ||||||
|         # we want to avoid any manifest for extension modules if we can) |         # we want to avoid any manifest for extension modules if we can. | ||||||
|         for arg in ld_args: |         for arg in ld_args: | ||||||
|             if arg.startswith("/MANIFESTFILE:"): |             if arg.startswith("/MANIFESTFILE:"): | ||||||
|                 temp_manifest = arg.split(":", 1)[1] |                 temp_manifest = arg.split(":", 1)[1] | ||||||
|  |  | ||||||
|  | @ -17,7 +17,7 @@ def __init__(self, node): | ||||||
|         self.npredecessors = 0 |         self.npredecessors = 0 | ||||||
| 
 | 
 | ||||||
|         # List of successor nodes. The list can contain duplicated elements as |         # List of successor nodes. The list can contain duplicated elements as | ||||||
|         # long as they're all reflected in the successor's npredecessors attribute). |         # long as they're all reflected in the successor's npredecessors attribute. | ||||||
|         self.successors = [] |         self.successors = [] | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -2,7 +2,7 @@ | ||||||
| 
 | 
 | ||||||
| Coverage is effectively 100%.  Tkinter dialog is mocked, Mac-only line | Coverage is effectively 100%.  Tkinter dialog is mocked, Mac-only line | ||||||
| may be skipped, and dummy function in bind test should not be called. | may be skipped, and dummy function in bind test should not be called. | ||||||
| Not tested: exit with 'self.advanced or self.keys_ok(keys)) ...' False. | Not tested: exit with 'self.advanced or self.keys_ok(keys) ...' False. | ||||||
| """ | """ | ||||||
| 
 | 
 | ||||||
| from idlelib import config_key | from idlelib import config_key | ||||||
|  |  | ||||||
|  | @ -1,4 +1,4 @@ | ||||||
| """Test query, coverage 93%). | """Test query, coverage 93%. | ||||||
| 
 | 
 | ||||||
| Non-gui tests for Query, SectionName, ModuleName, and HelpSource use | Non-gui tests for Query, SectionName, ModuleName, and HelpSource use | ||||||
| dummy versions that extract the non-gui methods and add other needed | dummy versions that extract the non-gui methods and add other needed | ||||||
|  |  | ||||||
|  | @ -664,7 +664,7 @@ | ||||||
| ('Class','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table, specifying the component for which to return a path when called through LocateComponent.',), | ('Class','Component_','N',None, None, 'Component',1,'Identifier',None, 'Required foreign key into the Component Table, specifying the component for which to return a path when called through LocateComponent.',), | ||||||
| ('Class','Context','N',None, None, None, None, 'Identifier',None, 'The numeric server context for this server. CLSCTX_xxxx',), | ('Class','Context','N',None, None, None, None, 'Identifier',None, 'The numeric server context for this server. CLSCTX_xxxx',), | ||||||
| ('Class','DefInprocHandler','Y',None, None, None, None, 'Filename','1;2;3','Optional default inproc handler.  Only optionally provided if Context=CLSCTX_LOCAL_SERVER.  Typically "ole32.dll" or "mapi32.dll"',), | ('Class','DefInprocHandler','Y',None, None, None, None, 'Filename','1;2;3','Optional default inproc handler.  Only optionally provided if Context=CLSCTX_LOCAL_SERVER.  Typically "ole32.dll" or "mapi32.dll"',), | ||||||
| ('Class','FileTypeMask','Y',None, None, None, None, 'Text',None, 'Optional string containing information for the HKCRthis CLSID) key. If multiple patterns exist, they must be delimited by a semicolon, and numeric subkeys will be generated: 0,1,2...',), | ('Class','FileTypeMask','Y',None, None, None, None, 'Text',None, 'Optional string containing information for the HKCRthis CLSID key. If multiple patterns exist, they must be delimited by a semicolon, and numeric subkeys will be generated: 0,1,2...',), | ||||||
| ('Class','Icon_','Y',None, None, 'Icon',1,'Identifier',None, 'Optional foreign key into the Icon Table, specifying the icon file associated with this CLSID. Will be written under the DefaultIcon key.',), | ('Class','Icon_','Y',None, None, 'Icon',1,'Identifier',None, 'Optional foreign key into the Icon Table, specifying the icon file associated with this CLSID. Will be written under the DefaultIcon key.',), | ||||||
| ('Class','IconIndex','Y',-32767,32767,None, None, None, None, 'Optional icon index.',), | ('Class','IconIndex','Y',-32767,32767,None, None, None, None, 'Optional icon index.',), | ||||||
| ('Class','ProgId_Default','Y',None, None, 'ProgId',1,'Text',None, 'Optional ProgId associated with this CLSID.',), | ('Class','ProgId_Default','Y',None, None, 'ProgId',1,'Text',None, 'Optional ProgId associated with this CLSID.',), | ||||||
|  |  | ||||||
|  | @ -673,7 +673,7 @@ def resolve_name(name): | ||||||
|     ValueError - if `name` isn't in a recognised format |     ValueError - if `name` isn't in a recognised format | ||||||
|     ImportError - if an import failed when it shouldn't have |     ImportError - if an import failed when it shouldn't have | ||||||
|     AttributeError - if a failure occurred when traversing the object hierarchy |     AttributeError - if a failure occurred when traversing the object hierarchy | ||||||
|                      within the imported package to get to the desired object) |                      within the imported package to get to the desired object. | ||||||
|     """ |     """ | ||||||
|     m = _NAME_PATTERN.match(name) |     m = _NAME_PATTERN.match(name) | ||||||
|     if not m: |     if not m: | ||||||
|  |  | ||||||
|  | @ -1,5 +1,5 @@ | ||||||
| # -*- coding: utf-8 -*- | # -*- coding: utf-8 -*- | ||||||
| # Autogenerated by Sphinx on Mon Aug 30 20:40:44 2021 | # Autogenerated by Sphinx on Wed Sep 22 01:22:10 2021 | ||||||
| topics = {'assert': 'The "assert" statement\n' | topics = {'assert': 'The "assert" statement\n' | ||||||
|            '**********************\n' |            '**********************\n' | ||||||
|            '\n' |            '\n' | ||||||
|  | @ -3262,13 +3262,13 @@ | ||||||
|                   '\n' |                   '\n' | ||||||
|                   '   If "__new__()" is invoked during object construction and ' |                   '   If "__new__()" is invoked during object construction and ' | ||||||
|                   'it returns\n' |                   'it returns\n' | ||||||
|                   '   an instance or subclass of *cls*, then the new ' |                   '   an instance of *cls*, then the new instance’s ' | ||||||
|                   'instance’s\n' |                   '"__init__()" method\n' | ||||||
|                   '   "__init__()" method will be invoked like ' |                   '   will be invoked like "__init__(self[, ...])", where ' | ||||||
|                   '"__init__(self[, ...])",\n' |                   '*self* is the\n' | ||||||
|                   '   where *self* is the new instance and the remaining ' |                   '   new instance and the remaining arguments are the same as ' | ||||||
|                   'arguments are\n' |                   'were\n' | ||||||
|                   '   the same as were passed to the object constructor.\n' |                   '   passed to the object constructor.\n' | ||||||
|                   '\n' |                   '\n' | ||||||
|                   '   If "__new__()" does not return an instance of *cls*, ' |                   '   If "__new__()" does not return an instance of *cls*, ' | ||||||
|                   'then the new\n' |                   'then the new\n' | ||||||
|  | @ -8120,13 +8120,13 @@ | ||||||
|                  '\n' |                  '\n' | ||||||
|                  '   If "__new__()" is invoked during object construction and ' |                  '   If "__new__()" is invoked during object construction and ' | ||||||
|                  'it returns\n' |                  'it returns\n' | ||||||
|                  '   an instance or subclass of *cls*, then the new ' |                  '   an instance of *cls*, then the new instance’s ' | ||||||
|                  'instance’s\n' |                  '"__init__()" method\n' | ||||||
|                  '   "__init__()" method will be invoked like "__init__(self[, ' |                  '   will be invoked like "__init__(self[, ...])", where ' | ||||||
|                  '...])",\n' |                  '*self* is the\n' | ||||||
|                  '   where *self* is the new instance and the remaining ' |                  '   new instance and the remaining arguments are the same as ' | ||||||
|                  'arguments are\n' |                  'were\n' | ||||||
|                  '   the same as were passed to the object constructor.\n' |                  '   passed to the object constructor.\n' | ||||||
|                  '\n' |                  '\n' | ||||||
|                  '   If "__new__()" does not return an instance of *cls*, then ' |                  '   If "__new__()" does not return an instance of *cls*, then ' | ||||||
|                  'the new\n' |                  'the new\n' | ||||||
|  |  | ||||||
|  | @ -682,8 +682,8 @@ def dec(*args, **kwargs): | ||||||
| # A constant likely larger than the underlying OS socket buffer size, to make | # A constant likely larger than the underlying OS socket buffer size, to make | ||||||
| # writes blocking. | # writes blocking. | ||||||
| # The socket buffer sizes can usually be tuned system-wide (e.g. through sysctl | # The socket buffer sizes can usually be tuned system-wide (e.g. through sysctl | ||||||
| # on Linux), or on a per-socket basis (SO_SNDBUF/SO_RCVBUF). See issue #18643 | # on Linux), or on a per-socket basis (SO_SNDBUF/SO_RCVBUF).  See issue #18643 | ||||||
| # for a discussion of this number). | # for a discussion of this number. | ||||||
| SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1 | SOCK_MAX_SIZE = 16 * 1024 * 1024 + 1 | ||||||
| 
 | 
 | ||||||
| # decorator for skipping tests on non-IEEE 754 platforms | # decorator for skipping tests on non-IEEE 754 platforms | ||||||
|  |  | ||||||
|  | @ -249,7 +249,7 @@ def test_common_format(self): | ||||||
|         # base marker shouldn't change the size |         # base marker shouldn't change the size | ||||||
|         testcommon("%0#35.33o", big, "0o012345670123456701234567012345670") |         testcommon("%0#35.33o", big, "0o012345670123456701234567012345670") | ||||||
| 
 | 
 | ||||||
|         # Some small ints, in both Python int and flavors). |         # Some small ints, in both Python int and flavors. | ||||||
|         testcommon("%d", 42, "42") |         testcommon("%d", 42, "42") | ||||||
|         testcommon("%d", -42, "-42") |         testcommon("%d", -42, "-42") | ||||||
|         testcommon("%d", 42.0, "42") |         testcommon("%d", 42.0, "42") | ||||||
|  |  | ||||||
|  | @ -23,7 +23,7 @@ class EncodingTest: | ||||||
| 
 | 
 | ||||||
|     PEP 263 specifies how that can change on a per-file basis. Either the first |     PEP 263 specifies how that can change on a per-file basis. Either the first | ||||||
|     or second line can contain the encoding line [encoding first line] |     or second line can contain the encoding line [encoding first line] | ||||||
|     encoding second line]. If the file has the BOM marker it is considered UTF-8 |     [encoding second line]. If the file has the BOM marker it is considered UTF-8 | ||||||
|     implicitly [BOM]. If any encoding is specified it must be UTF-8, else it is |     implicitly [BOM]. If any encoding is specified it must be UTF-8, else it is | ||||||
|     an error [BOM and utf-8][BOM conflict]. |     an error [BOM and utf-8][BOM conflict]. | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -45,7 +45,7 @@ | ||||||
|     ("Raw Data",      b"binary\x00data",                       REG_BINARY), |     ("Raw Data",      b"binary\x00data",                       REG_BINARY), | ||||||
|     ("Big String",    "x"*(2**14-1),                           REG_SZ), |     ("Big String",    "x"*(2**14-1),                           REG_SZ), | ||||||
|     ("Big Binary",    b"x"*(2**14),                            REG_BINARY), |     ("Big Binary",    b"x"*(2**14),                            REG_BINARY), | ||||||
|     # Two and three kanjis, meaning: "Japan" and "Japanese") |     # Two and three kanjis, meaning: "Japan" and "Japanese". | ||||||
|     ("Japanese 日本", "日本語", REG_SZ), |     ("Japanese 日本", "日本語", REG_SZ), | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -568,7 +568,7 @@ Make :func:`asyncio.create_subprocess_exec` accept path-like arguments. | ||||||
| .. section: Library | .. section: Library | ||||||
| 
 | 
 | ||||||
| Change default *max_workers* of ``ThreadPoolExecutor`` from ``cpu_count() * | Change default *max_workers* of ``ThreadPoolExecutor`` from ``cpu_count() * | ||||||
| 5`` to ``min(32, cpu_count() + 4))``.  Previous value was unreasonably large | 5`` to ``min(32, cpu_count() + 4)``.  Previous value was unreasonably large | ||||||
| on many cores machines. | on many cores machines. | ||||||
| 
 | 
 | ||||||
| .. | .. | ||||||
|  |  | ||||||
|  | @ -1022,7 +1022,7 @@ new_time_ex(int hour, int minute, int second, int usecond, | ||||||
|  * true.  Passing false is a speed optimization, if you know for sure |  * true.  Passing false is a speed optimization, if you know for sure | ||||||
|  * that seconds and microseconds are already in their proper ranges.  In any |  * that seconds and microseconds are already in their proper ranges.  In any | ||||||
|  * case, raises OverflowError and returns NULL if the normalized days is out |  * case, raises OverflowError and returns NULL if the normalized days is out | ||||||
|  * of range). |  * of range. | ||||||
|  */ |  */ | ||||||
| static PyObject * | static PyObject * | ||||||
| new_delta_ex(int days, int seconds, int microseconds, int normalize, | new_delta_ex(int days, int seconds, int microseconds, int normalize, | ||||||
|  |  | ||||||
|  | @ -90,7 +90,7 @@ _Py_acosh(double x) | ||||||
|  *              asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ] |  *              asinh(x) = sign(x) * log [ |x| + sqrt(x*x+1) ] | ||||||
|  *      we have |  *      we have | ||||||
|  *      asinh(x) := x  if  1+x*x=1, |  *      asinh(x) := x  if  1+x*x=1, | ||||||
|  *               := sign(x)*(log(x)+ln2)) for large |x|, else |  *               := sign(x)*(log(x)+ln2) for large |x|, else | ||||||
|  *               := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else |  *               := sign(x)*log(2|x|+1/(|x|+sqrt(x*x+1))) if|x|>2, else | ||||||
|  *               := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) |  *               := sign(x)*log1p(|x| + x^2/(1 + sqrt(1+x^2))) | ||||||
|  */ |  */ | ||||||
|  |  | ||||||
|  | @ -1636,12 +1636,12 @@ array.array.frombytes | ||||||
|     buffer: Py_buffer |     buffer: Py_buffer | ||||||
|     / |     / | ||||||
| 
 | 
 | ||||||
| Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method). | Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method. | ||||||
| [clinic start generated code]*/ | [clinic start generated code]*/ | ||||||
| 
 | 
 | ||||||
| static PyObject * | static PyObject * | ||||||
| array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer) | array_array_frombytes_impl(arrayobject *self, Py_buffer *buffer) | ||||||
| /*[clinic end generated code: output=d9842c8f7510a516 input=2bbf2b53ebfcc988]*/ | /*[clinic end generated code: output=d9842c8f7510a516 input=378db226dfac949e]*/ | ||||||
| { | { | ||||||
|     return frombytes(self, buffer); |     return frombytes(self, buffer); | ||||||
| } | } | ||||||
|  |  | ||||||
							
								
								
									
										4
									
								
								Modules/clinic/arraymodule.c.h
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										4
									
								
								Modules/clinic/arraymodule.c.h
									
										
									
										generated
									
									
									
								
							|  | @ -316,7 +316,7 @@ PyDoc_STRVAR(array_array_frombytes__doc__, | ||||||
| "frombytes($self, buffer, /)\n" | "frombytes($self, buffer, /)\n" | ||||||
| "--\n" | "--\n" | ||||||
| "\n" | "\n" | ||||||
| "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method)."); | "Appends items from the string, interpreting it as an array of machine values, as if it had been read from a file using the fromfile() method."); | ||||||
| 
 | 
 | ||||||
| #define ARRAY_ARRAY_FROMBYTES_METHODDEF    \ | #define ARRAY_ARRAY_FROMBYTES_METHODDEF    \ | ||||||
|     {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__}, |     {"frombytes", (PyCFunction)array_array_frombytes, METH_O, array_array_frombytes__doc__}, | ||||||
|  | @ -534,4 +534,4 @@ PyDoc_STRVAR(array_arrayiterator___setstate____doc__, | ||||||
| 
 | 
 | ||||||
| #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF    \ | #define ARRAY_ARRAYITERATOR___SETSTATE___METHODDEF    \ | ||||||
|     {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, |     {"__setstate__", (PyCFunction)array_arrayiterator___setstate__, METH_O, array_arrayiterator___setstate____doc__}, | ||||||
| /*[clinic end generated code: output=9f70748dd3bc532f input=a9049054013a1b77]*/ | /*[clinic end generated code: output=485e848d1f3d05e7 input=a9049054013a1b77]*/ | ||||||
|  |  | ||||||
|  | @ -1361,7 +1361,7 @@ PyDoc_STRVAR(zlib_module_documentation, | ||||||
| "compressobj([level[, ...]]) -- Return a compressor object.\n" | "compressobj([level[, ...]]) -- Return a compressor object.\n" | ||||||
| "crc32(string[, start]) -- Compute a CRC-32 checksum.\n" | "crc32(string[, start]) -- Compute a CRC-32 checksum.\n" | ||||||
| "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n" | "decompress(string,[wbits],[bufsize]) -- Decompresses a compressed string.\n" | ||||||
| "decompressobj([wbits[, zdict]]]) -- Return a decompressor object.\n" | "decompressobj([wbits[, zdict]]) -- Return a decompressor object.\n" | ||||||
| "\n" | "\n" | ||||||
| "'wbits' is window buffer size and container format.\n" | "'wbits' is window buffer size and container format.\n" | ||||||
| "Compressor objects support compress() and flush() methods; decompressor\n" | "Compressor objects support compress() and flush() methods; decompressor\n" | ||||||
|  |  | ||||||
|  | @ -10867,7 +10867,7 @@ replace(PyObject *self, PyObject *str1, | ||||||
|             release1 = 1; |             release1 = 1; | ||||||
|         } |         } | ||||||
|         /* new_size = PyUnicode_GET_LENGTH(self) + n * (PyUnicode_GET_LENGTH(str2) -
 |         /* new_size = PyUnicode_GET_LENGTH(self) + n * (PyUnicode_GET_LENGTH(str2) -
 | ||||||
|            PyUnicode_GET_LENGTH(str1))); */ |            PyUnicode_GET_LENGTH(str1)); */ | ||||||
|         if (len1 < len2 && len2 - len1 > (PY_SSIZE_T_MAX - slen) / n) { |         if (len1 < len2 && len2 - len1 > (PY_SSIZE_T_MAX - slen) / n) { | ||||||
|                 PyErr_SetString(PyExc_OverflowError, |                 PyErr_SetString(PyExc_OverflowError, | ||||||
|                                 "replace string is too long"); |                                 "replace string is too long"); | ||||||
|  |  | ||||||
|  | @ -29,7 +29,7 @@ | ||||||
|      - If we DO have a Python Home: The relevant sub-directories (Lib, |      - If we DO have a Python Home: The relevant sub-directories (Lib, | ||||||
|        DLLs, etc) are based on the Python Home |        DLLs, etc) are based on the Python Home | ||||||
|      - If we DO NOT have a Python Home, the core Python Path is |      - If we DO NOT have a Python Home, the core Python Path is | ||||||
|        loaded from the registry.  This is the main PythonPath key, |        loaded from the registry.  (This is the main PythonPath key, | ||||||
|        and both HKLM and HKCU are combined to form the path) |        and both HKLM and HKCU are combined to form the path) | ||||||
| 
 | 
 | ||||||
|    * Iff - we can not locate the Python Home, have not had a PYTHONPATH |    * Iff - we can not locate the Python Home, have not had a PYTHONPATH | ||||||
|  |  | ||||||
|  | @ -730,7 +730,7 @@ def join_alphabet_list_five(STR): | ||||||
|     for x in _RANGE_1000: |     for x in _RANGE_1000: | ||||||
|         sep_join(s2) |         sep_join(s2) | ||||||
| 
 | 
 | ||||||
| @bench('"A".join(["Bob"]*100))', | @bench('"A".join(["Bob"]*100)', | ||||||
|        "join list of 100 words, with 1 character sep", 1000) |        "join list of 100 words, with 1 character sep", 1000) | ||||||
| def join_100_words_single(STR): | def join_100_words_single(STR): | ||||||
|     sep = STR("A") |     sep = STR("A") | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Łukasz Langa
						Łukasz Langa