In Cython, in order to have a class that has C methods (i.e. methods defined using the keywords cpdef
or cdef
), one needs to define a cdef
class: http://docs.cython.org/src/tutorial/cdef_classes.html
Does such a class have a method to access one of its attributes by a string representing the name of the attribute (the corresponding method would be setattr()
in standard Python)?
I believe that if it's a cdef public class
, Cython
will incur the overhead needed to add Python properties that should let you use the Python built-in setattr
(it's not a method, it's a built-in Python function).
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments