On Thu, 14 Oct 2021 04:24:30 -0500 Eryk Sun <eryk...@gmail.com> wrote: > > > Note that PyNumber_Long() is now the only place inside the interpreter > > calling the `nb_int` slot. But since it also has those undesirable code > > paths accepting str and buffer-like objects, it's usable in fewer > > situations than you'd expect. > > Maybe an alternate constructor could be added -- such as > int.from_number() -- which would be restricted to calling __int__(), > __index__(), and __trunc__().
Perhaps. And ideally there would be a corresponding C API. Regards Antoine. _______________________________________________ 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 https://mail.python.org/archives/list/python-dev@python.org/message/GL4XG2OW2ZZ7F45ILP4756WT5ALCVBOE/ Code of Conduct: http://python.org/psf/codeofconduct/