A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-checkins/2002-January/024266.html below:

[Python-checkins] CVS: python/dist/src/Mac/scripts gensuitemodule.py,1.20,1.21

[Python-checkins] CVS: python/dist/src/Mac/scripts gensuitemodule.py,1.20,1.21Jack Jansen jackjansen@users.sourceforge.net
Thu, 24 Jan 2002 14:44:09 -0800
Update of /cvsroot/python/python/dist/src/Mac/scripts
In directory usw-pr-cvs1:/tmp/cvs-serv22436/Python/Mac/scripts

Modified Files:
	gensuitemodule.py 
Log Message:
Get rid of keyword list and use keyword.iskeyword() function (which I wasn't aware of previously).

Index: gensuitemodule.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Mac/scripts/gensuitemodule.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** gensuitemodule.py	2002/01/24 12:36:51	1.20
--- gensuitemodule.py	2002/01/24 22:44:07	1.21
***************
*** 14,17 ****
--- 14,18 ----
  import StringIO
  import macfs
+ import keyword
  
  from Carbon.Res import *
***************
*** 817,826 ****
  	return '[%s]' % string.join(bits)
  	
- # Set of Python keywords (as of Python 2.2)
- illegal_ids = ["and", "elif", "global", "or", "assert", "else", "if", "pass", 
- 	"break", "except", "import", "print", "class", "exec", "in", "raise", 
- 	"continue", "finally", "is", "return", "def", "for", "lambda", "try", 
- 	"del", "from", "not", "while", "yield"]
- 
  def identify(str):
  	"""Turn any string into an identifier:
--- 818,821 ----
***************
*** 842,846 ****
  			rv = rv + '_%02.2x_'%ord(c)
  		ok = ok2
! 	if rv in illegal_ids:
  		rv = '_' + rv
  	return rv
--- 837,841 ----
  			rv = rv + '_%02.2x_'%ord(c)
  		ok = ok2
! 	if keyword.iskeyword(rv):
  		rv = '_' + rv
  	return rv
***************
*** 851,852 ****
--- 846,848 ----
  	main()
  	sys.exit(1)
+ print identify('for')
\ No newline at end of file




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4