[Python-checkins] commit of r41488 - python/trunk/Tools/bgen/bgen

jack.jansen@python.org jack.jansen at python.org
Mon Nov 21 14:24:26 CET 2005


Author: jack.jansen
Date: Mon Nov 21 14:24:25 2005
New Revision: 41488

Modified:
   python/trunk/Tools/bgen/bgen/   (props changed)
   python/trunk/Tools/bgen/bgen/bgenObjectDefinition.py
Log:
Enable optional "const" argument to _New routines.



Modified: python/trunk/Tools/bgen/bgen/bgenObjectDefinition.py
==============================================================================
--- python/trunk/Tools/bgen/bgen/bgenObjectDefinition.py	(original)
+++ python/trunk/Tools/bgen/bgen/bgenObjectDefinition.py	Mon Nov 21 14:24:25 2005
@@ -7,6 +7,7 @@
     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 @@
 
     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()


More information about the Python-checkins mailing list