mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
String method conversion.
This commit is contained in:
parent
c9838f9fcb
commit
be18552874
1 changed files with 1 additions and 2 deletions
|
@ -195,12 +195,11 @@ SRE_INFO_LITERAL = 2 # entire pattern is literal (given by prefix)
|
||||||
SRE_INFO_CHARSET = 4 # pattern starts with character from given set
|
SRE_INFO_CHARSET = 4 # pattern starts with character from given set
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import string
|
|
||||||
def dump(f, d, prefix):
|
def dump(f, d, prefix):
|
||||||
items = d.items()
|
items = d.items()
|
||||||
items.sort(lambda a, b: cmp(a[1], b[1]))
|
items.sort(lambda a, b: cmp(a[1], b[1]))
|
||||||
for k, v in items:
|
for k, v in items:
|
||||||
f.write("#define %s_%s %s\n" % (prefix, string.upper(k), v))
|
f.write("#define %s_%s %s\n" % (prefix, k.upper(), v))
|
||||||
f = open("sre_constants.h", "w")
|
f = open("sre_constants.h", "w")
|
||||||
f.write("""\
|
f.write("""\
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue