New submission from STINNER Victor [EMAIL PROTECTED]:
It's hard to read Objects/longobject.c because the code depends to
much on the implementation. I wrote macros to simplify the code:
- PyLong_SIGN(x)
- PyLong_EQUALS_ZERO(x)
- PyLong_FITS_INT(x)
- PyLong_GET_INT(x)
- PyLong_NDIGITS(x)
Mark Dickinson [EMAIL PROTECTED] added the comment:
Here's a minor update to the patch, that does some extra cleanup:
- don't include longintrepr.h in Objects/abstract.c or
Objects/boolobject.c --- it's not needed.
- fix several places in longobject.c where int should have been size_t
or
Changes by STINNER Victor [EMAIL PROTECTED]:
--
nosy: +brett.cannon
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4282
___
___
Python-bugs-list mailing
Mark Dickinson [EMAIL PROTECTED] added the comment:
Another thought: macros that are going to be used elsewhere in Python
(like the way you're using PyLong_SIGN in mathmodule.c) would probably
be better off in longobject.h. The fewer places there are that have to
include longintrepr.h, the
STINNER Victor [EMAIL PROTECTED] added the comment:
Second patch to optimize some PyLong operations:
- Write special code for small (a, b) of long_true_div(),
long_bitwise(), and l_divmod() (used by long_div(), long_mod() and
long_divmod(), and long_pow())
- PyLong_FromLong(): don't go to
STINNER Victor [EMAIL PROTECTED] added the comment:
What's the purpose of your sdigit?
The type sdigit should be able to store a signed digit, so a number in
[-(2^15-1); 2^15-1]. short may be enough, but I think that the CPU
prefers (CPU is faster with) an int because it doesn't have to
Changes by Kristján Valur Jónsson [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11974/pendingalls.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4293
___
Mark Dickinson [EMAIL PROTECTED] added the comment:
Same: it's better to write a separated patch.
Agreed.
Unfortunately, I think all of this is going to have to wait for Python
3.0 to be released before we can consider committing anything. The
first step is to commit the pure bugfixes
New submission from Kristján Valur Jónsson [EMAIL PROTECTED]:
At CCP We have started using the Py_AddPendingCall() mechanism to
signal python about a completed IO operation.
However, we noticed that the existing mechanism was hoplelessly un-
thread safe. This is bad, since on Windows at least,
STINNER Victor [EMAIL PROTECTED] added the comment:
@marketdickinson: As you proposed, here is a patch for
_PyLong_AsScaledDouble(): stores directly the number of bits in an
unsigned int instead of the number of digits.
Added file: http://bugs.python.org/file11979/pylong_asscaleddouble.patch
Kristján Valur Jónsson [EMAIL PROTECTED] added the comment:
Good point. I'll make a test using ctypes and _testcapimodule.c to try
to make it as non-platform-specific as possible.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4293
Ondrej Certik [EMAIL PROTECTED] added the comment:
Author: STINNER Victor (haypo):
You would like to replace from mptypes import ... by from .mptypes
import Is it really a bug? Python is unable to guess if mptypes,
functions or settings are global modules or relative modules. Why
don't
Christian Heimes [EMAIL PROTECTED] added the comment:
I like the idea, Victor
--
nosy: +christian.heimes
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4294
___
Changes by Martin v. Löwis [EMAIL PROTECTED]:
--
versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4294
___
STINNER Victor [EMAIL PROTECTED] added the comment:
Ooops, I replied to the wrong issue (#4292) :-p
My test was wrong: yes, 2to3 needs a patch. I wrote one (with no test
yet).
--
nosy: +haypo
Added file: http://bugs.python.org/file11973/2to3_fix_import.py
Changes by STINNER Victor [EMAIL PROTECTED]:
--
title: (Python3) The profile module deesn't understand the character set
definition - exec(unicode): invalid charset when #coding:xxx spec is used
___
Python tracker [EMAIL PROTECTED]
STINNER Victor [EMAIL PROTECTED] added the comment:
You would like to replace from mptypes import ... by from .mptypes
import Is it really a bug? Python is unable to guess if mptypes,
functions or settings are global modules or relative modules. Why
don't you patch your original code
Changes by Benjamin Peterson [EMAIL PROTECTED]:
--
assignee: - benjamin.peterson
nosy: +benjamin.peterson
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4292
___
Changes by STINNER Victor [EMAIL PROTECTED]:
--
nosy: +gregory.p.smith, marketdickinson
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4294
___
___
Ondrej Certik [EMAIL PROTECTED] added the comment:
Hi Victor, thanks for the comments. I copied them to the issue 4292
where they belong and replied there.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4290
Ondrej Certik [EMAIL PROTECTED] added the comment:
You would like to replace from mptypes import ... by from .mptypes
import
Yes, exactly, see the patch where I did that.
Is it really a bug? Python is unable to guess if mptypes,
functions or settings are global modules or relative
Mark Dickinson [EMAIL PROTECTED] added the comment:
Interesting.
Incidentally, I'm already using sdigit for the signed version of digit---
this seems to fit with the current digit/twodigits/stwodigits typedefs.
What's the purpose of your sdigit? Do you really want it to be type
'int'?
Changes by STINNER Victor [EMAIL PROTECTED]:
--
nosy: +haypo
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3720
___
___
Python-bugs-list mailing list
Christian Heimes [EMAIL PROTECTED] added the comment:
Your patch sounds like a useful addition. However I can comment on the
details because I haven't dealt with Py_AddPendingCall() yet.
Documentation updates and a unit test (Modules/_testcapimodule.c), that
shows the bug and verifies your
STINNER Victor [EMAIL PROTECTED] added the comment:
Other optimization for long_compare(), long_lshift() and
long_rshift().
Note: with all my patches, Python is a little bit faster (but not
slower, which is already a good thing ;-)).
Added file:
Andy [EMAIL PROTECTED] added the comment:
Martin:
Looking at it I agree with you 100% - the patch is too complicated for
what it is intending to resolve. It simply does not need another
accessor function to muddy the waters when making the symbol public as
done in #4288 resolves the issue.
Stefan Behnel [EMAIL PROTECTED] added the comment:
This is an (extended) duplicate of issue4152.
--
nosy: +scoder
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4244
___
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Second metaclass problem fixed in r67178.
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4290
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Fixed in r67179.
Ondrej, thanks for running 2to3 over sympy and finding all these tasty bugs!
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
Ondrej Certik [EMAIL PROTECTED] added the comment:
Benjamin, thanks for the fantastic work!
I discovered more bugs, but this time I reported to the py3000 list, as
I need more feedback on it. But it seems you'll get another tasty bug
for the 2to3, among other things. :)
Ondrej Certik [EMAIL PROTECTED] added the comment:
I can confirm this is now fixed. Thanks very much!
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4290
___
___
Zooko O'Whielacronx [EMAIL PROTECTED] added the comment:
I opened a ticket on the cygwin issue tracker:
http://sourceware.org/bugzilla/show_bug.cgi?id=7017 # closing stdout in a
child python process means that process doesn't receive bytes from stdin
anymore. I think.
Mark Dickinson [EMAIL PROTECTED] added the comment:
There are so many things going on here it's getting difficult to keep
track of them all! Not only Victor's stuff, but also Mario's patches
for faster multiplication, and for subquadratic division. And it might
be interesting to experiment
STINNER Victor [EMAIL PROTECTED] added the comment:
I'm unable to use pystone nor pybench to compare all integers patches.
So I wrote my own tool: bench_int.py. Don't use to compare different
computers or Python versions, it's just useful to test if a patch is
faster or slower.
Example
New submission from Michael B Curtis [EMAIL PROTECTED]:
Found in Python 2.4; not sure what other versions may be affected.
I noticed a contradiction with regards to equivalence when experimenting
with NaN, which has the special property that it is itself, but it
doesn't == itself:
a =
Christian Heimes [EMAIL PROTECTED] added the comment:
Interesting, Python 3.0 behaves differently than Python 2.x. Nice catch! :)
Python 3.0rc2 (r30rc2:67177, Nov 10 2008, 12:12:09)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type help, copyright, credits or license for more information.
nan
Changes by STINNER Victor [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11947/30bit_longdigit3.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4258
___
STINNER Victor [EMAIL PROTECTED] added the comment:
Using 30bit_longdigit4.patch, I get this
error: Objects/longobject.c:700: erreur: SIZE_T_MAX undeclared
(first use in this function). You might use the type Py_ssize_t with
PY_SSIZE_T_MAX. I used INT_MAX to compile the code.
Changes by STINNER Victor [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11567/longobject_diff
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3944
___
Changes by STINNER Victor [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11595/longobject1.diff
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3944
___
STINNER Victor [EMAIL PROTECTED] added the comment:
More numbers!
-- 64 bits CPU ---
original: 885.0 ms
fast long: 746.8 ms (+16%) -- issue #3944
--
+16% only with an optimized multiplicaton, great job Pernici :-)
-- 32 bits CPU ---
original: 1564.3
STINNER Victor [EMAIL PROTECTED] added the comment:
I like the idea of sys.int_info, but I would prefer a base attribute
than bits_per_digit. A base different than 2^n might be used (eg. a
base like 10^n for fast conversion from/to string).
___
Python
Changes by STINNER Victor [EMAIL PROTECTED]:
--
keywords: +needs review
stage: - patch review
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3439
___
STINNER Victor [EMAIL PROTECTED] added the comment:
See http://code.google.com/p/python-multiprocessing/ project.
--
nosy: +haypo
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue4208
___
STINNER Victor [EMAIL PROTECTED] added the comment:
If you doesn't care to the time zone (UTC), use:
datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=-86400)
datetime.datetime(1969, 12, 31, 0, 0)
This code is portable on Windows, Linux but also works with
IronPython:
STINNER Victor [EMAIL PROTECTED] added the comment:
See also issue2736
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1673409
___
___
Python-bugs-list mailing
STINNER Victor [EMAIL PROTECTED] added the comment:
The current behaviour is consistent with the integer divison:
21 // 10
2
timedelta(microseconds=20) // 10
datetime.timedelta(0, 0, 2)
Whereas int/int gives float:
21 / 10
2.1001
timedelta(microseconds=20) / 1
...
TypeError:
STINNER Victor [EMAIL PROTECTED] added the comment:
Can you retry with Python 3.0rc2?
--
nosy: +haypo
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2173
___
STINNER Victor [EMAIL PROTECTED] added the comment:
See also issue1673409
--
nosy: +haypo
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue2736
___
___
STINNER Victor [EMAIL PROTECTED] added the comment:
The patch doesn't work on Python3 because Python3 changes
time.strftime() for year 1900: if time.accept2dyear is not False (or
not set), raise an error; otherwise convert 0..68 = 2000..2068,
69..99 = 1968..1999, or raise an error.
STINNER Victor [EMAIL PROTECTED] added the comment:
The patch is correct. I tried to use errno, but errno is unchanged on
error. Here is a new patch with regression tests.
--
nosy: +haypo
versions: +Python 2.7, Python 3.1
Added file:
STINNER Victor [EMAIL PROTECTED] added the comment:
The issue #1777412 has a working patch (for Python 2.6) which allows
year 1900 in time.strftime() and datetime.datetime.strftime().
--
nosy: +haypo
___
Python tracker [EMAIL PROTECTED]
Alexander Belopolsky [EMAIL PROTECTED] added the comment:
amaury What if PyGC_Collect() is called just before?
That would work. With the following patch:
===
--- Python/import.c (revision 67183)
+++ Python/import.c
Changes by Alexander Belopolsky [EMAIL PROTECTED]:
--
versions: +Python 2.5.3, Python 2.6, Python 2.7
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1545463
___
54 matches
Mail list logo