mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 19:34:08 +00:00 
			
		
		
		
	bpo-14112: Allow beginners to explore shallowness in greater depth ;-) (GH-15465)
This commit is contained in:
		
							parent
							
								
									fa7a6f5e35
								
							
						
					
					
						commit
						69ee87e99c
					
				
					 2 changed files with 3 additions and 1 deletions
				
			
		| 
						 | 
					@ -31,6 +31,7 @@ Interface summary:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   Raised for module specific errors.
 | 
					   Raised for module specific errors.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					.. _shallow_vs_deep_copy:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
The difference between shallow and deep copying is only relevant for compound
 | 
					The difference between shallow and deep copying is only relevant for compound
 | 
				
			||||||
objects (objects that contain other objects, like lists or class instances):
 | 
					objects (objects that contain other objects, like lists or class instances):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -394,7 +394,8 @@ indexed and sliced::
 | 
				
			||||||
   [9, 16, 25]
 | 
					   [9, 16, 25]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
All slice operations return a new list containing the requested elements.  This
 | 
					All slice operations return a new list containing the requested elements.  This
 | 
				
			||||||
means that the following slice returns a new (shallow) copy of the list::
 | 
					means that the following slice returns a
 | 
				
			||||||
 | 
					:ref:`shallow copy <shallow_vs_deep_copy>` of the list::
 | 
				
			||||||
 | 
					
 | 
				
			||||||
   >>> squares[:]
 | 
					   >>> squares[:]
 | 
				
			||||||
   [1, 4, 9, 16, 25]
 | 
					   [1, 4, 9, 16, 25]
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue