mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 05:01:30 +00:00 
			
		
		
		
	gh-46236: Add docs for PyUnicode_GetDefaultEncoding() doc (GH-130335)
* Clarify sys.getdefaultencoding() documentation * Add missing documentation for PyUnicode_GetDefaultEncoding, the C equivalent of sys.getdefaultencoding
This commit is contained in:
		
							parent
							
								
									fc8d2cba54
								
							
						
					
					
						commit
						9f25c1f012
					
				
					 3 changed files with 14 additions and 2 deletions
				
			
		|  | @ -607,6 +607,15 @@ APIs: | ||||||
|    decref'ing the returned objects. |    decref'ing the returned objects. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | .. c:function:: const char* PyUnicode_GetDefaultEncoding(void) | ||||||
|  | 
 | ||||||
|  |    Return the name of the default string encoding, ``"utf-8"``. | ||||||
|  |    See :func:`sys.getdefaultencoding`. | ||||||
|  | 
 | ||||||
|  |    The returned string does not need to be freed, and is valid | ||||||
|  |    until interpreter shutdown. | ||||||
|  | 
 | ||||||
|  | 
 | ||||||
| .. c:function:: Py_ssize_t PyUnicode_GetLength(PyObject *unicode) | .. c:function:: Py_ssize_t PyUnicode_GetLength(PyObject *unicode) | ||||||
| 
 | 
 | ||||||
|    Return the length of the Unicode object, in code points. |    Return the length of the Unicode object, in code points. | ||||||
|  |  | ||||||
|  | @ -2770,6 +2770,9 @@ PyUnicode_FromFormatV:PyObject*::+1: | ||||||
| PyUnicode_FromFormatV:const char*:format:: | PyUnicode_FromFormatV:const char*:format:: | ||||||
| PyUnicode_FromFormatV:va_list:args:: | PyUnicode_FromFormatV:va_list:args:: | ||||||
| 
 | 
 | ||||||
|  | PyUnicode_GetDefaultEncoding:const char*::: | ||||||
|  | PyUnicode_GetDefaultEncoding::void:: | ||||||
|  | 
 | ||||||
| PyUnicode_GetLength:Py_ssize_t::: | PyUnicode_GetLength:Py_ssize_t::: | ||||||
| PyUnicode_GetLength:PyObject*:unicode:0: | PyUnicode_GetLength:PyObject*:unicode:0: | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -771,8 +771,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only | ||||||
| 
 | 
 | ||||||
| .. function:: getdefaultencoding() | .. function:: getdefaultencoding() | ||||||
| 
 | 
 | ||||||
|    Return the name of the current default string encoding used by the Unicode |    Return ``'utf-8'``. This is the name of the default string encoding, used | ||||||
|    implementation. |    in methods like :meth:`str.encode`. | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| .. function:: getdlopenflags() | .. function:: getdlopenflags() | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 RUANG (James Roy)
						RUANG (James Roy)