mirror of
				https://github.com/python/cpython.git
				synced 2025-10-30 21:21:22 +00:00 
			
		
		
		
	 9aaee933da
			
		
	
	
		9aaee933da
		
	
	
	
	
		
			
			- Converted the templates to use ANSI C prototypes (finally!) - Use re in stead of deprecated regex
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			670 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			670 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| 
 | |
| /* Code to access $name$ objects as mappings */
 | |
| 
 | |
| static int
 | |
| $abbrev$_length($abbrev$object *self)
 | |
| {
 | |
| 	/* XXXX Return the size of the mapping */
 | |
| }
 | |
| 
 | |
| static PyObject *
 | |
| $abbrev$_subscript($abbrev$object *self, PyObject *key)
 | |
| {
 | |
| 	/* XXXX Return the item of self indexed by key */
 | |
| }
 | |
| 
 | |
| static int
 | |
| $abbrev$_ass_sub($abbrev$object *self, PyObject *v, PyObject *w)
 | |
| {
 | |
| 	/* XXXX Put w in self under key v */
 | |
| 	return 0;
 | |
| }
 | |
| 
 | |
| static PyMappingMethods $abbrev$_as_mapping = {
 | |
| 	(inquiry)$abbrev$_length,		/*mp_length*/
 | |
| 	(binaryfunc)$abbrev$_subscript,		/*mp_subscript*/
 | |
| 	(objobjargproc)$abbrev$_ass_sub,	/*mp_ass_subscript*/
 | |
| };
 | |
| 
 | |
| /* -------------------------------------------------------- */
 |