> Still, I hope you at least enjoyed my enthusiasm!
I did!
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
Hello,
It used to be that defining __int__ allowed an object to be accepted as
an integer from various functions, internal and third-party, thanks to
being implicitly called by e.g. PyLong_AsLong.
Today, and since bpo-37999, this is no longer the case. It seems that
__int__ has now become a st
Hi there, I have a reminder for you if you are:
- a core developer; or
- on the triage team; or
- a mentee in core-mentorship.
We are running an online core sprint next week (October 18 - 24). "Online"
means on our internal Core Python Discord. Join us there to plan and chat! You
can even get a
13.10.21 20:10, Antoine Pitrou пише:
> It used to be that defining __int__ allowed an object to be accepted as
> an integer from various functions, internal and third-party, thanks to
> being implicitly called by e.g. PyLong_AsLong.
>
> Today, and since bpo-37999, this is no longer the case. It s
On 14/10/21 6:10 am, Antoine Pitrou wrote:
It seems that
__int__ has now become a strict equivalent to __trunc__.
Not really -- __int__ is expected to return something of type
int, whereas __trunc__ is expected to return the same type as
its operand.
--
Greg
___
On 14/10/21 11:19 am, Greg Ewing wrote:
Not really -- __int__ is expected to return something of type
int, whereas __trunc__ is expected to return the same type as
its operand.
Scratch that, it seems __trunc__ also returns an int, at least
for floats. Not sure what the logic behind that is.
Th
Hi Antoine,
I have a lot of troubles to reminder how Python converts numbers, I
collected notes about the Python "number tower" and the C
implementation:
https://pythondev.readthedocs.io/numbers.html
Honestly, I don't understand well the difference between __int__() and
__index__().
* https://do
On Thu, Oct 14, 2021 at 10:51 AM Victor Stinner wrote:
>
> Honestly, I don't understand well the difference between __int__() and
> __index__().
>
> * https://docs.python.org/dev/reference/datamodel.html#object.__int__
> * https://docs.python.org/dev/reference/datamodel.html#object.__index__
__in
On Wed, Oct 13, 2021 at 4:56 PM Victor Stinner wrote:
> Honestly, I don't understand well the difference between __int__() and
> __index__().
>
> * https://docs.python.org/dev/reference/datamodel.html#object.__int__
> * https://docs.python.org/dev/reference/datamodel.html#object.__index__
>
If y
On Thu, 14 Oct 2021 11:52:11 +1300
Greg Ewing wrote:
> On 14/10/21 11:19 am, Greg Ewing wrote:
> > Not really -- __int__ is expected to return something of type
> > int, whereas __trunc__ is expected to return the same type as
> > its operand.
>
> Scratch that, it seems __trunc__ also returns
On Thu, Oct 14, 2021 at 11:52:11AM +1300, Greg Ewing wrote:
> Scratch that, it seems __trunc__ also returns an int, at least
> for floats. Not sure what the logic behind that is.
I'm not sure about the logic either, but it is documented as returning
an Integral:
"Truncates the Real x to the nea
11 matches
Mail list logo