[issue29190] Avoid possible errors in comparing strings

2017-01-07 Thread Stefan Krah
Stefan Krah added the comment: Also, if anyone changes the rounding-mode constants it is really their problem. -- ___ Python tracker <http://bugs.python.org/issue29

[issue29190] Avoid possible errors in comparing strings

2017-01-07 Thread Stefan Krah
Stefan Krah added the comment: To expand a little, you use the terminology "possible bugs". All I can see is a double exception if PyUnicode_Compare() returns -1. I think I did it on purpose because this function is speed sensitive and no user will change a valid rounding mode *cons

[issue29190] Avoid possible errors in comparing strings

2017-01-07 Thread Stefan Krah
Stefan Krah added the comment: I'm generally a little concerned about the way "bugs" are presented here recently: In #28701 you write: 'Correctness. Since no caller checks the error of PyUnicode_CompareWithASCIIString(), it is incorrectly interpreted as "less then&

[issue28701] Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString

2017-01-07 Thread Stefan Krah
Stefan Krah added the comment: For the record: This is all that happened in decimal if a) you pass a legacy string and b) force _PyUnicode_Ready() to throw a MemoryError: >>> from decimal import * >>> import _testcapi >>> context = Context() >>> traps = _t

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2017-01-08 Thread Stefan Behnel
Stefan Behnel added the comment: This bug makes the installation of lxml fail on many systems (especially MacOS) when pip installs from sources, because it tries to download its library dependencies from FTP and crashes due to the FTP "error". I guess the current fix is to not use

[issue27973] urllib.urlretrieve() fails on second ftp transfer

2017-01-08 Thread Stefan Behnel
Stefan Behnel added the comment: Actually, it seems that calling urlcleanup() is sufficient as a work-around. -- ___ Python tracker <http://bugs.python.org/issue27

[issue29204] Add code deprecations in ElementTree

2017-01-08 Thread Stefan Behnel
Stefan Behnel added the comment: I'm ok with the deprecations. Regarding the cElementTree module, this is a bit problematic. The idiomatic import has lost its use in Py2.5 when ET and cET were added to the stdlib, so code that was written for Py2.5 or later (e.g. because it uses gener

[issue29190] Avoid possible errors in comparing strings

2017-01-09 Thread Stefan Krah
Stefan Krah added the comment: On Mon, Jan 09, 2017 at 08:21:17AM +, Serhiy Storchaka wrote: > In the particular case of getround() in _decimal.c, seems the worst case is > raising TypeError instead of MemoryError in pretty rare circumstances. This > is not critically bad, there

[issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *"

2017-01-22 Thread Stefan Krah
Stefan Krah added the comment: For _decimal I'm happy with just the cast from the first patch -- you have a one line diff and it's easy to see the focus of the issue. -- ___ Python tracker <http://bugs.python.o

[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread Stefan Krah
Stefan Krah added the comment: I'll take a look when I have the opportunity. AC will not happen: It makes the module too large and unreadable. -- ___ Python tracker <http://bugs.python.org/is

[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-01-27 Thread Stefan Krah
Stefan Krah added the comment: > STINNER Victor added the comment: > > AC will not happen: It makes the module too large and unreadable. > > Ah you dislike the additional [clinic input] sections? Yes, they tear apart the code. I stopped reading many C files because of this.

[issue29300] Modify the _struct module to use FASTCALL and Argument Clinic

2017-02-02 Thread Stefan Krah
Stefan Krah added the comment: PyBUF_SIMPLE implies C-contiguous for a conforming buffer provider. -- nosy: +skrah ___ Python tracker <http://bugs.python.org/issue29

[issue29404] "TypeError: 'int' does not have the buffer interface" on memoryview over bytearray

2017-02-02 Thread Stefan Krah
Stefan Krah added the comment: I agree it's too late to change 2.7, and 3.x cannot (and should not) be changed at this stage. -- ___ Python tracker <http://bugs.python.org/is

[issue29439] _decimal on Android requires linking with libm

2017-02-04 Thread Stefan Krah
Stefan Krah added the comment: Thanks. Strange that on other systems the compilers don't complain (usually they do). -- assignee: -> skrah ___ Python tracker <http://bugs.python.org

[issue29439] _decimal on Android requires linking with libm

2017-02-04 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> fixed stage: -> resolved status: open -> closed versions: +Python 3.6 ___ Python tracker <http://bugs.python.or

[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-04 Thread Stefan Krah
Stefan Krah added the comment: I didn't look at this one, but some "hacks" are necessary in setup.py (example: usage of os.system() in some places). -- nosy: +skrah ___ Python tracker <http://bugs.pyt

[issue29439] _decimal on Android requires linking with libm

2017-02-04 Thread Stefan Krah
Stefan Krah added the comment: Perhaps test_decimal should fail for CPython if _decimal can't be imported. All compilers that I tested seem to link fine without -lm in this case. -- ___ Python tracker <http://bugs.python.org/is

[issue29301] decimal: Use FASTCALL and/or Argument Clinic

2017-02-06 Thread Stefan Krah
Stefan Krah added the comment: If the API can still change (msg287083), I think I'll wait with this until shortly before 3.7 beta. -- ___ Python tracker <http://bugs.python.org/is

[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-02-06 Thread Stefan Krah
Stefan Krah added the comment: Adding Stefan Behnel, perhaps Cython doesn't need backwards compatibility. -- nosy: +scoder, skrah ___ Python tracker <http://bugs.python.org/is

[issue29464] Specialize FASTCALL for functions with positional-only parameters

2017-02-06 Thread Stefan Behnel
Stefan Behnel added the comment: Thanks for asking. Cython doesn't use METH_FASTCALL yet, so this doesn't introduce any problems. Generally speaking, if Cython generated user code stops working with a new CPython version, we expect people to regenerate their code with the newe

[issue29534] _decimal difference with _pydecimal

2017-02-11 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: +mark.dickinson, rhettinger, skrah ___ Python tracker <http://bugs.python.org/issue29534> ___ ___ Python-bugs-list mailin

[issue29534] _decimal difference with _pydecimal

2017-02-11 Thread Stefan Krah
Stefan Krah added the comment: I get the the same output, perhaps I misunderstand something here: >>> from _decimal import * >>> class X(Decimal): ... def __init__(self, a): ... print('__init__:', a) ... >>> X.from_float(42.5) __init__:

[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-13 Thread Stefan Krah
Stefan Krah added the comment: It's not a matter of *necessary*, you simply cannot use argparse in setup.py. Try to build with your patch and you'll see. -- ___ Python tracker <http://bugs.python.o

[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-13 Thread Stefan Krah
Changes by Stefan Krah : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue29442> ___ ___

[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-13 Thread Stefan Krah
Stefan Krah added the comment: On Mon, Feb 13, 2017 at 03:04:09PM +, Chi Hsuan Yen wrote: > > Chi Hsuan Yen added the comment: > > I have used my old patch several days on Android, and it seems quite fine. > Anyway that's not important anymore. I find that very surp

[issue29580] "Built-in Functions" not being functions

2017-02-16 Thread Stefan Pochmann
New submission from Stefan Pochmann: About https://docs.python.org/3/library/functions.html: The title "Built-in Functions", the table header "Built-in Functions" and the "functions" in the URL all suggest that what's on this page are functions. But many thin

[issue29580] "Built-in Functions" not being functions

2017-02-16 Thread Stefan Pochmann
Stefan Pochmann added the comment: The page also contains many references like "As repr(), return a string containing..." where the "()" should be removed. -- ___ Python tracker <http://bug

[issue29442] Use argparse and drop dirty optparse hacks in setup.py

2017-02-16 Thread Stefan Krah
Stefan Krah added the comment: It's okay to reopen if some conditions have changed (which is the case here). -- ___ Python tracker <http://bugs.python.org/is

[issue20408] memoryview() constructor documentation error

2016-06-03 Thread Stefan Krah
Stefan Krah added the comment: Or pretend in the documentation that it's a positional arg and make it one later. There is a slight performance difference. I agree with Damien that probably no one uses the keyword arg. -- ___ Python tracker

[issue20408] memoryview() constructor documentation error

2016-06-03 Thread Stefan Krah
Stefan Krah added the comment: Sorry, I meant *Demian*. -- ___ Python tracker <http://bugs.python.org/issue20408> ___ ___ Python-bugs-list mailing list Unsub

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-06 Thread Stefan Krah
Stefan Krah added the comment: I think such warnings should be emitted at application level, similar to the case when a program refuses to run under UID 0. If admins wish, they can also integrate such checks into the system startup sequence (e.g. runlevel 3 is only reached if randomness is

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-07 Thread Stefan Krah
Stefan Krah added the comment: On Tue, Jun 07, 2016 at 10:01:16AM +, STINNER Victor wrote: > Maybe need something like time.get_clock_info(), sys.float_info and > sys.thread_info for os.urandom(): a string describing the implementation of > os.urandom(). It would allow the dev

[issue26839] Python 3.5 running on Linux kernel 3.17+ can block at startup or on importing the random module on getrandom()

2016-06-07 Thread Stefan Krah
Stefan Krah added the comment: man urandom: "A read from the /dev/urandom device will not block waiting for more entropy. As a result, if there is not sufficient entropy in the entropy pool, the returned values are theoretically vulnerable to a cryptographic attack o

[issue25455] Some repr implementations don't check for self-referential structures

2016-06-11 Thread Stefan Behnel
Stefan Behnel added the comment: Etree patch looks straight forward to me, feel free to apply it. -- ___ Python tracker <http://bugs.python.org/issue25

[issue26862] android: SYS_getdents64 does not need to be defined on android API 21

2016-06-12 Thread Stefan Krah
Stefan Krah added the comment: posixmodule_3.patch looks good to me. Gregory has already approved the approach, so I think you can go ahead and commit this. -- ___ Python tracker <http://bugs.python.org/issue26

[issue27006] C implementation of Decimal.from_float() bypasses __new__ and __init__

2016-06-20 Thread Stefan Krah
Stefan Krah added the comment: Thank you for the detailed summary! -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue27006] C implementation of Decimal.from_float() bypasses __new__ and __init__

2016-06-20 Thread Stefan Krah
Stefan Krah added the comment: > PyDec_CheckExact(type) always return 0. Should be PyDec_CheckExact(result). 'result' is always an exact decimal, because your enum example won't work otherwise. > And what about other calls of PyDecType_FromFloatExact()? Can they produce

[issue27006] C implementation of Decimal.from_float() bypasses __new__ and __init__

2016-06-20 Thread Stefan Krah
Changes by Stefan Krah : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue27006> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue26975] Decimal.from_float works incorrectly for non-binary floats

2016-06-21 Thread Stefan Krah
Stefan Krah added the comment: Let's close it then. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.pyth

[issue26974] Crash in Decimal.from_float

2016-06-21 Thread Stefan Krah
Stefan Krah added the comment: I'll look at it soon -- I just don't have much time right now. -- assignee: -> skrah ___ Python tracker <http://bugs.pytho

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Stefan Krah added the comment: You need to install at least these development libraries: sudo apt-get install libssl-dev liblzma-dev libbz2-dev libreadline-dev libgdbm-dev libffi-dev Possibly some are missing in this list, tkinter and zip for example. Use "apt-cache search tkinter"

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Stefan Krah added the comment: I think you need tcl8.4-dev and tk8.4-dev and perhaps zlib1g-dev. Actually the point is that it's expected that some modules don't build if the corresponding libraries aren't installed. -- ___ Python

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Stefan Krah added the comment: Ah, so the tests pass when you run them manually but "make test" fails. This looks like https://bugs.python.org/issue26837 , which is fixed in the next release. You can just ignore this failure, it's harmless. [BTW, using aut

[issue27375] error in "make test", while trying to install python on linux computer

2016-06-23 Thread Stefan Krah
Changes by Stefan Krah : -- components: +Tests -Build, Installation resolution: fixed -> duplicate status: open -> closed type: compile error -> behavior ___ Python tracker <http://bugs.python.or

[issue27444] Python doesn't build due to test_float.py broken on non-IEEE machines

2016-07-04 Thread Stefan Krah
Stefan Krah added the comment: It looks like the peephole optimizer chokes on some constant folding. Probably: INF = float("inf") NAN = float("nan") -INF -NAN You could try some combinations in the REPL. -- nosy: +skrah ___ P

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Changes by Stefan Krah : Added file: http://bugs.python.org/file43660/issue27442-3.patch ___ Python tracker <http://bugs.python.org/issue27442> ___ ___ Python-bugs-list m

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Stefan Krah added the comment: I did "hg pull -u" before re-generating the diff. Other than that, sometimes newer mercurial versions behave better (I have 2.8.2). -- ___ Python tracker <http://bugs.python.o

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Stefan Krah added the comment: Good point about Misc/NEWS: I just regenerated the patch mindlessly to check the "diff --git" situation :) Actually, Xavier, it's often better to leave out the NEWS section in the bug tracker patches and just add it before pushing. Perhaps Rietvel

[issue27442] expose the Android API level in sysconfig.get_config_vars()

2016-07-08 Thread Stefan Krah
Stefan Krah added the comment: I guess so. Our Rietveld setup apparently has some heuristics that work best when you're on the default branch and completely synced with the main repo. -- ___ Python tracker <http://bugs.python.org/is

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

2016-07-10 Thread Stefan Krah
Stefan Krah added the comment: Strange, why can anyone edit the classification? It happens a lot lately. -- ___ Python tracker <http://bugs.python.org/issue20

[issue26974] Crash in Decimal.from_float

2016-07-16 Thread Stefan Krah
Stefan Krah added the comment: The approaches look good, but for clarity I want to replace all method calls that should never be overridden by the plain C functions of their corresponding static types. I have no opinion about the Python version. The diff also "fixes" #26975 for the

[issue26974] Crash in Decimal.from_float

2016-07-17 Thread Stefan Krah
Stefan Krah added the comment: These are builtin static types. Even with non-builtin static types, the address of the type should always be the same. C-extensions aren't reloaded. -- ___ Python tracker <http://bugs.python.org/is

[issue26974] Crash in Decimal.from_float

2016-07-17 Thread Stefan Krah
Stefan Krah added the comment: Also, IMO the whole capsule mechanism would be broken if function pointers in dynamic libs could just be invalidated due to reloading. -- ___ Python tracker <http://bugs.python.org/issue26

[issue26974] Crash in Decimal.from_float

2016-07-17 Thread Stefan Krah
Stefan Krah added the comment: I'm leaving this open in case anyone wants to do something about the Python version. I tend to agree with Raymond: It is impractical to "fix" all such constructs in the Python version, unless one consistently uses a style like: float.as_inte

[issue27542] Segfault in gcmodule.c:360 visit_decref

2016-07-17 Thread Stefan Krah
Stefan Krah added the comment: Which makes me think that --no-use-wheel should be the default in pip ... As a Linux user I'm *very* uneasy about this whole binary wheel thing. -- nosy: +skrah ___ Python tracker <http://bugs.python.org/is

[issue16255] subrocess.Popen needs /bin/sh but Android only has /system/bin/sh

2016-07-20 Thread Stefan Krah
Stefan Krah added the comment: Apparently sysconfig.get_config_var() is already called in site.py anyway, so in principle I'm fine with using it here. In the stdlib it seems to be the first use outside site.py though, and site.py can be disabled by using "python -S", so perha

[issue26974] Crash in Decimal.from_float

2016-07-23 Thread Stefan Krah
Changes by Stefan Krah : -- stage: commit review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue26974> ___ ___ Pyth

[issue27604] More details about `-O` flag

2016-07-25 Thread Stefan Krah
Stefan Krah added the comment: I can see nothing wrong with msg271168. It's polite, informative, not apodictic and does not rule out the possibility of accepting a patch. Also, it answers a direct question from msg271142. -- nosy: +skrah ___ P

[issue27604] More details about `-O` flag

2016-07-25 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: -skrah ___ Python tracker <http://bugs.python.org/issue27604> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue18304] ElementTree -- provide a way to ignore namespace in tags and seaches

2016-07-27 Thread Stefan Behnel
Stefan Behnel added the comment: Here is a proposed patch for a new function "strip_namespaces(tree)" that discards all namespaces from tags and attributes in a (sub-)tree, so that subsequent processing does not have to deal with them. The "__all__" test is failing (have

[issue18304] ElementTree -- provide a way to ignore namespace in tags and seaches

2016-07-27 Thread Stefan Behnel
Stefan Behnel added the comment: On second thought, I think it should be supported (also?) in the parser. Otherwise, using it with an async parser would be different from (and more involved than) one-shot parsing. That seems wrong. -- ___ Python

[issue27638] int.to_bytes() and int.from_bytes() should support 'net' and 'host' byte orders

2016-08-02 Thread Stefan Krah
Stefan Krah added the comment: Марк, sorry for all this negativity. ;) But I'm also -1. What is wrong with socket.ntohs() etc.? -- nosy: +skrah ___ Python tracker <http://bugs.python.org/is

[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Stefan Krah
Stefan Krah added the comment: Yes, I agree this is nicer. Thanks for the patch. -- nosy: +skrah ___ Python tracker <http://bugs.python.org/issue27241> ___ ___

[issue27241] Catch exceptions raised in pstats add (repl)

2016-08-02 Thread Stefan Krah
Changes by Stefan Krah : -- assignee: -> skrah resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: +Python 3.5 ___ Python tracker <http://bugs.python

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

2016-08-02 Thread Stefan Krah
Stefan Krah added the comment: We can of course commit this, but could you also lobby here? https://llvm.org/bugs/show_bug.cgi?id=18164 I'm seeing this quite often that we fix something here and no one insists on the upstream bug tra

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

2016-08-03 Thread Stefan Krah
Stefan Krah added the comment: @Evelyn @koobs Thanks for communicating with the other projects that are involved in this issue! Could you double-check that especially the 2.7 patch does exactly what you want? For 2.7 it's practically a one time c

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

2016-08-03 Thread Stefan Krah
Changes by Stefan Krah : -- stage: patch review -> commit review ___ Python tracker <http://bugs.python.org/issue20767> ___ ___ Python-bugs-list mailing list Un

[issue27673] lambda function in loop

2016-08-03 Thread Stefan Rosewig
New submission from Stefan Rosewig: Trying to build tkinter menu dynamically by reading an ini file (configparser) I detect an issue with the lambda function used inside a loop. If the loop variable is used as option in the lambda function, the lambda is not place in time using the current

[issue27673] lambda function in loop

2016-08-03 Thread Stefan Rosewig
Stefan Rosewig added the comment: @Emanuel Barry thanks for clarification, I didn't find this when I was searching for. regards Stefan -- ___ Python tracker <http://bugs.python.org/is

[issue27720] decimal.Context.to_eng_string wrong docstring

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: @Antti The behavior follows this standard: http://speleotrove.com/decimal/decarith.html Nothing we can do about it even if we wanted to. -- ___ Python tracker <http://bugs.python.org/issue27

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

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: @Antti Please think before you write and stop making unfounded allegations. -- ___ Python tracker <http://bugs.python.org/issue26

[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: In 2.7 we use -fno-strict-aliasing and -fwrapv for gcc. I think it is probably required to use the equivalent options for xlc. These are examples of things that have been cleaned up in 3.x. 2.7 actually relies on these options

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

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: On Thu, Aug 11, 2016 at 09:17:10AM +, Antti Haapala wrote: > However the *precision* of decimals is meaningless anyhow. Add a very > precisely measured '0e0' to any number and the sum also has exponent of 0, > and is thus never displ

[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: On Thu, Aug 11, 2016 at 09:29:44AM +, REIX Tony wrote: > -fno-strict-aliasing -fwrapv for gcc > > So, that means that you would get better performance if you applied on Python > v2.7 what Python v3.5 did about Py_SIZE(x) . > However, there are

[issue27720] decimal.Context.to_eng_string wrong docstring

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: > after reading the bad standard ... Make sure not to buy a Power 6 processor and not to use IEEE 754-2008, because that's essentially what you'll get. IEEE doesn't specify engineering notation though. --

[issue27502] Python -m Module Vulnerable to Buffer Over Flow.

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: Your "buffer overflow" png shows the regular "414 request-uri too large" traceback. A traceback is not a crash (I wonder if we need an faq for this). -- nosy: +skrah resolution: -> not a bug stage: -> resol

[issue12345] Add math.tau

2016-08-11 Thread Stefan Krah
Stefan Krah added the comment: Aaron, I may be wrong, but I understood this to be something like: >>> from __future__ import barry_as_FLUFL >>> 3 <> 10 True I *do* hope sympy supports that! :-) -- nosy: +skrah _

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

2016-08-12 Thread Stefan Krah
Stefan Krah added the comment: On Fri, Aug 12, 2016 at 08:38:52PM +, Serge Stroobandt wrote: > This should not be that difficult to implement? > I promise, every six months an engineer will stop by here asking for this. > Instead of nagging, this could already have been implemente

[issue12345] Add math.tau

2016-08-13 Thread Stefan Krah
Changes by Stefan Krah : -- nosy: -skrah ___ Python tracker <http://bugs.python.org/issue12345> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-08-14 Thread Stefan Krah
Stefan Krah added the comment: Pavel did another analysis with the external packages removed. Thanks for this! http://www.viva64.com/en/b/0418/ The new analysis found another glitch. Also see my message to python-committers. -- nosy: +skrah

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-08-14 Thread Stefan Krah
Stefan Krah added the comment: Sorry, I missed issue27587_pystate_addmodule.diff: no new issue in the updated analysis. -- ___ Python tracker <http://bugs.python.org/issue27

[issue27734] Memory leaks at Python35-32

2016-08-15 Thread Stefan Krah
Stefan Krah added the comment: It is a known problem that PEP 3121 and later similar PEPs address. Most C extensions leak a (usually very small) amount of memory with each call to Initialize()/Finalize(). IMO this issue can be closed. -- nosy: +skrah

[issue27734] Memory leaks at Python35-32

2016-08-16 Thread Stefan Krah
Stefan Krah added the comment: #15787. All Python versions have these leaks, which aren't terribly important in practice. If it still bothers you, consider writing a Python C extension instead of "embedding" Python, which is what most people do anyway. -- status:

[issue27779] Sync-up docstrings in C version of the the decimal module

2016-08-16 Thread Stefan Krah
Stefan Krah added the comment: I found the docstrings a bit too verbose (the power() docstring takes up more than a page), but I'm happy to add it and review a patch. The patch authors need to take the hand written function signatures into account. -- assignee: docs@python -&g

[issue27725] Use Py_SIZE(x) instead of x->ob_size

2016-08-17 Thread Stefan Krah
Stefan Krah added the comment: Agreed, the changes are too big for 2.7. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue27818] Speed up number format spec parsing

2016-08-20 Thread Stefan Behnel
New submission from Stefan Behnel: I noticed that quite some time during number formatting is spent parsing the format spec. The attached patch speeds up float formatting by 5-15% and integer formatting by 20-30% for me overall when using f-strings (Ubuntu 16.04, 64bit). -- components

[issue27818] Speed up number format spec parsing

2016-08-20 Thread Stefan Behnel
Stefan Behnel added the comment: You can easily see it by running timeit on fstrings, e.g. patched: $ ./python -m timeit 'f"{34276394612:15}"' 100 loops, best of 3: 0.352 usec per loop $ ./python -m timeit 'f"{34.276394612:8.6f}"' 100 loops, best

[issue27128] Add _PyObject_FastCall()

2016-08-21 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: +scoder ___ Python tracker <http://bugs.python.org/issue27128> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27810] Add METH_FASTCALL: new calling convention for C functions

2016-08-21 Thread Stefan Behnel
Changes by Stefan Behnel : -- nosy: +scoder ___ Python tracker <http://bugs.python.org/issue27810> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27810] Add METH_FASTCALL: new calling convention for C functions

2016-08-21 Thread Stefan Behnel
Stefan Behnel added the comment: I agree that this would be cool. There is a tiny bit of a backwards compatibility concern as the new function signature would be incompatible with anything we had before, but I would guess that any code that chooses to bypass PyObject_Call() & friends woul

[issue27810] Add METH_FASTCALL: new calling convention for C functions

2016-08-22 Thread Stefan Behnel
Stefan Behnel added the comment: Extensive callback interfaces like map() come to mind, where a large number of calls becomes excessively time critical and might thus have made people implement their own special purpose calling code. However, I don't know any such code (outside of Cython

[issue27128] Add _PyObject_FastCall()

2016-08-22 Thread Stefan Behnel
Stefan Behnel added the comment: FYI: I copied your (no-kwargs) implementation over into Cython and I get around 17% faster calls to Python functions with 2 positional arguments. -- ___ Python tracker <http://bugs.python.org/issue27

[issue27128] Add _PyObject_FastCall()

2016-08-22 Thread Stefan Behnel
Stefan Behnel added the comment: > What do you mean by "I copied your (no-kwargs) implementation"? I copied what you committed into CPython for _PyFunction_FastCall(): https://github.com/cython/cython/commit/8f3d3bd199a3d7f2a9fdfec0af57145b3ab363ca and then enabled its usage i

[issue27809] _PyObject_FastCall(): add support for keyword arguments

2016-08-22 Thread Stefan Behnel
Stefan Behnel added the comment: I like the oneArg/noArg etc. macros. We use something similar in Cython. You can even use them to inline the METH_O and METH_NOARGS call cases (although I use inline functions for that in Cython). -- ___ Python

[issue27809] _PyObject_FastCall(): add support for keyword arguments

2016-08-22 Thread Stefan Behnel
Stefan Behnel added the comment: I just took a quick look at the fastcall_kwargs-2.patch for now. It looks ok in general, but it also adds quite some special code for the dict-to-locals mapping. Is the keyword argument calling case really that important? I mean, it requires creating a dict

[issue27841] Use fast call in method_call() and slot_tp_new()

2016-08-23 Thread Stefan Behnel
Stefan Behnel added the comment: If you care so much about C stack space, you could also try to create two or three entry point functions that keep (say) a 4, 8 and 16 items array on the stack respectively, and then pass the pointer (and the overall length if you need it) of that array on

[issue26284] Fix telco benchmark

2016-08-30 Thread Stefan Krah
Stefan Krah added the comment: Wow, on my machine this is very stable, great. The output should be like http://www.bytereef.org/software/mpdecimal/benchmarks/telco.py , but printing one number only should be okay. The important thing is that some decimal is printed at all to test the

[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-13 Thread Stefan Krah
Stefan Krah added the comment: Here's a proposal for an alternative without parameter docstrings and a different DSL (see os_stat.c). I guess it's easiest to present my thoughts in list form. Changes and rationale: == Split docstring into function heade

[issue16612] Integrate "Argument Clinic" specialized preprocessor into CPython trunk

2013-02-13 Thread Stefan Krah
Stefan Krah added the comment: Jim Jewett wrote: > (1) The first several lines ( "/* pymacro.h */" until "/* could go into a > separate header file */" ) would not be written at all, and are just there to > help reviewers understand. Yes, they should ultimat

[issue17210] documentation of PyUnicode_Format() states wrong argument type requirements

2013-02-15 Thread Stefan Behnel
New submission from Stefan Behnel: The current documentation says: """ PyObject* PyUnicode_Format(PyObject *format, PyObject *args) Return value: New reference. Return a new string object from format and args; this is analogous to format % args. The args argument

<    36   37   38   39   40   41   42   43   44   45   >