mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Merge
This commit is contained in:
		
						commit
						f74c33ad5c
					
				
					 8 changed files with 11 additions and 11 deletions
				
			
		|  | @ -1123,7 +1123,7 @@ Basic customization | ||||||
|    instance; for example: ``BaseClass.__init__(self, [args...])``. |    instance; for example: ``BaseClass.__init__(self, [args...])``. | ||||||
| 
 | 
 | ||||||
|    Because :meth:`__new__` and :meth:`__init__` work together in constructing |    Because :meth:`__new__` and :meth:`__init__` work together in constructing | ||||||
|    objects (:meth:`__new__` to create it, and :meth:`__init__` to customise it), |    objects (:meth:`__new__` to create it, and :meth:`__init__` to customize it), | ||||||
|    no non-``None`` value may be returned by :meth:`__init__`; doing so will |    no non-``None`` value may be returned by :meth:`__init__`; doing so will | ||||||
|    cause a :exc:`TypeError` to be raised at runtime. |    cause a :exc:`TypeError` to be raised at runtime. | ||||||
| 
 | 
 | ||||||
|  | @ -1697,7 +1697,7 @@ By default, classes are constructed using :func:`type`. The class body is | ||||||
| executed in a new namespace and the class name is bound locally to the | executed in a new namespace and the class name is bound locally to the | ||||||
| result of ``type(name, bases, namespace)``. | result of ``type(name, bases, namespace)``. | ||||||
| 
 | 
 | ||||||
| The class creation process can be customised by passing the ``metaclass`` | The class creation process can be customized by passing the ``metaclass`` | ||||||
| keyword argument in the class definition line, or by inheriting from an | keyword argument in the class definition line, or by inheriting from an | ||||||
| existing class that included such an argument. In the following example, | existing class that included such an argument. In the following example, | ||||||
| both ``MyClass`` and ``MySubclass`` are instances of ``Meta``:: | both ``MyClass`` and ``MySubclass`` are instances of ``Meta``:: | ||||||
|  |  | ||||||
|  | @ -166,7 +166,7 @@ encoding.  Encodings are named by strings, such as ``'ascii'``, ``'utf-8'``, | ||||||
| registering new encodings that are then available throughout a Python program. | registering new encodings that are then available throughout a Python program. | ||||||
| If an encoding isn't specified, the default encoding is usually 7-bit ASCII, | If an encoding isn't specified, the default encoding is usually 7-bit ASCII, | ||||||
| though it can be changed for your Python installation by calling the | though it can be changed for your Python installation by calling the | ||||||
| ``sys.setdefaultencoding(encoding)`` function in a customised version of | ``sys.setdefaultencoding(encoding)`` function in a customized version of | ||||||
| :file:`site.py`. | :file:`site.py`. | ||||||
| 
 | 
 | ||||||
| Combining 8-bit and Unicode strings always coerces to Unicode, using the default | Combining 8-bit and Unicode strings always coerces to Unicode, using the default | ||||||
|  | @ -1139,7 +1139,7 @@ module. | ||||||
|   Unix, not to be confused with :program:`gzip`\ -format files (which are |   Unix, not to be confused with :program:`gzip`\ -format files (which are | ||||||
|   supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.) |   supported by the :mod:`gzip` module) (Contributed by James C. Ahlstrom.) | ||||||
| 
 | 
 | ||||||
| * :mod:`imputil`: A module that provides a simpler way for writing customised | * :mod:`imputil`: A module that provides a simpler way for writing customized | ||||||
|   import hooks, in comparison to the existing :mod:`ihooks` module.  (Implemented |   import hooks, in comparison to the existing :mod:`ihooks` module.  (Implemented | ||||||
|   by Greg Stein, with much discussion on python-dev along the way.) |   by Greg Stein, with much discussion on python-dev along the way.) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -833,7 +833,7 @@ class CookiePolicy: | ||||||
|     May also modify cookies, though this is probably a bad idea. |     May also modify cookies, though this is probably a bad idea. | ||||||
| 
 | 
 | ||||||
|     The subclass DefaultCookiePolicy defines the standard rules for Netscape |     The subclass DefaultCookiePolicy defines the standard rules for Netscape | ||||||
|     and RFC 2965 cookies -- override that if you want a customised policy. |     and RFC 2965 cookies -- override that if you want a customized policy. | ||||||
| 
 | 
 | ||||||
|     """ |     """ | ||||||
|     def set_ok(self, cookie, request): |     def set_ok(self, cookie, request): | ||||||
|  |  | ||||||
|  | @ -129,7 +129,7 @@ | ||||||
| # Unix users can map to different SMB User names | # Unix users can map to different SMB User names | ||||||
| ;  username map = /etc/samba/smbusers | ;  username map = /etc/samba/smbusers | ||||||
| 
 | 
 | ||||||
| # Using the following line enables you to customise your configuration | # Using the following line enables you to customize your configuration | ||||||
| # on a per machine basis. The %m gets replaced with the netbios name | # on a per machine basis. The %m gets replaced with the netbios name | ||||||
| # of the machine that is connecting | # of the machine that is connecting | ||||||
| ;   include = /etc/samba/smb.conf.%m | ;   include = /etc/samba/smb.conf.%m | ||||||
|  |  | ||||||
|  | @ -90,7 +90,7 @@ def run_gdb(*args, **env_vars): | ||||||
|     raise unittest.SkipTest("gdb not built with embedded python support") |     raise unittest.SkipTest("gdb not built with embedded python support") | ||||||
| 
 | 
 | ||||||
| # Verify that "gdb" can load our custom hooks, as OS security settings may | # Verify that "gdb" can load our custom hooks, as OS security settings may | ||||||
| # disallow this without a customised .gdbinit. | # disallow this without a customized .gdbinit. | ||||||
| _, gdbpy_errors = run_gdb('--args', sys.executable) | _, gdbpy_errors = run_gdb('--args', sys.executable) | ||||||
| if "auto-loading has been declined" in gdbpy_errors: | if "auto-loading has been declined" in gdbpy_errors: | ||||||
|     msg = "gdb security settings prevent use of custom hooks: " |     msg = "gdb security settings prevent use of custom hooks: " | ||||||
|  |  | ||||||
|  | @ -275,7 +275,7 @@ def loadTestsFromModule(module, pattern=None): | ||||||
|         self.assertEqual(Module.load_tests_args, |         self.assertEqual(Module.load_tests_args, | ||||||
|                          [(loader, [], 'test*.py')]) |                          [(loader, [], 'test*.py')]) | ||||||
| 
 | 
 | ||||||
|     def test_find_tests_customise_via_package_pattern(self): |     def test_find_tests_customize_via_package_pattern(self): | ||||||
|         # This test uses the example 'do-nothing' load_tests from |         # This test uses the example 'do-nothing' load_tests from | ||||||
|         # https://docs.python.org/3/library/unittest.html#load-tests-protocol |         # https://docs.python.org/3/library/unittest.html#load-tests-protocol | ||||||
|         # to make sure that that actually works. |         # to make sure that that actually works. | ||||||
|  |  | ||||||
|  | @ -1256,7 +1256,7 @@ SimpleExtendsException(PyExc_Exception, AttributeError, | ||||||
|  *    SyntaxError extends Exception |  *    SyntaxError extends Exception | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| /* Helper function to customise error message for some syntax errors */ | /* Helper function to customize error message for some syntax errors */ | ||||||
| static int _report_missing_parentheses(PySyntaxErrorObject *self); | static int _report_missing_parentheses(PySyntaxErrorObject *self); | ||||||
| 
 | 
 | ||||||
| static int | static int | ||||||
|  |  | ||||||
|  | @ -2072,7 +2072,7 @@ sorted as builtin_sorted | ||||||
| 
 | 
 | ||||||
| Return a new list containing all items from the iterable in ascending order. | Return a new list containing all items from the iterable in ascending order. | ||||||
| 
 | 
 | ||||||
| A custom key function can be supplied to customise the sort order, and the | A custom key function can be supplied to customize the sort order, and the | ||||||
| reverse flag can be set to request the result in descending order. | reverse flag can be set to request the result in descending order. | ||||||
| [end disabled clinic input]*/ | [end disabled clinic input]*/ | ||||||
| 
 | 
 | ||||||
|  | @ -2082,7 +2082,7 @@ PyDoc_STRVAR(builtin_sorted__doc__, | ||||||
| "\n" | "\n" | ||||||
| "Return a new list containing all items from the iterable in ascending order.\n" | "Return a new list containing all items from the iterable in ascending order.\n" | ||||||
| "\n" | "\n" | ||||||
| "A custom key function can be supplied to customise the sort order, and the\n" | "A custom key function can be supplied to customize the sort order, and the\n" | ||||||
| "reverse flag can be set to request the result in descending order."); | "reverse flag can be set to request the result in descending order."); | ||||||
| 
 | 
 | ||||||
| #define BUILTIN_SORTED_METHODDEF    \ | #define BUILTIN_SORTED_METHODDEF    \ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Raymond Hettinger
						Raymond Hettinger