diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2005-11-21 13:24:25 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2005-11-21 13:24:25 (GMT) |
commit | 09eef173b26c073921609688deb08d0e567d8a30 (patch) | |
tree | aecb3d1a1bc8be1d328da42fa419c00e6a452f33 /Tools/bgen | |
parent | 7bcabc60a36eb5910bd162d54ece449f5249bbcd (diff) | |
download | cpython-09eef173b26c073921609688deb08d0e567d8a30.zip cpython-09eef173b26c073921609688deb08d0e567d8a30.tar.gz cpython-09eef173b26c073921609688deb08d0e567d8a30.tar.bz2 |
Enable optional "const" argument to _New routines.
Diffstat (limited to 'Tools/bgen')
-rw-r--r-- | Tools/bgen/bgen/bgenObjectDefinition.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Tools/bgen/bgen/bgenObjectDefinition.py b/Tools/bgen/bgen/bgenObjectDefinition.py index 6fc65ad..1a44ca4 100644 --- a/Tools/bgen/bgen/bgenObjectDefinition.py +++ b/Tools/bgen/bgen/bgenObjectDefinition.py @@ -7,6 +7,7 @@ class ObjectDefinition(GeneratorGroup): tp_flags = "Py_TPFLAGS_DEFAULT" basetype = None argref = "" # set to "*" if arg to <type>_New should be pointer + argconst = "" # set to "const " if arg to <type>_New should be const def __init__(self, name, prefix, itselftype): """ObjectDefinition constructor. May be extended, but do not override. @@ -97,8 +98,8 @@ class ObjectDefinition(GeneratorGroup): def outputNew(self): Output() - Output("%sPyObject *%s_New(%s %sitself)", self.static, self.prefix, - self.itselftype, self.argref) + Output("%sPyObject *%s_New(%s%s %sitself)", self.static, self.prefix, + self.argconst, self.itselftype, self.argref) OutLbrace() Output("%s *it;", self.objecttype) self.outputCheckNewArg() |