[Python-checkins] CVS: python/dist/src/Python compile.c,2.163,2.164

Tim Peters tim_one@users.sourceforge.net
Fri, 16 Feb 2001 21:30:28 -0800


Update of /cvsroot/python/python/dist/src/Python
In directory usw-pr-cvs1:/tmp/cvs-serv1982/python/dist/src/Python

Modified Files:
	compile.c 
Log Message:
Change temp names created by listcomps from [%d] to _[%d], so the one-liner
    [k for k in dir() if k[0] != "_"]
can be used to get the non-private names (used to contain "[1]").


Index: compile.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v
retrieving revision 2.163
retrieving revision 2.164
diff -C2 -r2.163 -r2.164
*** compile.c	2001/02/12 16:01:03	2.163
--- compile.c	2001/02/17 05:30:26	2.164
***************
*** 1310,1314 ****
  	/* listmaker: test list_for */
  	char tmpname[12];
! 	sprintf(tmpname, "[%d]", ++c->c_tmpname);
  	com_addoparg(c, BUILD_LIST, 0);
  	com_addbyte(c, DUP_TOP); /* leave the result on the stack */
--- 1310,1314 ----
  	/* listmaker: test list_for */
  	char tmpname[12];
! 	sprintf(tmpname, "_[%d]", ++c->c_tmpname);
  	com_addoparg(c, BUILD_LIST, 0);
  	com_addbyte(c, DUP_TOP); /* leave the result on the stack */
***************
*** 4690,4694 ****
  	char tmpname[12];
  
! 	sprintf(tmpname, "[%d]", ++st->st_tmpname);
  	symtable_add_def(st, tmpname, DEF_LOCAL);
  	symtable_assign(st, CHILD(n, 1), 0);
--- 4690,4694 ----
  	char tmpname[12];
  
! 	sprintf(tmpname, "_[%d]", ++st->st_tmpname);
  	symtable_add_def(st, tmpname, DEF_LOCAL);
  	symtable_assign(st, CHILD(n, 1), 0);