A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-January/076642.html below:

[Python-Dev] Slot for __trunc__

[Python-Dev] Slot for __trunc__ [Python-Dev] Slot for __trunc__Eric Smith eric+python-dev at trueblade.com
Tue Jan 29 20:37:43 CET 2008
Raymond Hettinger wrote:
> [GvR]
>> I don't see why. __index__ has a slot because its 
>> primary use is to be called from C code, where slots
>> add a slight performance advantage.
>> __trunc__ doesn't get called from C AFAIK. 
> 
> I thought the __trunc__ method only gets called from 
> the C code for the trunc() function which is currently
> implemented with PyObject_CallMethod(number, "__trunc__", "")
> instead of a fast call to a slot.

And if __trunc__ qualifies, what about __format__, which is similar? 
I'm not pushing for it, I just wonder how the decision is made.

Eric.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4