From: Peter Johnson Date: Fri, 1 Jan 2010 20:52:25 +0000 (-0000) Subject: All Pyrex files: Use __cinit__ instead of __new__ in extension classes. X-Git-Tag: v1.0.0~57 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4df9f87323a12af47df42c6847ceaa1b9689eea0;p=yasm All Pyrex files: Use __cinit__ instead of __new__ in extension classes. svn path=/trunk/yasm/; revision=2254 --- diff --git a/tools/python-yasm/bytecode.pxi b/tools/python-yasm/bytecode.pxi index 193e3a6c..34aeaa57 100644 --- a/tools/python-yasm/bytecode.pxi +++ b/tools/python-yasm/bytecode.pxi @@ -28,7 +28,7 @@ cdef class Bytecode: cdef object __weakref__ # make weak-referenceable - def __new__(self, bc): + def __cinit__(self, bc): self.bc = NULL if PyCObject_Check(bc): self.bc = __get_voidp(bc, Bytecode) diff --git a/tools/python-yasm/expr.pxi b/tools/python-yasm/expr.pxi index dea75d78..995a46ad 100644 --- a/tools/python-yasm/expr.pxi +++ b/tools/python-yasm/expr.pxi @@ -59,7 +59,7 @@ cdef object __make_expression(yasm_expr *expr): cdef class Expression: cdef yasm_expr *expr - def __new__(self, op, *args, **kwargs): + def __cinit__(self, op, *args, **kwargs): self.expr = NULL if isinstance(op, Expression): diff --git a/tools/python-yasm/floatnum.pxi b/tools/python-yasm/floatnum.pxi index 3939056f..b7bfbc30 100644 --- a/tools/python-yasm/floatnum.pxi +++ b/tools/python-yasm/floatnum.pxi @@ -25,7 +25,7 @@ cdef class FloatNum: cdef yasm_floatnum *flt - def __new__(self, value): + def __cinit__(self, value): self.flt = NULL if isinstance(value, FloatNum): self.flt = yasm_floatnum_copy((value).flt) diff --git a/tools/python-yasm/intnum.pxi b/tools/python-yasm/intnum.pxi index f99769e6..0b469b89 100644 --- a/tools/python-yasm/intnum.pxi +++ b/tools/python-yasm/intnum.pxi @@ -57,7 +57,7 @@ cdef object __make_intnum(yasm_intnum *intn): cdef class IntNum: cdef yasm_intnum *intn - def __new__(self, value, base=None): + def __cinit__(self, value, base=None): cdef unsigned char buf[16] self.intn = NULL diff --git a/tools/python-yasm/symrec.pxi b/tools/python-yasm/symrec.pxi index d91fe7f5..404ffe97 100644 --- a/tools/python-yasm/symrec.pxi +++ b/tools/python-yasm/symrec.pxi @@ -26,7 +26,7 @@ cdef class Symbol: cdef yasm_symrec *sym - def __new__(self, symrec): + def __cinit__(self, symrec): self.sym = NULL if PyCObject_Check(symrec): self.sym = __get_voidp(symrec, Symbol) @@ -124,7 +124,7 @@ cdef class SymbolTable cdef class SymbolTableKeyIterator: cdef yasm_symtab_iter *iter - def __new__(self, symtab): + def __cinit__(self, symtab): if not isinstance(symtab, SymbolTable): raise TypeError self.iter = yasm_symtab_first((symtab).symtab) @@ -142,7 +142,7 @@ cdef class SymbolTableKeyIterator: cdef class SymbolTableValueIterator: cdef yasm_symtab_iter *iter - def __new__(self, symtab): + def __cinit__(self, symtab): if not isinstance(symtab, SymbolTable): raise TypeError self.iter = yasm_symtab_first((symtab).symtab) @@ -160,7 +160,7 @@ cdef class SymbolTableValueIterator: cdef class SymbolTableItemIterator: cdef yasm_symtab_iter *iter - def __new__(self, symtab): + def __cinit__(self, symtab): if not isinstance(symtab, SymbolTable): raise TypeError self.iter = yasm_symtab_first((symtab).symtab) @@ -190,7 +190,7 @@ cdef int __parse_vis(vis) except -1: cdef class SymbolTable: cdef yasm_symtab *symtab - def __new__(self): + def __cinit__(self): self.symtab = yasm_symtab_create() def __dealloc__(self): diff --git a/tools/python-yasm/value.pxi b/tools/python-yasm/value.pxi index f2328dd4..5d78c054 100644 --- a/tools/python-yasm/value.pxi +++ b/tools/python-yasm/value.pxi @@ -25,7 +25,7 @@ cdef class Value: cdef yasm_value value - def __new__(self, value=None, size=None): + def __cinit__(self, value=None, size=None): cdef unsigned int sz if size is None: sz = 0