mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Make basechain a class variable in stead of initializing it in __init__. That way it's more easily overridden.
This commit is contained in:
parent
08a898f85d
commit
1319abf745
1 changed files with 1 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ from bgenGeneratorGroup import GeneratorGroup
|
||||||
|
|
||||||
class ObjectDefinition(GeneratorGroup):
|
class ObjectDefinition(GeneratorGroup):
|
||||||
"Spit out code that together defines a new Python object type"
|
"Spit out code that together defines a new Python object type"
|
||||||
|
basechain = "NULL"
|
||||||
|
|
||||||
def __init__(self, name, prefix, itselftype):
|
def __init__(self, name, prefix, itselftype):
|
||||||
"""ObjectDefinition constructor. May be extended, but do not override.
|
"""ObjectDefinition constructor. May be extended, but do not override.
|
||||||
|
|
@ -21,7 +22,6 @@ class ObjectDefinition(GeneratorGroup):
|
||||||
self.typename = name + '_Type'
|
self.typename = name + '_Type'
|
||||||
self.argref = "" # set to "*" if arg to <type>_New should be pointer
|
self.argref = "" # set to "*" if arg to <type>_New should be pointer
|
||||||
self.static = "static " # set to "" to make <type>_New and <type>_Convert public
|
self.static = "static " # set to "" to make <type>_New and <type>_Convert public
|
||||||
self.basechain = "NULL" # set to &<basetype>_chain to chain methods
|
|
||||||
|
|
||||||
def add(self, g, dupcheck=0):
|
def add(self, g, dupcheck=0):
|
||||||
g.setselftype(self.objecttype, self.itselftype)
|
g.setselftype(self.objecttype, self.itselftype)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue