my own type, print function

Torsten Mohr tmohr at s.netic.de
Mon Sep 13 16:34:34 EDT 2004


Hi,

>> i have created an own type in C and have implemented
>> the print function for it.
> 
> I'm not sure what your problem is, but my advice is: don't do that :)
> 
> I.e. don't fill out the tp_print slot of your type object unless your
> object type has such a long printed representation that going via a
> string representation is grossly inefficent.

Ok, i'll try that, but i still wonder why it crashes my python
interpreter.  I'd like to understand that, also, i can't see what
COULD be wrong, i just do a normal fprintf() on the FILE* that
i get as a parameter.


Best regards,
Torsten.





More information about the Python-list mailing list