En Thu, 14 Feb 2008 15:22:41 -0200, Jeff Schwab <[EMAIL PROTECTED]>  
escribió:
> Christian Heimes wrote:

>> No, print invokes the tp_print slot of the float type. Some core types
>> have a special handler for print. The tp_print slot is not available
>> from Python code and most people don't know about it. :]
>
> Why does print use the tp_print slot, rather than str()?  Are the two
> effectively redundant?  If (non-repr) string representations are
> frequently needed for a given type, could str() be implemented as a
> reference to tp_slot, via a C-language extension?

As a side note, the print statement has FIVE related opcodes. Looks like  
printing has been considered a very important operation...

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to