Mark Dickinson added the comment:
Here's an updated patch, for PyLong_AsUnsignedLongAndOverflow only, including
docs and tests.
--
keywords: +patch
Added file:
http://bugs.python.org/file34846/pylong_as_unsigned_long_and_overflow.patch
___
Python
STINNER Victor added the comment:
P.P.S.: Just a random idea: would it be a to rewrite PyLong to use GMP
instead as a PyVarObject of mp_limb_t's?
I'll let Victor answer that one. :-) In the mean time, see issue 1814.
During the development of Python 3.0, I wrote a large patch to reuse
Hristo Venev added the comment:
I will not add PyLong_AsUnsigned*AndOverflow in my code because I don't want my
code to depend on the exact implementation of PyLong.
Are you seriously calling a 50-line function feature?
Anyway... I propose splitting the patch in two parts:
- cleanup: the
Mark Dickinson added the comment:
Thanks for the patch! I left a couple of comments on Rietveld. The patch will
also need docs and tests before it's ready to go in.
There's a behaviour change in the patch which needs looking into: before the
patch, PyLong_AsUnsignedLong will not call the
Hristo Venev added the comment:
I did not intend to make it so that PyLong_AsUnsignedLong* to call __int__ but
it looks like a good idea because PyLong_AsLong* does that and the patch is
exactly about that - removing differences between converting to signed and
unsigned.
Should I upload the
Mark Dickinson added the comment:
it looks like a good idea
It's not a good idea, though: you risk breaking existing third-party extension
modules in surprising ways, which isn't a friendly thing to do. In any case,
if anything the PyLong methods should be moving *away* from use of the
Hristo Venev added the comment:
Please apply in 3.4.1. I need this ASAP.
--
versions: +Python 3.4 -Python 3.5
Added file: http://bugs.python.org/file34738/a
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
STINNER Victor added the comment:
Please apply in 3.4.1. I need this ASAP.
New functions are new features, and new features are no more added after a
release (ex: 3.4.0). If something is changed, it will done in Python 3.5.
You can add PyLong_AsUnsigned*AndOverflow() functions to your
Hristo Venev added the comment:
Will you release 3.5 in the next few weeks?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
___
___
Benjamin Peterson added the comment:
No
--
nosy: +benjamin.peterson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
___
___
Python-bugs-list
Mark Dickinson added the comment:
Sounds reasonable to me. Were there particular uses you needed this for? And
do you want to work on a patch?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
STINNER Victor added the comment:
Sounds reasonable to me. Were there particular uses you needed this for?
And do you want to work on a patch?
I don't understand why PyArg_Parse*() functions have formats for integers
checking overflow for signed integers, but not for unsigned integers.
Changes by Mark Dickinson dicki...@gmail.com:
--
components: +Interpreter Core -Extension Modules
stage: - needs patch
type: - enhancement
versions: +Python 3.5 -Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
New submission from Hristo Venev:
It could set *overflow to -1 on negative value and to 1 on overflow.
And PyLong_AsUnsignedLongLongAndOverflow.
--
components: Extension Modules
messages: 215236
nosy: h.venev
priority: normal
severity: normal
status: open
title:
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2
___
___
15 matches
Mail list logo