J
Jeff Rush
While I have a reasonable understanding of the differences in new-style versus
old-style classes, tonight while working a C extension module I realized I
don't know how to indicate which style my C extension module should appear as.
I'm following the Python docs for extended modules, but it doesn't say in
there anyplace I can find which style I'm creating. My clue that something
was wrong is when this:
from cextension import Context
class MyContext(Context):
def __init__(self):
super(Context, self).__init__()
repeatedly and reliably failed with a corrupted C data structure, while this:
class MyContext(Context):
def __init__(self):
Context.__init__()
worked without any problems. As I understand it, the former uses new-style
semantics while the latter uses old-style, and -thats- when I realized I have
no idea which my C extension implemented.
Any enlightenment?
-Jeff
old-style classes, tonight while working a C extension module I realized I
don't know how to indicate which style my C extension module should appear as.
I'm following the Python docs for extended modules, but it doesn't say in
there anyplace I can find which style I'm creating. My clue that something
was wrong is when this:
from cextension import Context
class MyContext(Context):
def __init__(self):
super(Context, self).__init__()
repeatedly and reliably failed with a corrupted C data structure, while this:
class MyContext(Context):
def __init__(self):
Context.__init__()
worked without any problems. As I understand it, the former uses new-style
semantics while the latter uses old-style, and -thats- when I realized I have
no idea which my C extension implemented.
Any enlightenment?
-Jeff