[issue26118] String performance issue using single quotes

2016-01-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Jan 15, 2016 at 07:56:39AM +, poostenr wrote: > As I did more testing I noticed that appending data to the file slowed > down. The file grew initially with ~30-50KB increments and around > 500KB it had slowed down to ~3-5KB/s, until around 1MB the

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
New submission from Charles Daffern: The shlex.quote and pipes.quote functions do not quote shell keywords. Example shell keywords: done, time, coproc, while Presumably the intent of the quote functions is to prevent the resulting string from altering the syntax of the script it is inserted

[issue26122] Isolated mode doesn't ignore PYTHONHASHSEED

2016-01-15 Thread Nick Coghlan
New submission from Nick Coghlan: While working on the draft PEP 432 implementation, I noticed that -I isn't special cased for early processing the same way that -E is: https://hg.python.org/cpython/file/tip/Modules/main.c#l265 This means that when isolated mode is used to turn off

[issue26072] pdb fails to access variables closed over

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +georg.brandl type: -> behavior ___ Python tracker ___

[issue26121] Use C99 functions in math if available

2016-01-15 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Currently the math module uses own implementation of some mathematical functions that are in C99 standard, but not in C89 standard: tgamma, lgamma, erf, erfc. Proposed patch makes it to use functions from standard C library if they are available. They are

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-01-15 Thread Alessandro Cucci
Alessandro Cucci added the comment: I there anything else I can do for this? -- ___ Python tracker ___ ___

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Sebastian Rittau
New submission from Sebastian Rittau: The HTTP status code constants in Python 3.5 http.client are not compatible with the constants in Python 3.4, since the str() behaviour is different. This breaks code: srittau@moby:~$ python3.5 Python 3.5.1+ (default, Jan 13 2016, 15:09:18) [GCC 5.3.1

[issue26121] Use C99 functions in math if available

2016-01-15 Thread Christian Heimes
Christian Heimes added the comment: Faster: maybe. More accurate ... Mark can tell you some funny stories. :) -- nosy: +christian.heimes ___ Python tracker

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- components: +Library (Lib) -Extension Modules nosy: +eric.araujo versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker

[issue23606] ctypes.util.find_library("c") no longer makes sense

2016-01-15 Thread Steve Dower
Steve Dower added the comment: The msvcrt module? I don't think so. -- ___ Python tracker ___ ___

[issue26084] HTMLParser mishandles last attribute in self-closing tag

2016-01-15 Thread Ezio Melotti
Ezio Melotti added the comment: This is not a bug, as described in the HTML5 standard[0], if an unquoted attribute value is followed by a /, the / is included (the "anything else" branch of that list). This is also what browsers do: try to create an HTML document that includes and open it in

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- keywords: +3.5regression nosy: +serhiy.storchaka type: -> behavior versions: +Python 3.6 ___ Python tracker

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-15 Thread Ezio Melotti
Ezio Melotti added the comment: LGTM unless you think we should also add a test that checks that the name of the incorrect type is included in the error message. -- nosy: +ezio.melotti stage: -> commit review type: -> behavior versions: +Python 3.5, Python 3.6 -Python 3.4

[issue18595] zipfile: symlinks etc.

2016-01-15 Thread Thomas Kluyver
Changes by Thomas Kluyver : -- nosy: +takluyver ___ Python tracker ___ ___ Python-bugs-list

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-15 Thread Carlo Beccarini
New submission from Carlo Beccarini: Incorrect error message in the module asyncio.selector_events for the methods: _SelectorSocketTransport.write _SelectorSslTransport.write _SelectorDatagramTransport.sendto. The previous error was raising a Tuple: TypeError: ('data argument must be byte-ish

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please provide an example? -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue26118] String performance issue using single quotes

2016-01-15 Thread poostenr
poostenr added the comment: Thank you for your feedback Victor and Steven. I just copied my scripts and 360MB of CSV files over to Linux. The entire process finished in 4 minutes exactly, using the original python scripts. So there is something different between my environments. If it was a

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Sebastian Rittau
Sebastian Rittau added the comment: It is no doubt that is easy to work around. Once I found the problem it took about five minutes to fix it and roll a new release. And of course for Python 3.5+ code it is better to use the enum http.HTTPStatus directly (I actually like that enum a lot). But

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 76eb752e5447 by Brett Cannon in branch '3.5': Issue #26114: Remove a reference to 'Numerical Recipes'. https://hg.python.org/cpython/rev/76eb752e5447 New changeset 8ad701463cd7 by Brett Cannon in branch 'default': Merge for issue #26114

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset faac8f09020d by Brett Cannon in branch '2.7': Issue #26114: Remove mention of 'Numerical Recipes'. https://hg.python.org/cpython/rev/faac8f09020d -- ___ Python tracker

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Brett Cannon
Changes by Brett Cannon : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker ___

[issue26039] More flexibility in zipfile interface

2016-01-15 Thread Thomas Kluyver
Thomas Kluyver added the comment: Attached is a first go at a patch enabling zipfile.open(blah, mode='w') Files must be written sequentially, so you have to close one writing handle before opening another. If you try to open a second one before closing the first, it will raise RuntimeError. I

[issue26118] String performance issue using single quotes

2016-01-15 Thread SilentGhost
SilentGhost added the comment: poostenr, this is demonstrably not a problem with the CPython, which this bug tracker is about. There are few options available on the internet if you need help with your code: mailing lists and irc are among them. -- nosy: +SilentGhost resolution: ->

[issue26121] Use C99 functions in math if available

2016-01-15 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +brett.cannon ___ Python tracker ___ ___

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-15 Thread Carlo Beccarini
Carlo Beccarini added the comment: https://github.com/python/asyncio/pull/313 -- ___ Python tracker ___ ___

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be. But only if this doesn't make the documentation too verbose. -- assignee: -> docs@python components: +Documentation keywords: +easy nosy: +docs@python stage: -> needs patch ___ Python tracker

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-15 Thread Carlo Beccarini
Changes by Carlo Beccarini : -- type: behavior -> versions: +Python 3.4 -Python 3.5, Python 3.6 Added file: http://bugs.python.org/file41625/patch.diff ___ Python tracker

[issue19475] Add timespec optional flag to datetime isoformat() to choose the precision

2016-01-15 Thread R. David Murray
Changes by R. David Murray : -- nosy: -r.david.murray ___ Python tracker ___ ___

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
Charles Daffern added the comment: It's definitely a corner case (in argv[0] position + is keyword), but here's an example: >>> import subprocess >>> import shlex >>> subprocess.call(shlex.quote("done"), shell=True) /bin/sh: 1: Syntax error: "done" unexpected 2 The expected output of this

[issue26125] Incorrect error message in the module asyncio.selector_events.

2016-01-15 Thread Guido van Rossum
Guido van Rossum added the comment: Remember also to apply to asyncio's own GitHub repo. --Guido (mobile) On Jan 15, 2016 6:03 AM, "Ezio Melotti" wrote: > > Ezio Melotti added the comment: > > LGTM unless you think we should also add a test that checks that the name >

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the historical information, Mark! I'll either update the comment or flat-out delete it so it doesn't trip anyone else up. I'll also scale back the scope of the update since it's just a cleanup and not an IP issue. -- assignee: ->

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This does not seem to be a serious problem. In any case the command is failed. And usually argv[0] is predefined command name, not arbitrary user input. To be sure that it is existing program, you can use shutil.which(). I would close this issue as "won't

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
Charles Daffern added the comment: In that case, should the documentation specify that shlex.quote is unsuitable for quoting command names? -- ___ Python tracker

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Ethan Furman
Ethan Furman added the comment: These changes were made in issue21793. -- ___ Python tracker ___ ___

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Yes, this a side effect of using more human-friendly enums. This is not a problem if string representation is used in formatting human-readable messages, but if you need numerical representation, you could use str(int(code)), '%d' % code or

[issue26126] Possible subtle bug when normalizing and str.translate()ing

2016-01-15 Thread Peter Otten
Peter Otten added the comment: There seems to be a connection to hash randomization. I consistently get $ PYTHONHASHSEED=1 python3.6 ./normbug.py BUG ('The aenid oevre', '!=', 'The AEnid oevre') $ PYTHONHASHSEED=0 python3.6 ./normbug.py OK ('The AEnid oevre', '==', 'The AEnid oevre')

[issue26126] Possible subtle bug when normalizing and str.translate()ing

2016-01-15 Thread Mark Summerfield
New submission from Mark Summerfield: I am using Python 3.4.3 on Xubuntu 14.04 LTS 64-bit. I have a program that when run repeatedly sometimes what I expect, and sometimes does not: $ ~/tmp/normbug.py OK ('The AEnid oevre', '==', 'The AEnid oevre') $ ~/tmp/normbug.py OK ('The AEnid oevre',

[issue26126] Possible subtle bug when normalizing and str.translate()ing

2016-01-15 Thread Peter Otten
Peter Otten added the comment: Not a bug. In your XFORMS dict you have >>> ord("Æ") == 0xC6 True Whether the value of "Æ" or 0xC6 is used by str.maketrans() depends on the order of the dict entries which in turn is determined by the keys' hash. Remove one and you should see consistent

[issue26094] ConfigParser.get() doc to be updated according to the configparser.py header doc

2016-01-15 Thread Fred L. Drake, Jr.
Changes by Fred L. Drake, Jr. : -- nosy: +fdrake ___ Python tracker ___ ___

[issue17633] zipimport's handling of namespace packages is incorrect

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 07a615a8f9ad by Brett Cannon in branch '3.5': Issue #17633: Improve support for namespace packages with zipimport. https://hg.python.org/cpython/rev/07a615a8f9ad New changeset 87f87673af7b by Brett Cannon in branch 'default': Merge for issue #17633

[issue26126] Possible subtle bug when normalizing and str.translate()ing

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- status: open -> closed ___ Python tracker ___ ___

[issue26126] Possible subtle bug when normalizing and str.translate()ing

2016-01-15 Thread SilentGhost
SilentGhost added the comment: Mark, your XFORMS dictionary contains this entry: 0x00C6: "ae" It should be 'AE'. The same applies to 0x0152: "oe" which should be 'OE'. -- nosy: +SilentGhost resolution: -> not a bug stage: -> resolved ___ Python

[issue26127] Broken link in docs for tokenize

2016-01-15 Thread Antony Lee
New submission from Antony Lee: The docs for `tokenize.detect_encoding` state `Use open() to open Python source files: it uses detect_encoding() to detect the file encoding.` Unfortunately, clicking on `open` redirects to the builtin `open` function, not to `tokenize.open` as it should.

[issue26127] Broken link in docs for tokenize

2016-01-15 Thread SilentGhost
SilentGhost added the comment: Here is the patch. Most of the fixes are however for the tokenize function that was for whatever reason linked to the module. -- keywords: +patch nosy: +SilentGhost stage: -> patch review type: -> behavior Added file:

[issue17633] zipimport's handling of namespace packages is incorrect

2016-01-15 Thread Brett Cannon
Brett Cannon added the comment: The fix for 3.5 is in https://hg.python.org/cpython/rev/07a615a8f9ad and 3.6 in https://hg.python.org/cpython/rev/87f87673af7b. Thanks to Phil and Mike for tackling this problem! -- resolution: -> fixed stage: patch review -> resolved status: open ->

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: It's not at all obvious that the intention is to ensure such an argument should be treated only as a command external to the shell. If an application really wants to ensure the command is not handled as a shell built-in, it should use shell=False. Making

[issue26124] shlex.quote and pipes.quote do not quote shell keywords

2016-01-15 Thread Charles Daffern
Charles Daffern added the comment: >To be sure that it is existing program, you can use shutil.which() I'd like to clear this up a little because this is worded as if shutil.which()'s success implies that the shell will not fail. Here is the setup to demonstrate: >>> import os, shlex,

[issue26128] Let the subprocess.STARTUPINFO constructor take arguments

2016-01-15 Thread Ram Rachum
New submission from Ram Rachum: Right now when you want to use `subprocess.STARTUPINFO`, you need to do something like this: si = subprocess.STARTUPINFO() si.dwFlags = subprocess.STARTF_USESTDHANDLES subprocess.Popen(['whatever'], startupinfo=si) It would be much nicer to do

[issue26129] Difference in behaviour with grp.getgrgid and pwd.getpwuid

2016-01-15 Thread Simon Fraser
New submission from Simon Fraser: grp.getgrgid is capable of accepting a string: from grp import getgrgid print(getgrgid('0')) However, pwd.getpwuid can't do the same: from pwd import getpwuid print(getpwuid('0')) Traceback (most recent call last): File "getpwuid_test.py", line 2, in

[issue26130] redundant local copy of a char pointer in classify in Parser\parser.c

2016-01-15 Thread Oren Milman
New submission from Oren Milman: In Parser\parser.c in classify, the 'str' parameter is assigned into the local variable 's'. However, 'str' is not used anywhere else in the function, which makes 's' redundant. My proposal is to simply remove 's', and just use 'str' instead. The diff is

[issue26130] redundant local copy of a char pointer in classify in Parser\parser.c

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +benjamin.peterson, brett.cannon, georg.brandl, ncoghlan, yselivanov ___ Python tracker ___

[issue26130] redundant local copy of a char pointer in classify in Parser\parser.c

2016-01-15 Thread Georg Brandl
Georg Brandl added the comment: Looks good to me. s was probably left over after a rewrite of the function. -- ___ Python tracker ___

[issue21762] update the import machinery to only use __spec__

2016-01-15 Thread Brett Cannon
Brett Cannon added the comment: So I am going to disagree with Nick about the module attributes and their usefulness (partially because I just made __spec__.parent take precedence over __package__ in issue #25791). While I get the idea of wanting a history of what did (not) change since

[issue26131] Raise ImportWarning when loader.load_module() is used

2016-01-15 Thread Brett Cannon
New submission from Brett Cannon: Since loader.load_module() is documented as deprecated, we should consider raising an ImportWarning when it is used. That way when Python 2.7 support ends we can either remove it or have one more release where the various ImportWarnings turn into

[issue24840] implement bool conversion for enums to prevent odd edge case

2016-01-15 Thread Ethan Furman
Ethan Furman added the comment: Mike, my apologies. In the future I'll make sure and read the docs before I go through with changes. In the docs (https://www.python.org/dev/peps/pep-0435/#id35): The reason for defaulting to 1 as the starting number and not 0 is that 0 is False in a

[issue26003] Issues with PyEval_InitThreads and PyGILState_Ensure

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6908b2c9a404 by Brett Cannon in branch 'default': Issue #25791: Raise an ImportWarning when __spec__ or __package__ are https://hg.python.org/cpython/rev/6908b2c9a404 -- nosy: +python-dev ___ Python

[issue25791] Raise an ImportWarning when __spec__.parent/__package__ isn't defined for a relative import

2016-01-15 Thread Brett Cannon
Brett Cannon added the comment: Thanks for the patch, Rose! I did notice your review comments about the missing goto and the stacklevel and I simply added them myself. -- resolution: -> fixed stage: test needed -> resolved status: open -> closed

[issue21235] importlib's spec module create algorithm is not exposed

2016-01-15 Thread Brett Cannon
Brett Cannon added the comment: Due to lack of response, I'm assuming all issues are now addressed. -- status: pending -> closed ___ Python tracker ___

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Martin Panter
Martin Panter added the comment: This affected the HTTP server log messages, discussed from onwards. The first three patches proposed changed the HTTPStatus.__str__() implementation, which would have avoided the problem in general. But Demian’s

[issue26123] http.client status code constants incompatible with Python 3.4

2016-01-15 Thread Ethan Furman
Ethan Furman added the comment: Not using Enum's __str__ was discussed (I think during the initial Enum threads when PEP435 was being debated) and IIRC Guido was strongly against it as it took away half the purpose of using an Enum. -- ___ Python

[issue9372] pulldom.DOMEventStream.__getitem__ is broken

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Similar outdated __getitem__ left in wsgiref.util.FileWrapper and fileinput.FileInput. -- nosy: +serhiy.storchaka ___ Python tracker

[issue18287] PyType_Ready() should sanity-check the tp_name field

2016-01-15 Thread Rose Ames
Rose Ames added the comment: There's still no check on tp_name. The patch looks reasonable, applies cleanly, compiles, and doesn't break any tests - suggest it be merged. -- nosy: +superluser ___ Python tracker

[issue24832] Issue building viewable docs with newer sphinx (default theme -> classic)

2016-01-15 Thread Benjamin Peterson
Benjamin Peterson added the comment: We build happily with 1.3.3 on docs.python.org, so looks like everything is okay. -- resolution: third party -> fixed status: open -> closed ___ Python tracker

[issue26035] traceback.print_tb() takes `tb`, not `traceback` as a keyword argument

2016-01-15 Thread Senthil Kumaran
Senthil Kumaran added the comment: Thanks for the patch, Upendra Kumar. It's fixed now. Appreciate your taking care of other args and making the change meaningful. -- assignee: docs@python -> orsenthil nosy: +orsenthil resolution: -> fixed stage: needs patch -> resolved status: open

[issue14771] Occasional failure in test_ioctl when run parallel with test_gdb

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8b8ac7adbf49 by Martin Panter in branch '2.7': Issue #14771: Redirect GDB's stdin to avoid messing the terminal settings https://hg.python.org/cpython/rev/8b8ac7adbf49 New changeset c87cc05af8e7 by Martin Panter in branch '3.5': Issue #14771:

[issue26094] ConfigParser.get() doc to be updated according to the configparser.py header doc

2016-01-15 Thread Martin Panter
Martin Panter added the comment: Perhaps the doc string of the module should be condensed into a much shorter summary of the class and its methods, and the details should be moved to individual doc strings and the main documentation. -- nosy: +martin.panter stage: -> needs patch

[issue26127] Broken link in docs for tokenize

2016-01-15 Thread Martin Panter
Martin Panter added the comment: Oops that last commit was for Issue #14771 -- ___ Python tracker ___ ___

[issue26127] Broken link in docs for tokenize

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 620a37dbc686 by Martin Panter in branch 'default': Issue #26127: Merge test_gdb fix from 3.5 https://hg.python.org/cpython/rev/620a37dbc686 -- ___ Python tracker

[issue14771] Occasional failure in test_ioctl when run parallel with test_gdb

2016-01-15 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue26035] traceback.print_tb() takes `tb`, not `traceback` as a keyword argument

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset daff4ced1b32 by Senthil Kumaran in branch '2.7': Issue26035 - Correct the argument names used in the docs of the traceback module. Make it consistent with module args. https://hg.python.org/cpython/rev/daff4ced1b32 --

[issue26035] traceback.print_tb() takes `tb`, not `traceback` as a keyword argument

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset e40f6c3dc114 by Senthil Kumaran in branch '3.5': Issue26035 - Correct the argument names used in the docs of the traceback module. Make it consistent with module args. https://hg.python.org/cpython/rev/e40f6c3dc114 New changeset e96c1491896d by

[issue23883] __all__ lists are incomplete

2016-01-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 571632315c36 by Martin Panter in branch 'default': Issue #23883: Missing fileinput.__all__ APIs; patch by Mauro SM Rodrigues https://hg.python.org/cpython/rev/571632315c36 New changeset a2ffa9eedb1b by Martin Panter in branch 'default': Issue

[issue26126] Possible subtle bug when normalizing and str.translate()ing

2016-01-15 Thread Mark Summerfield
Mark Summerfield added the comment: Thanks for looking at this. In my full translation dict I had some other mistakes of case, now all fixed:-) -- ___ Python tracker

[issue23883] __all__ lists are incomplete

2016-01-15 Thread Martin Panter
Martin Panter added the comment: I committed the last three patches to 3.6: 571632315c36: fileinput a2ffa9eedb1b: calendar 48090e08e367: tarfile a5d3ebb6ad2a: Update news Please let me know if there are some outstanding patches here that I missed. Otherwise, I think we are up to step 6 in

[issue26116] CSV-module. The example code don't work. Have to be: reader = csv.reader(csvfile, dialect=dialect)

2016-01-15 Thread Василь Коломієць
Василь Коломієць added the comment: )) Thanks! Be happy! -- ___ Python tracker ___ ___ Python-bugs-list

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Mark Dickinson
Mark Dickinson added the comment: The comment is unfortunate. The code in Modules/mathmodule.c *was* written from scratch (by me). All I took from Numerical Recipes was the idea of using continued fractions from one part of the domain and a power-series expansion for another part. If you

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Mark Dickinson
Mark Dickinson added the comment: ... and the way I read it, the NR licence applies specifically to their code, not to the basic numerical ideas set out in the text (which is all we're using). We're not using the actual code from NR at all. IOW, IANAL but I really don't think there's an issue

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: erf() is a part of C99. May be move hand-writen implementation to Modules/_math.c and use libc erf() if available? -- nosy: +serhiy.storchaka ___ Python tracker

[issue23606] ctypes.util.find_library("c") no longer makes sense

2016-01-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > Strictly there's nothing incorrect about the docs, and `cdll.msvcrt` is no > more incorrect than it has been since Python 2.4 or so (whenever we stopped > using VC6). It will find the DLL and you can call the functions, but it isn't > the same DLL as the

[issue26118] String performance issue using single quotes

2016-01-15 Thread STINNER Victor
STINNER Victor added the comment: I implemented overkill optimization in _PyUnicodeWriter API used by str.format() and str%args. If the result is the input, the string is not copied by value, but by reference. >>> x="hello" >>> ("%s" % x) is x True >>> ("{}".format(x)) is x True If the

[issue26118] String performance issue using single quotes

2016-01-15 Thread STINNER Victor
STINNER Victor added the comment: > If you see a factor of 30x difference in your code, I suspect it's not > related to str.format(), but some other processing in your code. The performance of instructions like ("x=%s" % x) or ("x={}".format(x)) depend on the length of the string. Maybe

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 15.01.2016 10:05, Mark Dickinson wrote: > > Mark Dickinson added the comment: > > ... and the way I read it, the NR licence applies specifically to their code, > not to the basic numerical ideas set out in the text (which is all we're > using). We're

[issue26114] Rewrite math.erf() and math.erfc() from scratch

2016-01-15 Thread Mark Dickinson
Mark Dickinson added the comment: @Serhiy: Sure, that would work (the same way that we do for log1p). I *think* I tried this at the time, but it turns out that some libm implementations of erf and erfc are pretty bad, so our tests failed. (But I may be misremembering.) In any case, the

[issue26092] doctest should allow custom sys.displayhook

2016-01-15 Thread SilentGhost
Changes by SilentGhost : -- nosy: +georg.brandl versions: +Python 3.6 ___ Python tracker ___

[issue26084] HTMLParser mishandles last attribute in self-closing tag

2016-01-15 Thread Xiang Zhang
Xiang Zhang added the comment: I don't think this is a bug. The HTML5 syntax spec tells: If an attribute using the unquoted attribute syntax is to be followed by another attribute or by the optional "/" (U+002F) character allowed in step 6 of the start tag syntax above, then there must be

[issue26084] HTMLParser mishandles last attribute in self-closing tag

2016-01-15 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, can not say the behaviour is right. But since the HTML doesn't follows the official rule, HTMLParser's behaviour is understandable and can not be identified as incorrect. -- ___ Python tracker