mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	bpo-43918: document signature and default argument of anext builtin (#25551)
				
					
				
			Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
This commit is contained in:
		
							parent
							
								
									a6b47de07a
								
							
						
					
					
						commit
						6af4e6b266
					
				
					 3 changed files with 11 additions and 4 deletions
				
			
		|  | @ -0,0 +1 @@ | ||||||
|  | Document the signature and ``default`` argument in the docstring of the new ``anext`` builtin. | ||||||
|  | @ -1631,13 +1631,16 @@ anext as builtin_anext | ||||||
|     default: object = NULL |     default: object = NULL | ||||||
|     / |     / | ||||||
| 
 | 
 | ||||||
| Return the next item from the async iterator. | async anext(aiterator[, default]) | ||||||
|  | 
 | ||||||
|  | Return the next item from the async iterator.  If default is given and the async | ||||||
|  | iterator is exhausted, it is returned instead of raising StopAsyncIteration. | ||||||
| [clinic start generated code]*/ | [clinic start generated code]*/ | ||||||
| 
 | 
 | ||||||
| static PyObject * | static PyObject * | ||||||
| builtin_anext_impl(PyObject *module, PyObject *aiterator, | builtin_anext_impl(PyObject *module, PyObject *aiterator, | ||||||
|                    PyObject *default_value) |                    PyObject *default_value) | ||||||
| /*[clinic end generated code: output=f02c060c163a81fa input=699d11f4e38eca24]*/ | /*[clinic end generated code: output=f02c060c163a81fa input=8f63f4f78590bb4c]*/ | ||||||
| { | { | ||||||
|     PyTypeObject *t; |     PyTypeObject *t; | ||||||
|     PyObject *awaitable; |     PyObject *awaitable; | ||||||
|  |  | ||||||
							
								
								
									
										7
									
								
								Python/clinic/bltinmodule.c.h
									
										
									
										generated
									
									
									
								
							
							
						
						
									
										7
									
								
								Python/clinic/bltinmodule.c.h
									
										
									
										generated
									
									
									
								
							|  | @ -543,7 +543,10 @@ PyDoc_STRVAR(builtin_anext__doc__, | ||||||
| "anext($module, aiterator, default=<unrepresentable>, /)\n" | "anext($module, aiterator, default=<unrepresentable>, /)\n" | ||||||
| "--\n" | "--\n" | ||||||
| "\n" | "\n" | ||||||
| "Return the next item from the async iterator."); | "async anext(aiterator[, default])\n" | ||||||
|  | "\n" | ||||||
|  | "Return the next item from the async iterator.  If default is given and the async\n" | ||||||
|  | "iterator is exhausted, it is returned instead of raising StopAsyncIteration."); | ||||||
| 
 | 
 | ||||||
| #define BUILTIN_ANEXT_METHODDEF    \ | #define BUILTIN_ANEXT_METHODDEF    \ | ||||||
|     {"anext", (PyCFunction)(void(*)(void))builtin_anext, METH_FASTCALL, builtin_anext__doc__}, |     {"anext", (PyCFunction)(void(*)(void))builtin_anext, METH_FASTCALL, builtin_anext__doc__}, | ||||||
|  | @ -874,4 +877,4 @@ builtin_issubclass(PyObject *module, PyObject *const *args, Py_ssize_t nargs) | ||||||
| exit: | exit: | ||||||
|     return return_value; |     return return_value; | ||||||
| } | } | ||||||
| /*[clinic end generated code: output=da9ae459e9233259 input=a9049054013a1b77]*/ | /*[clinic end generated code: output=e1d8057298b5de61 input=a9049054013a1b77]*/ | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Erik Welch
						Erik Welch