New submission from Stefan Krah:
http://speleotrove.com/decimal/daops.html#refpower
--
nosy: +skrah
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Stefan Krah added the comment:
Could you explain warning #4232 in the case of libmpdec? I thought
all files are compiled and linked together. Why is the function
imported?
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/issue25
Stefan Krah added the comment:
Ah, thanks! I guess this Visual Studio behavior is not compatible
with the C-standard, but indeed there are no function pointer
comparisons in libmpdec.
--
___
Python tracker
<http://bugs.python.org/issue25
Stefan Krah added the comment:
I would expect linking to behave "as if" the abstract machine defined
by the standard were executing the code.
We already had one function pointer equality issue due to COMDAT folding,
so I agree that we should leave the
Changes by Stefan Krah :
--
nosy: skrah
priority: normal
severity: normal
status: open
title: Disable /W4 warning (non-standard dllimport behavior)
___
Python tracker
<http://bugs.python.org/issue26
New submission from Stefan Krah:
See: #25878
--
assignee: skrah
components: Extension Modules
messages: 258461
nosy: skrah
priority: normal
severity: normal
status: open
title: libmpdec: disable /W4 warning (non-standard dllimport behavior)
type: compile error
versions: Python 3.6
Changes by Stefan Krah :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
type: -> compile error
___
Python tracker
<http://bugs.python
Changes by Stefan Krah :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue26139>
___
Stefan Krah added the comment:
Pragma added for libmpdec in #26139.
--
___
Python tracker
<http://bugs.python.org/issue25878>
___
___
Python-bugs-list mailin
Stefan Krah added the comment:
This is *exactly* what I want. As the sole author of libmpdec I *know*
that the broken dllimport behavior cannot affect anything in memory.c,
since there are no function pointer comparisons.
Please stop educating us
Stefan Krah added the comment:
1) Feedback whether the compiler used on FreeBSD recognizes FENV_ACCESS.
2) If not, an indication why the man page mentions it.
--
___
Python tracker
<http://bugs.python.org/issue24
Stefan Krah added the comment:
Thanks, then the patch looks good to me.
--
___
Python tracker
<http://bugs.python.org/issue24520>
___
___
Python-bugs-list mailin
Stefan Krah added the comment:
I agree, and that's pretty much what Guido said here, too:
https://mail.python.org/pipermail/python-dev/2001-February/012591.html
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/is
Stefan Krah added the comment:
Yes, ideally the exceptions should be in sync. I don't find the list
of signals entirely uninteresting, but implementing it in _pydecimal
would require #8613 to be solved, which is unlikely to happen.
In _decimal the exceptions come directly from libmpdec,
Changes by Stefan Krah :
--
stage: -> needs patch
type: -> enhancement
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue26208>
___
___
Stefan Krah added the comment:
The spec was the only reasonable choice at the time decimal.py was
written. Incidentally, it is basically IEEE-754-2008 with arbitrary
precision extensions; this isn't surprising since Mike Cowlishaw was
on the IEEE committee and wrote the spec at the same
Stefan Krah added the comment:
Jurjen, this is very nice! -- Like Mark, I'm not sure if this should be in
CPython.
Decimal (Python >= 3.3) has sneaked in a couple of fast bignum
algorithms, so calculating and converting the latest Mersenne
prime takes a couple of seconds:
from decima
Stefan Krah added the comment:
On Wed, Feb 03, 2016 at 09:51:53AM +, STINNER Victor wrote:
> Well, nowhere means:
> https://docs.python.org/dev/whatsnew/3.3.html#decimal
Okay, but hardly anyone reads that, and I can't blame them. :)
For example, if I use something like Lua, I w
Stefan Krah added the comment:
In my experience it is very hard to get stable benchmark results with Python.
Even long running benchmarks on an empty machine vary:
wget http://www.bytereef.org/software/mpdecimal/benchmarks/telco.py
wget http://speleotrove.com/decimal/expon180-1e6b.zip
unzip
Stefan Krah added the comment:
I've cut off the highest result in the previous message:
Control totals:
Actual ['1004737.58', '57628.30', '25042.17']
Expected ['1004737.58', '57628.30', '25042.17
Stefan Krah added the comment:
Core 1 fluctuates even more (My machine only has 2 cores):
$ taskset -c 1 ./python telco.py full
Control totals:
Actual ['1004737.58', '57628.30', '25042.17']
Expected ['1004737.58', '57628.30', '2
Stefan Krah added the comment:
> STINNER Victor added the comment:
> I modified Stefan's telco.py to remove all I/O from the hot code: the
> benchmark is now really CPU-bound. I also modified telco.py to run the
> benchmark 5 times. One run takes around 2.6 seconds.
>
Nic
New submission from Stefan Krah:
The telco benchmark is unstable. It needs some of Victor's changes from #26275
and probably a larger data set:
http://speleotrove.com/decimal/expon180-1e6b.zip is too big for
_pydecimal, but the one that is used is probably too small for
_de
Stefan Krah added the comment:
It's instructive to run ./python Modules/_decimal/tests/bench.py (Hit Ctrl-C
after the first cdecimal result, 5 repetitions or so).
fastint2.patch speeds up floats enormously and slows down decimal by 6%.
fastint_alt.patch slows down float *and* decimal (5%
Stefan Krah added the comment:
I've never seen 20% fluctuation in that benchmark between runs. The benchmark
is very stable if you take the average of 10 runs.
--
___
Python tracker
<http://bugs.python.org/is
Stefan Krah added the comment:
I mean, if you run the benchmark 10 times and the unpatched result is always
between 11.3 and 12.0 for floats while the patched result is
between 12.3 and 12.9, for me the situation is clear.
--
___
Python tracker
Stefan Krah added the comment:
I thought this was the usual telco benchmark instability, but with the patch
_decimal *does* seem to be faster in other areas, too.
--
___
Python tracker
<http://bugs.python.org/issue26
Stefan Krah added the comment:
Additionally, "single digit will always fit a double"?
--
nosy: +skrah
___
Python tracker
<http://bugs.python.o
Stefan Krah added the comment:
Sorry, I was a bit brief: The current comment says "decimal" instead of
"double". It should be changed to "double".
--
___
Python tracker
<
Stefan Krah added the comment:
The comment looks good to me -- I'll stay out of the benchmarking issue, I
didn't check any of that. :)
--
___
Python tracker
<http://bugs.python.o
Stefan Krah added the comment:
Well I *did* run the decimal/float milli-benchmark now and it shows at least
15% improvement for floats consistently.
Given that the official benchmark suite does not seem to be very stable either
(#21955), I actually prefer small and well-understood benchmarks
Stefan Krah added the comment:
Unfortunately, replacing io.BytesIO(data) with indexing does not make the
benchmark faster or more stable on my machine.
BTW, string conversion of the result is actually a crucial part of
the benchmark, it was taken out in
http://bugs.python.org/file41802
Changes by Stefan Krah :
--
title: FIx telco benchmark -> Fix telco benchmark
___
Python tracker
<http://bugs.python.org/issue26284>
___
___
Python-bugs-lis
Stefan Krah added the comment:
#26288 brought a great speedup for floats. With fastint5_4.patch *on top of
#26288* I see no improvement for floats and a big slowdown for _decimal.
--
___
Python tracker
<http://bugs.python.org/issue21
Stefan Krah added the comment:
As Serhiy mentioned, I'm really happy with the Py_SETREF() macro and I
understand the reasons why it was applied so broadly.
But if a module maintainer prefers not to change existing (and
correct) code, then that should have priority (also, the existing
ve
Stefan Krah added the comment:
I like the feature for literals, but I'm not sure about conversions from
string. It slows down the conversion for (IMO) a very small benefit.
Other languages allow it, but I've never attempted to use the feature:
$ ocaml
OCaml vers
Stefan Krah added the comment:
If the string conversions stay, may I suggest two functions:
1) PyUnicode_NumericAsAscii()
2) PyUnicode_NumericAsAsciiWS()
The first one eliminates only underscores, the second one both
underscores and leading/trailing whitespace.
Decimal must support both
Stefan Krah added the comment:
Correction: The explanation of the functions should be reversed.
--
___
Python tracker
<http://bugs.python.org/issue26331>
___
___
Stefan Krah added the comment:
> Georg Brandl added the comment:
>
> Thanks, I hadn't looked at cdecimal yet - I was planning to ask you to do the
> necessary changes there :)
Oh, well. :)
> But there are a few versions of this (e.g. converting unicode digits to
Stefan Krah added the comment:
I still wonder about the complexity of all this for decimal. We now have two
grammars on top of each other, this being the actual one for decimal:
http://speleotrove.com/decimal/daconvs.html
For string conversions I'd prefer a lax way (similar to OCaml)
Stefan Krah added the comment:
Telco is a real world workload devised by Mike Cowlishaw. Some fixes
need to me made for the version in the benchmark suite; in particular,
the amount of input seems insufficient for _decimal (#26284).
I'm not a fan of weeding out real world benchmarks unti
Changes by Stefan Krah :
--
dependencies: +Fix telco benchmark
___
Python tracker
<http://bugs.python.org/issue26275>
___
___
Python-bugs-list mailing list
Unsub
Stefan Krah added the comment:
Thank you, this is excellent! Does that mean that all locale patches are no
longer needed? Here is one left (perhaps accidentally):
https://github.com/yan12125/python3-android/blob/cpython-hg/mk/ncurses/android-locale-fixes.patch
Stefan Krah added the comment:
Thanks, the test was not needed: It was more of a reminder to sync the version
numbers.
--
___
Python tracker
<http://bugs.python.org/issue26
Changes by Stefan Krah :
--
assignee: -> skrah
resolution: -> fixed
stage: -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<http://bugs.pyt
Stefan Krah added the comment:
I did: Somehow roundup failed to catch it.
--
___
Python tracker
<http://bugs.python.org/issue26621>
___
___
Python-bugs-list mailin
Stefan Krah added the comment:
The roundup timeline is a lie. :) I pushed the 3.5 patch shortly after the 3.6
one and well before msg262302.
--
___
Python tracker
<http://bugs.python.org/issue26
Changes by Stefan Krah :
--
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue26621>
___
___
Python-bugs-list mailing list
Unsubscrib
Stefan Krah added the comment:
is_integer() is very important for writing new functions. libmpdec has
it and it's used a lot inside mpdecimal.c.
In this case though I assume Robert needs it for duck typing.
--
___
Python tracker
Stefan Krah added the comment:
I've been thinking about this, and I'm +1 for the change now.
These structural typing issues for numbers come up regularly
(see also msg257088), and the functions are so simple and
self-explanatory that API-complexity does not really increase.
In
Stefan Krah added the comment:
Ping. Just a reminder that it would be nice to get this into 3.6-alpha-1. :)
--
___
Python tracker
<http://bugs.python.org/issue25
Stefan Krah added the comment:
I agree that Robert's "absurdity" argument was unfortunate and could
be reversed: Many people would consider an (10).is_integer() method
absurd.
I'm also only moderately interested in OOP or classification in general, but
we *do* have a n
Stefan Krah added the comment:
Raymond, you added your support in msg257097. I'm not very happy to spend my
time implementing the feature and then rehashing everything after 3 months.
--
nosy: +gvanrossum
___
Python tracker
<http://bugs.py
Stefan Krah added the comment:
On Tue, Apr 05, 2016 at 01:10:25PM +, Robert Smallshire wrote:
> Were float to inherit from Rational, rather than Real ...
This would break the Liskov substitution principle.
--
___
Python tracker
&l
Stefan Krah added the comment:
On Tue, Apr 05, 2016 at 02:20:19PM +, Robert Smallshire wrote:
> >> Were float to inherit from Rational, rather than Real ...
>
> > This would break the Liskov substitution principle.
>
> How so? Rational extends Real with only nu
Stefan Krah added the comment:
I thought you solved the locale problem in #20305. So it still does not build?
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/issue26
Stefan Krah added the comment:
In any case: It is not uncommon that some C module does not build.
You can disable modules in setup.py:
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
--
assignee: -> skrah
resolut
Stefan Krah added the comment:
Normally I hate environment variables, but perhaps in this case
PYTHON_DISABLE_MODULES="foo,bar,quux" would be sufficient?
Setup.py already has the "disabled_module_list" variable, it's
just a matter of setting this variable somehow.
Thi
New submission from Stefan Krah:
On the x64 architecture gcc adds trailing padding bytes after the last
struct member. NumPy does the same:
>>> import numpy as np
>>>
>>> t = np.dtype([('x', 'u1'), ('y', 'u8'), ('z
Stefan Krah added the comment:
Here's a grammar that roughly describes the subset that NumPy supports.
As for implementing this in the struct module: There is a new data
description language on the horizon:
http://datashape.readthedocs.org/en/latest/
It does not have all the low-
Changes by Stefan Krah :
--
versions: +Python 3.6 -Python 3.3
___
Python tracker
<http://bugs.python.org/issue3132>
___
___
Python-bugs-list mailing list
Unsub
Stefan Krah added the comment:
Thank you. So technically, in the above NumPy example the format
string generated by NumPy would be considered incomplete if we assume
struct syntax:
>>> m = memoryview(x)
>>> m.format
'T{B:x:xxxL:y:B:z:}'
I find this "0L&q
Stefan Krah added the comment:
LTO is not stable on all platforms (according to doko), and people don't
want to wait for PGO to build when they just run ./configure && make.
--with-pgo and --with-lto is fine.
--
___
Python t
Stefan Krah added the comment:
Not acceptable, I'm afraid. See #25702. I'm not sure why it is
considered so bothersome to type --with-pgo and --with-lto for
the rare case of a real production build.
--
___
Python tracker
<http://bu
Stefan Krah added the comment:
On Thu, Apr 14, 2016 at 08:39:20AM +, Alecsandru Patrascu wrote:
> @Stefan and @Marc, you say that people don't want to wait for PGO to build
> when running ./configure && make, but why? Even though many developers use
> it, this mo
Stefan Krah added the comment:
On Thu, Apr 14, 2016 at 08:55:25AM +, Stefan Krah wrote:
> I use it all the time in development:
... where "it" refers to "./configure && make", not to PGO.
--
___
Python tracker
<
Stefan Krah added the comment:
An option would be to use the support of the probably commercial
http://www.windriver.com/products/linux/
and ask them why they're still on Python 2.7.3. They'll also
have gcc installed and can run the test case proposed in this
issue.
--
no
Stefan Krah added the comment:
Also, I don't understand how the test suite could pass with
these kinds of errors. Are you sure this is the Wind-River
system Python? Did they run the test suite?
--
___
Python tracker
<http://bugs.py
Stefan Krah added the comment:
My conclusion is: The error in msg263292 should have been
caught by the test suite.
I'd ask the WindRiver support if they actually run the test suite
before shipping the binaries.
--
___
Python tracker
Stefan Krah added the comment:
#14757 has an implementation of inline caching, which at least seemed to slow
down some use cases. Then again, whenever someone posts a new speedup
suggestion, it seems to slow down things I'm working on. At least Case van
Horsen independently verifie
Stefan Krah added the comment:
Thank you, closing this.
--
resolution: -> out of date
stage: -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.4
___
Python tracker
<http://bugs.python.or
Stefan Krah added the comment:
Okay, closing as a duplicate (the second patch here that checks for
locale.h seems too broad to me since it's a standard header).
--
nosy: +skrah
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Int
Stefan Krah added the comment:
I think all locale includes are unguarded now.
--
___
Python tracker
<http://bugs.python.org/issue17905>
___
___
Python-bugs-list m
New submission from Stefan Krah:
Android's stdlib.h pollutes the namespace by including a memory.h header.
--
assignee: skrah
components: Build
messages: 264199
nosy: skrah, xdegaye
priority: normal
severity: normal
status: open
title: Workaround for non-standard stdlib.h on An
Changes by Stefan Krah :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue26846>
___
Stefan Krah added the comment:
We don't support Android officially yet, but I think until #8610
is resolved something must be done here.
--
___
Python tracker
<http://bugs.python.org/is
Changes by Stefan Krah :
--
assignee: -> skrah
components: +Build -Cross-Build
nosy: +skrah
resolution: -> fixed
stage: -> resolved
status: open -> closed
versions: +Python 3.6 -Python 3.4, Python 3.5
___
Python tracker
<http://
Stefan Krah added the comment:
After #26846 _decimal builds on Android.
--
resolution: rejected -> fixed
superseder: -> Workaround for non-standard stdlib.h on Android
___
Python tracker
<http://bugs.python.org/i
Stefan Krah added the comment:
> Maybe issue #26723 can be closed now as well ?
I think it was already closed, but I added a link to this issue now.
--
___
Python tracker
<http://bugs.python.org/issu
Stefan Krah added the comment:
Okay, for the record: I think that returning "None" would probably be
more correct than the empty string, but I don't think users actually
care to the point that they will introduce a case split in their
applications.
Realistically, probably no
Stefan Krah added the comment:
Hmm. Why does os.urandom(), which should explicitly not block, use a blocking
getrandom() function?
This is quite unexpected on Linux.
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/issue26
Stefan Krah added the comment:
Wow, it's by design:
" os.urandom(n)
Return a string of n random bytes suitable for cryptographic use."
``man urandom'':
"A read from the /dev/urandom device will not block waiting for more entropy.
As a result, if t
Stefan Krah added the comment:
It is clear how /dev/urandom works. I just think that securing enough
entropy on startup should be done by the init scripts (if systemd still
allows that :) and not by an application.
[Unless the application is gpg or similar
Stefan Krah added the comment:
I did not claim that it magically creates entropy. -- Many VMs are throwaway
test beds. It would be annoying to setup some entropy
gathering mechanism just so that Python starts.
--
___
Python tracker
<h
Stefan Krah added the comment:
Thanks, fixed.
--
assignee: -> skrah
nosy: +skrah
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python
Stefan Krah added the comment:
Thanks!
--
assignee: -> skrah
nosy: +skrah
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python
Stefan Krah added the comment:
Thanks again!
--
assignee: -> skrah
nosy: +skrah
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python
Stefan Krah added the comment:
@shiz: Can we settle on API level 21 or is there any reason to leave this in?
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/issue26
Stefan Krah added the comment:
Since Android is the only known system with an odd include path, I
prefer the short patch. In general, let's try to keep patches as
short as possible (which Xavier is already doing).
--
___
Python tracker
Stefan Krah added the comment:
Do you need libtinfow? It seems that it's not supported in setup.py,
and getting even libtinfo support into some Linux distributions took
quite a while.
--
nosy: +skrah
___
Python tracker
<http://bugs.py
Stefan Krah added the comment:
IOW, on Linux tinfo should work fine in combination with ncursesw.
--
___
Python tracker
<http://bugs.python.org/issue26
Stefan Krah added the comment:
It seems that Android is the only known platform that deviates from
/bin/sh. So perhaps we should simply set a variable to either
/bin/sh or /system/bin/sh rather than waiting for #16353 to settle.
--
nosy: +skrah
versions: +Python 3.6 -Python 3.4
Stefan Krah added the comment:
I think the current behavior is good for error handling by goto,
which is common for module initialization.
Please don't change this.
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/is
Stefan Krah added the comment:
Your definition of correctness is very odd. The "leaks" you are talking
about are single references in case of a module initialization failure,
in which case you are likely to have much bigger problems.
Please take _decimal out of this patch, it's
Changes by Stefan Krah :
--
nosy: -skrah
___
Python tracker
<http://bugs.python.org/issue26871>
___
___
Python-bugs-list mailing list
Unsubscribe:
Stefan Krah added the comment:
It seems that the patch also introduces a segfault if PyLong_FromSsize_t()
returns NULL.
--
nosy: +skrah
___
Python tracker
<http://bugs.python.org/issue26
Stefan Krah added the comment:
Serhiy, I'm sorry that I overreacted here. You're doing great work for
Python -- we just happen to disagree on this one particular issue.
I think there were some proponents on python-dev, perhaps they'll show
up and disc
Stefan Krah added the comment:
It seems to work correctly here for non-binary floats:
>>> from _pydecimal import Decimal
>>> Decimal.from_float(Decimal("1.2"))
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python
Stefan Krah added the comment:
As Mark hinted at, many people would say there is no issue at all.
Subclassing like that often breaks the Liskov Substitution Principle.
For more information, see e.g.:
http://okmij.org/ftp/Computation/Subtyping/
"Alas, LSP when considered from an OOP
Stefan Krah added the comment:
How about supporting API >= 23 only? Can people upgrade their devices or do
they have to buy a new one?
--
nosy: +Chi Hsuan Yen
___
Python tracker
<http://bugs.python.org/issu
3201 - 3300 of 3396 matches
Mail list logo