mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 11:49:12 +00:00 
			
		
		
		
	Try to discourage use of PyObject_Type().
This commit is contained in:
		
							parent
							
								
									fc29646a2e
								
							
						
					
					
						commit
						6db771871e
					
				
					 1 changed files with 5 additions and 0 deletions
				
			
		| 
						 | 
					@ -319,6 +319,11 @@ determination.
 | 
				
			||||||
  the object type of object \var{o}. On failure, raises
 | 
					  the object type of object \var{o}. On failure, raises
 | 
				
			||||||
  \exception{SystemError} and returns \NULL.  This is equivalent to
 | 
					  \exception{SystemError} and returns \NULL.  This is equivalent to
 | 
				
			||||||
  the Python expression \code{type(\var{o})}.
 | 
					  the Python expression \code{type(\var{o})}.
 | 
				
			||||||
 | 
					  This function increments the reference count of the return value.
 | 
				
			||||||
 | 
					  There's really no reason to use this function instead of the
 | 
				
			||||||
 | 
					  common expression \code{\var{o}->ob_type}, which returns a pointer
 | 
				
			||||||
 | 
					  of type \code{PyTypeObject *}, except when the incremented reference
 | 
				
			||||||
 | 
					  count is needed.
 | 
				
			||||||
  \bifuncindex{type}
 | 
					  \bifuncindex{type}
 | 
				
			||||||
\end{cfuncdesc}
 | 
					\end{cfuncdesc}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue