[issue17905] Add check for locale.h

2016-04-25 Thread Stefan Krah
Stefan Krah added the comment: I think all locale includes are unguarded now. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue17905] Add check for locale.h

2016-04-25 Thread Stefan Krah
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: -> Inter

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-04-25 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.pyt

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-04-22 Thread Stefan Krah
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 verified

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Stefan Krah
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 <

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Stefan Krah
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 <rep...@bugs.python.org>

[issue26743] Unable to import random with python2.7 on power pc based machine

2016-04-15 Thread Stefan Krah
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. -- nosy: +skrah

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Stefan Krah
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

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-14 Thread Stefan Krah
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 mod

[issue26359] CPython build options for out-of-the box performance

2016-04-14 Thread Stefan Krah
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 <rep...@bugs.python.

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-04-13 Thread Stefan Krah
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 trac

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Stefan Krah
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" thing

[issue3132] implement PEP 3118 struct changes

2016-04-13 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- versions: +Python 3.6 -Python 3.3 ___ Python tracker <rep...@bugs.python.org> <http://bugs.pytho

[issue3132] implement PEP 3118 struct changes

2016-04-13 Thread Stefan Krah
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-level

[issue26746] struct.pack(): trailing padding bytes on x64

2016-04-13 Thread Stefan Krah
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', 'u1')], align=True) >>> x = np.array(

[issue20210] Provide configure options to enable/disable Python modules and extensions

2016-04-10 Thread Stefan Krah
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. This

[issue26723] Add an option to skip _decimal module

2016-04-09 Thread Stefan Krah
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

[issue26723] Add an option to skip _decimal module

2016-04-09 Thread Stefan Krah
Stefan Krah added the comment: I thought you solved the locale problem in #20305. So it still does not build? -- nosy: +skrah ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Stefan Krah
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 onl

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Stefan Krah
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 &

[issue25928] Add Decimal.as_integer_ratio()

2016-04-05 Thread Stefan Krah
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 <rep...@bugs.python.

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-04 Thread Stefan Krah
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 numeric tow

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2016-04-03 Thread Stefan Krah
Stefan Krah added the comment: Ping. Just a reminder that it would be nice to get this into 3.6-alpha-1. :) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-03 Thread Stefan Krah
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 general, I

[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-01 Thread Stefan Krah
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 <

[issue26621] test_decimal fails with libmpdecimal 2.4.2

2016-03-23 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26621> ___ _

[issue26621] test_decimal fails with libmpdecimal 2.4.2

2016-03-23 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26621] test_decimal fails with libmpdecimal 2.4.2

2016-03-23 Thread Stefan Krah
Stefan Krah added the comment: I did: Somehow roundup failed to catch it. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26621] test_decimal fails with libmpdecimal 2.4.2

2016-03-23 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- assignee: -> skrah resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <rep...@bugs.python.org> <htt

[issue26621] test_decimal fails with libmpdecimal 2.4.2

2016-03-23 Thread Stefan Krah
Stefan Krah added the comment: Thanks, the test was not needed: It was more of a reminder to sync the version numbers. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue20305] Android's incomplete locale.h implementation prevents cross-compilation

2016-03-20 Thread Stefan Krah
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

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-23 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- dependencies: +Fix telco benchmark ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26416] Deprecate the regex_v8, telco, and spectral_norm benchmarks

2016-02-23 Thread Stefan Krah
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 until our

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-13 Thread Stefan Krah
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 version 4.02.1

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-13 Thread Stefan Krah
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

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-13 Thread Stefan Krah
Stefan Krah added the comment: Correction: The explanation of the functions should be reversed. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-13 Thread Stefan Krah
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 >

[issue26331] Tokenizer: allow underscores for grouping in numeric literals

2016-02-13 Thread Stefan Krah
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

[issue26200] SETREF adds unnecessary work in some cases

2016-02-11 Thread Stefan Krah
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 version

[issue26284] FIx telco benchmark

2016-02-07 Thread Stefan Krah
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

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-07 Thread Stefan Krah
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 <rep...@bugs.python.org>

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-07 Thread Stefan Krah
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

[issue26284] Fix telco benchmark

2016-02-07 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- title: FIx telco benchmark -> Fix telco benchmark ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-07 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.python.org/i

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Stefan Krah
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 <rep...@bugs.python.org>

[issue26288] Optimize PyLong_AsDouble for single-digit longs

2016-02-06 Thread Stefan Krah
Stefan Krah added the comment: Additionally, "single digit will always fit a double"? -- nosy: +skrah ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-04 Thread Stefan Krah
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. > Nice. te

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-04 Thread Stefan Krah
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

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-04 Thread Stefan Krah
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'] Elapsed time: 7.304339 $ taskset -c 0 ./python telco.py full

[issue26275] perf.py: calibrate benchmarks using time, not using a fixed number of iterations

2016-02-04 Thread Stefan Krah
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', '25042.17'] Elapsed time: 6.783009 Control totals: Actual

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-04 Thread Stefan Krah
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 <

[issue26284] FIx telco benchmark

2016-02-04 Thread Stefan Krah
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 _decimal

[issue26285] Garbage collection of unused input sections from CPython binaries

2016-02-04 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.python.org/i

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-04 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.python.org/i

[issue21955] ceval.c: implement fast path for integers with a single digit

2016-02-04 Thread Stefan Krah
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% or so

[issue26256] Fast decimalisation and conversion to other bases

2016-02-03 Thread Stefan Krah
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 won'

[issue26256] Fast decimalisation and conversion to other bases

2016-02-02 Thread Stefan Krah
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 decimal imp

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Stefan Krah
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 time

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Stefan Krah
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, so

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- stage: -> needs patch type: -> enhancement versions: +Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.

[issue26178] Python C-API: __all__ Creator

2016-01-22 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.p

[issue24520] Stop using deprecated floating-point environment functions on FreeBSD

2016-01-20 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.python.org/i

[issue24520] Stop using deprecated floating-point environment functions on FreeBSD

2016-01-20 Thread Stefan Krah
Stefan Krah added the comment: Thanks, then the patch looks good to me. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24520> ___ __

[issue26139] libmpdec: disable /W4 warning (non-standard dllimport behavior)

2016-01-18 Thread Stefan Krah
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

[issue25878] CPython on Windows builds with /W3, not /W4

2016-01-17 Thread Stefan Krah
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 t

[issue26138] Disable /W4 warning (non-standard dllimport behavior)

2016-01-17 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- nosy: skrah priority: normal severity: normal status: open title: Disable /W4 warning (non-standard dllimport behavior) ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue26139] libmpdec: disable /W4 warning (non-standard dllimport behavior)

2016-01-17 Thread Stefan Krah
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

[issue26138] Disable /W4 warning (non-standard dllimport behavior)

2016-01-17 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- resolution: -> duplicate stage: -> resolved status: open -> closed type: -> compile error ___ Python tracker <rep...@bugs.python.org> <http:/

[issue26139] libmpdec: disable /W4 warning (non-standard dllimport behavior)

2016-01-17 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue25878] CPython on Windows builds with /W3, not /W4

2016-01-17 Thread Stefan Krah
Stefan Krah added the comment: Pragma added for libmpdec in #26139. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25878> ___ ___

[issue25878] CPython on Windows builds with /W3, not /W4

2016-01-16 Thread Stefan Krah
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 <rep...@bugs.python.org>

[issue25878] CPython on Windows builds with /W3, not /W4

2016-01-16 Thread Stefan Krah
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 <rep...@bugs.python.org>

[issue26091] decimal.Decimal(0)**0 throws decimal.InvalidOperation

2016-01-12 Thread Stefan Krah
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 <rep...@bugs.python.org> <http://bugs.pyt

[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-11 Thread Stefan Krah
Stefan Krah added the comment: On Mon, Jan 11, 2016 at 08:17:11PM +, Yury Selivanov wrote: > inspect.getargspec is back to Python 3.6 (it was never removed from <= 3.5, > fwiw) Yay! Thank you very much! -- ___ Python tra

[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-09 Thread Stefan Krah
Stefan Krah added the comment: +1 for adding it to 3.5.2. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25486> ___ ___ Pyth

[issue25486] Resurrect inspect.getargspec() in 3.6

2016-01-09 Thread Stefan Krah
Stefan Krah added the comment: Could this be done soon? I ran into this just now: Traceback (most recent call last): File "", line 1, in File "/home/stefan/usr/lib/python3.6/site-packages/datashape-0.4.7-py3.6.egg/datashape/__init__.py", line 7, in from .user imp

[issue22499] [SSL: BAD_WRITE_RETRY] bad write retry in _ssl.c:1636

2016-01-05 Thread Stefan Krah
Stefan Krah added the comment: https://books.google.com/books?id=IIqwAy4qEl0C_esc=y , page 159 ff. Modules/_ssl.c:_ssl__SSLSocket_write_impl() just raises PySSLWantReadError etc. if the socket is non-blocking. IOW, it's a thin wrapper around SSL_write(). So yes, I think you do need complete

[issue22499] [SSL: BAD_WRITE_RETRY] bad write retry in _ssl.c:1636

2016-01-03 Thread Stefan Krah
Stefan Krah added the comment: As I said in msg254389, the read/write handling for non-blocking sockets is far from trivial. I'm not sure that this is a Python bug: Looking at dugong/__init__.py, I don't think this implements the recommendations in the OpenSSL book that I mentioned. The book

[issue20008] Clean up/refactor/make discoverable test_decimal

2016-01-01 Thread Stefan Krah
Stefan Krah added the comment: Is this a political nosying? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20008> ___ ___ Pyth

[issue25940] SSL tests failed due to expired svn.python.org SSL certificate

2015-12-29 Thread Stefan Krah
Stefan Krah added the comment: Setting to blocker because I've disabled the offending tests. -- nosy: +georg.brandl, larry, skrah priority: high -> release blocker ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Stefan Krah
Stefan Krah added the comment: No, I haven't done any benchmarks. In a quick test type(x) == float does not seem any faster than isinstance(x, float), so perhaps we could reduce the try/except complexity. -- ___ Python tracker <rep...@bugs.python.

[issue25928] Add Decimal.as_integer_ratio()

2015-12-29 Thread Stefan Krah
Stefan Krah added the comment: I've opened #25974 for the statistics.py issues. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bugs.pyt

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Stefan Krah
Stefan Krah added the comment: The clear winner for float and Decimal is hasattr(x, 'as_integer_ratio'). The other types are a bit disadvantaged if the lookup fails, but they go through additional try/excepts anyway. -- ___ Python tracker <

[issue25975] Weird multiplication

2015-12-29 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue25974] Fix statistics.py after the Decimal.as_integer_ratio() change

2015-12-29 Thread Stefan Krah
New submission from Stefan Krah: Here's a fix for the fallout from #25928. I've set it to release blocker to make sure we don't forget. -- assignee: steven.daprano components: Library (Lib) files: statistics_as_integer_ratio.diff keywords: 3.5regression, patch messages: 257178 nosy

[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah
Stefan Krah added the comment: Hopefully I wasn't moving too fast, but I won't have time in the next days/weeks. Serhiy and Alexander (#8947) would prefer more homogeneous error messages and docstrings between float/pydecimal/cdecimal. I wouldn't mind a patch in another issue (no argument

[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Stefan Krah
New submission from Stefan Krah: Not sure what is happening, but all Windows buildbots fail compile/clean. -- messages: 257161 nosy: skrah, zach.ware priority: normal severity: normal status: open title: All Windows buildbots fail compile/clean

[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Stefan Krah
Stefan Krah added the comment: Serhiy, could you take a look if it's related to http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7107 ? This seems to be the first failure. -- ___ Python tracker <rep...@bugs.python.

[issue25972] All Windows buildbots fail compile/clean

2015-12-28 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- nosy: +serhiy.storchaka ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25972> ___

[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah
Stefan Krah added the comment: Here's a patch. The Python and doc parts are from Mark (#8947). I did not optimize the normalization yet, in C the code is less clean and there were some corner cases where the gcd is actually faster. -- keywords: +patch Added file: http://bugs.python.org

[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah
Stefan Krah added the comment: Steven, could you have a look at the failures in test_statistics? Some tests fail because they assume non-normalized fractions, I still have to look at the other assumptions. -- ___ Python tracker <

[issue25928] Add Decimal.as_integer_ratio()

2015-12-28 Thread Stefan Krah
Stefan Krah added the comment: Ah yes, the test_statistics failures look like #18841 again. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25928] Add Decimal.as_integer_ratio()

2015-12-27 Thread Stefan Krah
Stefan Krah added the comment: Previously the method was rejected in #8947. But the speedup is quite dramatic. This is a benchmark for converting "1.91918261298362195e-100", 100 repetitions: float.as_integer_ratio: 0.548023 Decimal.as_integer_ratio: normalize=False

[issue25928] Add Decimal.as_integer_ratio()

2015-12-27 Thread Stefan Krah
Stefan Krah added the comment: Keeping the API small is a good reason against it. There aren't many ways to destructure a Decimal though: As far as I know, the return value of as_tuple() dates back from the time when the coefficient was actually a tuple. The function is slow and not really

[issue20767] Some python extensions can't be compiled with clang 3.4

2015-12-26 Thread Stefan Krah
Stefan Krah added the comment: Over at the llvm bug tracker this is marked as a release blocker: https://llvm.org/bugs/show_bug.cgi?id=18164 -- nosy: +skrah ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue25923] More const char

2015-12-26 Thread Stefan Krah
Stefan Krah added the comment: There's no need to revert it. Both versions are okay, but I wanted to point out that these kinds of changes a) add a cognitive load for other developers (I have to look what has changed in memoryobject.c) and b) may override other developers' conscious decisions

[issue25923] More const char

2015-12-25 Thread Stefan Krah
Stefan Krah added the comment: What is the point of changing the return value of a function in Objects/memoryobject.c to "const char *" and then casting it back to "char *" in the one place that the function is used? Churn like this has a direct cost for me: I have to u

[issue25923] More const char

2015-12-25 Thread Stefan Krah
Stefan Krah added the comment: I was faced with the same dilemma when I wrote the code and I *deliberately* decided that returning (const char *) + an additional cast wasn't worth it for a static function that's used only once. -- ___ Python tracker

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Changes by Stefan Krah <ste...@bytereef.org>: -- nosy: +steven.daprano ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25928> ___ _

[issue25928] Improve performance of statistics._decimal_to_ratio and fractions.from_decimal

2015-12-23 Thread Stefan Krah
Stefan Krah added the comment: I guess there's some version mixup here: From Python 3.3 on the integrated C version of decimal does not store the digits as a string and does not have the private _int method. -- nosy: +skrah ___ Python tracker <

<    4   5   6   7   8   9   10   11   12   13   >