mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 03:44:55 +00:00 
			
		
		
		
	bpo-15243: Document __prepare__ as classmethod (GH-17124)
This commit is contained in:
		
							parent
							
								
									aef7dc8987
								
							
						
					
					
						commit
						7de617455e
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -1945,7 +1945,8 @@ Preparing the class namespace
 | 
				
			||||||
Once the appropriate metaclass has been identified, then the class namespace
 | 
					Once the appropriate metaclass has been identified, then the class namespace
 | 
				
			||||||
is prepared. If the metaclass has a ``__prepare__`` attribute, it is called
 | 
					is prepared. If the metaclass has a ``__prepare__`` attribute, it is called
 | 
				
			||||||
as ``namespace = metaclass.__prepare__(name, bases, **kwds)`` (where the
 | 
					as ``namespace = metaclass.__prepare__(name, bases, **kwds)`` (where the
 | 
				
			||||||
additional keyword arguments, if any, come from the class definition).
 | 
					additional keyword arguments, if any, come from the class definition). The
 | 
				
			||||||
 | 
					``__prepare__`` method should be implemented as a :func:`classmethod`.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
If the metaclass has no ``__prepare__`` attribute, then the class namespace
 | 
					If the metaclass has no ``__prepare__`` attribute, then the class namespace
 | 
				
			||||||
is initialised as an empty ordered mapping.
 | 
					is initialised as an empty ordered mapping.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue