[issue21127] Path objects cannot be constructed from str subclasses

2014-04-07 Thread Antony Lee
Antony Lee added the comment: The attached patch should fix the issue. -- keywords: +patch Added file: http://bugs.python.org/file34759/pathlib.patch ___ Python tracker ___ _

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's my latest and greatest version. I'll finish up after some sleep. -- Added file: http://bugs.python.org/file34758/mat-mult4.patch ___ Python tracker __

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: + .. versionadded:: 3.4 Are you planning to use the time machine? :-) -- ___ Python tracker ___ ___

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Mon, Apr 7, 2014, at 22:25, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > + .. versionadded:: 3.4 > > Are you planning to use the time machine? :-) Good catch. :) -- ___ Pytho

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Mon, Apr 7, 2014, at 22:23, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > Thanks for stepping in. From a quick look at your patch I don't see > anything that I would do much differently. > > I noticed some whitespace issues

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Thanks for stepping in. From a quick look at your patch I don't see anything that I would do much differently. I noticed some whitespace issues in Include/token.h: -#define AT 49 -#define RARROW 50 -#define ELLIPSIS51

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: On Mon, Apr 7, 2014, at 22:09, Alexander Belopolsky wrote: > > Alexander Belopolsky added the comment: > > Wow! That was quick. And I am still fighting with bitbucket. Maybe I > should stop duplicating the effort at this point. Sorry about that. I only saw

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Wow! That was quick. And I am still fighting with bitbucket. Maybe I should stop duplicating the effort at this point. -- ___ Python tracker ___

[issue21171] Outdated usage str.encode('rot-13') in rot13 codec

2014-04-07 Thread Berker Peksag
Berker Peksag added the comment: Here's a patch. I tested it with the following command: $ cat LICENSE | ./python -m encodings.rot_13 -- keywords: +patch nosy: +berker.peksag stage: -> patch review type: enhancement -> behavior Added file: http://bugs.python.org/file34757/issue2117

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here is a nearly complete patch... -- Added file: http://bugs.python.org/file34756/mat-mult3.patch ___ Python tracker ___ ___

[issue21171] Outdated usage str.encode('rot-13') in rot13 codec

2014-04-07 Thread Berker Peksag
Changes by Berker Peksag : -- nosy: +lemburg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I've got to the point where I can do >>> import ast >>> ast.dump(ast.parse('a @ b')) "Module(body=[Expr(value=BinOp(left=Name(id='a', ctx=Load()), op=MatMult(), right=Name(id='b', ctx=Load(])" I'll post a link to my bitbucket clone shortly. ---

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here are changes to the operator module... -- Added file: http://bugs.python.org/file34755/mat-mult2.patch ___ Python tracker ___ ___

[issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

2014-04-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: As far as performance goes, presumably the length hinting API reduces the number of cases in which we're working with completely unsized iterables, right? -- ___ Python tracker __

[issue16395] Documentation claims that PySequence_Fast returns a tuple, when it actually returns a list.

2014-04-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Any news on this? I was about to open a bug of my own for this, since the docs and code are still out of sync. -- nosy: +josh.rosenberg ___ Python tracker

[issue21059] idle_test.test_warning failure

2014-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset c507da0b573f by Zachary Ware in branch 'default': Issue #21059: Temporary measure to make the Windows buildbots useful again. http://hg.python.org/cpython/rev/c507da0b573f -- nosy: +python-dev ___ Python

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Benjamin Peterson
Benjamin Peterson added the comment: Here's a first patch. It works, but needs more tests (associativity, precedence, __rmatmul__, etc...) and also docs. I can work on that tomorrow. -- keywords: +patch nosy: +benjamin.peterson Added file: http://bugs.python.org/file34754/mat-mult1.patc

[issue20035] Clean up Tcl library discovery in Tkinter on Windows

2014-04-07 Thread Zachary Ware
Zachary Ware added the comment: Serhiy Storchaka wrote: > TCL_VERSION should be set before call of Tcl_FindExecutable() (for correct Tcl > encodings initialization). Tcl_FindExecutable() is called in > PyInit__tkinter(). I assume you mean TCL_LIBRARY (since TCL_VERSION is #defined in Tcl.h)? Y

[issue21176] Implement matrix multiplication operator (PEP 465)

2014-04-07 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: [Nathaniel Smith at numpy-discussion] Guido just formally accepted PEP 465: https://mail.python.org/pipermail/python-dev/2014-April/133819.html http://legacy.python.org/dev/peps/pep-0465/#implementation-details Yay. The next step is to implement it

[issue1887] Document that distutils doesn't support out-of-source builds

2014-04-07 Thread Alba Magallanes
Alba Magallanes added the comment: hi, here is a second version of the patch. Please review it. -- keywords: +patch Added file: http://bugs.python.org/file34753/bug1887_2.patch ___ Python tracker ___

[issue21175] Refcounting error in str.translate fastpath

2014-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset fa6debebfe8b by Benjamin Peterson in branch 'default': fix reference leaks in the translate fast path (closes #21175) http://hg.python.org/cpython/rev/fa6debebfe8b -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected stat

[issue21174] A typo in the docs for "exception GeneratorExit"

2014-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset aff368b58a98 by Benjamin Peterson in branch '2.7': fix verb (closes #21174) http://hg.python.org/cpython/rev/aff368b58a98 New changeset 33528b9520e6 by Benjamin Peterson in branch '3.4': fix verb (closes #21174) http://hg.python.org/cpython/rev/3352

[issue21175] Refcounting error in str.translate fastpath

2014-04-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: Also, just to be clear, I submitted the contributor form earlier this evening (using the online submission tool), so as soon as that propagates, it should be possible to accept my code. -- ___ Python tracker

[issue21175] Refcounting error in str.translate fastpath

2014-04-07 Thread Josh Rosenberg
Josh Rosenberg added the comment: For reference, bug introduced by fix for #21118. -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue21175] Refcounting error in str.translate fastpath

2014-04-07 Thread Josh Rosenberg
New submission from Josh Rosenberg: Py_None is not being properly decref-ed in the str.translate fast path. I've attached a simple patch that fixes this (also corrects some comments and types in the same function). No idea is Py_None ref leaks are considered a serious problem, but I figure it

[issue21174] A typo in the docs for "exception GeneratorExit"

2014-04-07 Thread Boštjan Mejak
New submission from Boštjan Mejak: The docs for the exception GeneratorExit starts like this: Raise when a generator‘s close() method is called. The sentece should start with the first word "Raise" to say "Raised". You can find this particular doc sentence on this link: https://docs.python.org

[issue21165] Optimize str.translate() for replacement with substrings and non-ASCII strings

2014-04-07 Thread Josh Rosenberg
Changes by Josh Rosenberg : -- nosy: +josh.rosenberg ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue21173] WeakKeyDictionary.__len__ fragile w/ _IterationGuards

2014-04-07 Thread Philip Jenvey
Changes by Philip Jenvey : -- keywords: +patch Added file: http://bugs.python.org/file34751/issue21173-test.diff ___ Python tracker ___ __

[issue21173] WeakKeyDictionary.__len__ fragile w/ _IterationGuards

2014-04-07 Thread Philip Jenvey
New submission from Philip Jenvey: len() on WeakKeyDictionarys can fail with ValueErrors when _IterationGuards are kept alive Attached is a test showing this: == ERROR: test_weak_keys_len_destroy_while_iterating (__main__.Mapp

[issue15968] Incorporate Tcl/Tk/Tix into the Windows build process

2014-04-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: I reran external.bat in all three versions and compile runs better. Test_idle with -ugui fails to find _tkinter after another test that runs tk (including itself) *in the same process*. Adding -j2 to run in separate process eliminates the problem. F:\Python\de

[issue21139] Idle: change default reformat width from 70 to 72

2014-04-07 Thread Terry J. Reedy
Terry J. Reedy added the comment: Changing the default in the default configuration file is trivial. In test_formatparagraph.FormatEventTest, test_comment_block and test_long_line currently fail if the reformat width is changed on the General tab of the configuration dialog. These tests will n

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-07 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- assignee: -> vinay.sajip nosy: +vinay.sajip ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue21172] Unexpected behaviour with logging.LogRecord "first arg is dict" case

2014-04-07 Thread Alan Briolat
New submission from Alan Briolat: The logging.LogRecord class is more restrictive with its "first arg is dict" case than the formatting operator it uses requires. As far as I can tell, for "%(foo)s" % bar, the minimum contract is that bar.__getitem__("foo") succeeds, not that bar is an instan

[issue21171] Outdated usage str.encode('rot-13') in rot13 codec

2014-04-07 Thread Михаил Мишакин
Changes by Михаил Мишакин : -- components: +Library (Lib) ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue21171] Outdated usage str.encode('rot-13') in rot13 codec

2014-04-07 Thread Михаил Мишакин
New submission from Михаил Мишакин: Function rot13 in file "encodings/rot_13.py" throws exception: LookupError: 'rot-13' is not a text encoding; use codecs.encode() to handle arbitrary codecs -- messages: 215712 nosy: Pix priority: normal severity: normal status: open title: Outdated u

[issue14373] C implementation of functools.lru_cache

2014-04-07 Thread Patrick Westerhoff
Changes by Patrick Westerhoff : -- nosy: +poke ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue1191964] asynchronous Subprocess

2014-04-07 Thread akira
akira added the comment: Could `read_nonblocking()`, `write_nonblocking()` raise OSError(EAGAIN) (it could be named `ResourceTemporarilyUnavailableError`) if read/write would block? It would allow to distinguish EOF (permanent condition) from "read/write would block" (temporarily condition) wi

[issue21168] unicodeobject.c: likely type-punning may break strict-aliasing rules

2014-04-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue21170] Incorrect signature for unittest.TestResult.startTestRun(), .stopTestRun()

2014-04-07 Thread Volodymyr Sapsai
New submission from Volodymyr Sapsai: Steps to reproduce: 1. Open docs for unittest.TestResult class. 2. Look at startTestRun() and stopTestRun() methods signatures (https://docs.python.org/3.4/library/unittest.html#unittest.TestResult.startTestRun) Actual result: It is stated that aforemention

[issue1191964] asynchronous Subprocess

2014-04-07 Thread akira
akira added the comment: > Also, Richard Oudkerk's claims above about not needing to use fcntl to swap > flags is not correct. It's necessary to not block on reading, even if select > is used. Select just guarantees that there is at least 1 byte or a closed > handle, not that your full read wi

[issue1191964] asynchronous Subprocess

2014-04-07 Thread Giampaolo Rodola'
Giampaolo Rodola' added the comment: Some initial comments here: http://bugs.python.org/review/1191964/#msg1. Also, if I think about integrating this into an IO loop it seems natural to me to think about timeouts. How complicated would it be to do this? data = proc.read_nonblocking(timeout=0) d

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Stefan Krah
Stefan Krah added the comment: I agree we should add "-fp-model strict" to the icc build flags, provided that there is a way that it does not show up in the distutils flags. Apparently icc users want unsafe fast math by default, so this flag should probably not be enforced in extension module bu

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Mark Dickinson
Mark Dickinson added the comment: > It doesn't (at the moment). Sorry; that was an unhelpful kneejerk reply. There are two aspects to this. (1) Currently, at least in theory, CPython doesn't require IEEE 754 *at all*: in theory, it should work with whatever floating-point format the platform

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Mark: > > If Python requires strict IEEE 754 floating-point, > > It doesn't (at the moment). Does this imply that my patch is a better fix than requiring the builder to specify -fp-model strict to icc? For our use case either solution is valid. For administrat

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Mark Dickinson
Changes by Mark Dickinson : -- versions: -Python 3.5 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue21166] Bus error on "AMD64 FreeBSD 9.x 3.4" buildbot

2014-04-07 Thread koobs
koobs added the comment: Clarification: a) I had just installed Python 3.4 (at the system level, via ports) a) Removing Python 3.4 from the system and (forcing a rebuild of the buildbot) makes the issue go away. -- ___ Python tracker

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Mark Dickinson
Mark Dickinson added the comment: > If Python requires strict IEEE 754 floating-point, It doesn't (at the moment). -- ___ Python tracker ___

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Mark Dickinson
Mark Dickinson added the comment: > I tagged the issue as likely also present in 3.x. So I believe that this particular issue (float('nan') giving zero) should not be present on Python 3.4 or above. The bogus definition of Py_NAN will still cause problems in some math and cmath return values,

[issue21166] Bus error on "AMD64 FreeBSD 9.x 3.4" buildbot

2014-04-07 Thread koobs
koobs added the comment: Interestingly, I note the following lines from the gdb log: #5 0x000801ae1e99 in PyModule_Create2 () from /usr/local/lib/libpython3.4m.so.1 #6 0x000801840de8 in PyInit__heapq () from /usr/local/lib/python3.4/lib-dynload/_heapq.so I had installed Python 3.4 j

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: The compilation was performed with the default flags, i.e. without -fp-model strict or similar. If Python requires strict IEEE 754 floating-point, it should probably be mentioned at a prominent place in the documentation. Administrators building Python with al

[issue21166] Bus error on "AMD64 FreeBSD 9.x 3.4" buildbot

2014-04-07 Thread koobs
koobs added the comment: Uploading gdb output at Victors request -- nosy: +koobs Added file: http://bugs.python.org/file34749/gdb.log ___ Python tracker ___ _

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: sys.float_repr_style is 'short'. I haven't actually tried this in Python 3.5, but I did note the same definition of Py_NAN (which is used elsewhere in the code), so I tagged the issue as likely also present in 3.x. -- _

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : Added file: http://bugs.python.org/file34748/getpass_test_python3 ___ Python tracker ___ ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : Added file: http://bugs.python.org/file34747/getpass_test_python2 ___ Python tracker ___ ___

[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-07 Thread Arfrever Frehtes Taifersar Arahesis
New submission from Arfrever Frehtes Taifersar Arahesis: getpass.getpass() fails with non-ASCII characters in prompt. The attached example scripts (for Python 2 and 3) contain non-ASCII unicode prompt (Polish "hasło" == English "password") written in UTF-8. Python-2 version fails always. Python

[issue21168] unicodeobject.c: likely type-punning may break strict-aliasing rules

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: The warning comes from the make_bloom_mask() call below. make_bloom_mask() is called with kind=PyUnicode_2BYTE_KIND (Py_UCS2), whereas the gcc waring is about Py_UCS4. It looks like a false positive. static BLOOM_MASK bloom_linebreak = ~(BLOOM_MASK)0; ...

[issue20035] Clean up Tcl library discovery in Tkinter on Windows

2014-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: TCL_VERSION should be set before call of Tcl_FindExecutable() (for correct Tcl encodings initialization). Tcl_FindExecutable() is called in PyInit__tkinter(). -- ___ Python tracker

[issue21168] unicodeobject.c: likely type-punning may break strict-aliasing rules

2014-04-07 Thread STINNER Victor
New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.4/builds/48/steps/compile/logs/stdio Objects/unicodeobject.c: In function '_PyUnicode_Init': Objects/unicodeobject.c:582: warning: likely type-punning may break strict-aliasing rules: object '*

[issue21164] print unicode in Windows console

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: Hi, when you say "The console" is the the old MS-DOS command ("Windows console") opened when you run the "cmd.exe" program? Or IDLE or another console? For the Windows console, see the old issue #1602 which is not fixed yet. On Windows, sys.stdout.encoding is

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Mark Dickinson
Mark Dickinson added the comment: What's `sys.float_repr_style` for this build? For Python 3.5 and short float repr, `float('nan')` shouldn't even be using Py_NAN. It should land in _Py_parse_inf_or_nan in pystrtod.c, which uses `_Py_dg_stdnan` to get the NaN value directly from a suitable b

[issue1814] Victor Stinner's GMP patch for longs

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: > What about using PyVarObject of mp_limb_t and mpn instead of mpz_t? FYI this issue is closed, it's not a good practice to comment closed issue (for example, the issue is hidden in the list of recent issues). If you want to learn more about my old patch, you

[issue1814] Victor Stinner's GMP patch for longs

2014-04-07 Thread Hristo Venev
Hristo Venev added the comment: What about using PyVarObject of mp_limb_t and mpn instead of mpz_t? Addition: - Check signs and allocate. - Possibly compare absolute values. - Call mpn_(add|sub)_n and possibly mpn_(add|sub)_1 if the integers have different sizes. - Overhead for sma

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Jurica Bradarić
Changes by Jurica Bradarić : -- nosy: +jbradaric ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Stefan Krah
Stefan Krah added the comment: Did you compile with "-fp-model strict"? IIRC icc is not IEEE-754 compliant by default. -- nosy: +skrah ___ Python tracker ___

[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-07 Thread Stefan Krah
Stefan Krah added the comment: FreeBSD 9 is failing as well: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/6583/steps/test/logs/stdio -- nosy: +skrah ___ Python tracker ___

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue21167] float('nan') returns 0.0 on Python compiled with icc

2014-04-07 Thread Hrvoje Nikšić
New submission from Hrvoje Nikšić: On a Python compiled with Intel C compiler, float('nan') returns 0.0. This behavior can be reproduced with icc versions 11 and 12. The definition of Py_NAN in include/pymath.h expects `HUGE_VAL * 0.0` to compile to a NaN value on IEEE754 platforms: /* Py_NAN

[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: > A fix of _PyUnicode_TranslateCharmap(). Sorry, I don't see which commit is a bugfix and is not backported to Python 3.4 yet. -- ___ Python tracker _

[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > > Do you plan to backport bug fixes to 3.3 and 2.7? > Which commit? A fix of _PyUnicode_TranslateCharmap(). > 3.3 is no more open to bug fixes, only to security fixes. Oh, I meant 3.4. -- ___ Python tracker

[issue21015] support SSL_CTX_set_ecdh_auto on newer OpenSSLs

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: test_default_ecdh_curve() is still failing on "x86 Ubuntu Shared 3.x": http://buildbot.python.org/all/builders/x86%20Ubuntu%20Shared%203.x/builds/9964/steps/test/logs/stdio == ERROR: test_defau

[issue21166] Bus error on "AMD64 FreeBSD 9.x 3.4" buildbot

2014-04-07 Thread STINNER Victor
New submission from STINNER Victor: http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.4/builds/44/steps/compile/logs/stdio ./python -E -S -m sysconfig --generate-posix-vars Bus error (core dumped) http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.x%203.4 -- me

[issue21111] PyLong_AsUnsignedLongAndOverflow does not exist

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: > > P.P.S.: Just a random idea: would it be a to rewrite PyLong to use GMP > > instead as a PyVarObject of mp_limb_t's? > I'll let Victor answer that one. :-) In the mean time, see issue 1814. During the development of Python 3.0, I wrote a large patch to reus

[issue21165] Optimize str.translate() for replacement with substrings and non-ASCII strings

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: codecs.charmap_build() (PyUnicode_BuildEncodingMap()) creates a C array ("a three-level trie") for fast lookup. It is used with codecs.charmap_encode() for 8-bit encodings. We may reuse it. -- ___ Python tracker

[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: I opened the issue #21165 to discuss a more generic optimization of str.translate(). -- ___ Python tracker ___

[issue21155] asyncio: calling _UnixSelectorEventLoop.create_unix_server(sock=..., path=...) must fail

2014-04-07 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue21155] asyncio: calling _UnixSelectorEventLoop.create_unix_server(sock=..., path=...) must fail

2014-04-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset a6b764848b20 by Victor Stinner in branch '3.4': Issue #21155: asyncio.EventLoop.create_unix_server() now raises a ValueError if http://hg.python.org/cpython/rev/a6b764848b20 New changeset 34ace7eb67e9 by Victor Stinner in branch 'default': (Merge 3.

[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: > Do you plan to backport bug fixes to 3.3 and 2.7? Which commit? 3.3 is no more open to bug fixes, only to security fixes. > New changeset 95d4e8124c6a by Victor Stinner in branch 'default': > Issue #21118: Fix _PyUnicodeTranslateError_Create(), add missing f

[issue21165] Optimize str.translate() for replacement with substrings and non-ASCII strings

2014-04-07 Thread STINNER Victor
New submission from STINNER Victor: In issue #21118, I optimized str.translate() in Python 3.5 for ASCII 1:1 mapping and ASCII deletion. My optimization is not used if a character is replaced with a string (ex: "abc".translate({ord('a'): "xxx"})) and for non-ASCII strings. translate_script.py

[issue21118] str.translate is absurdly slow in majority of use cases (takes up to 60x longer than similar functions)

2014-04-07 Thread STINNER Victor
STINNER Victor added the comment: > Could you please provide bench_translate.py? Oh, I forgot to add it :-( -- Added file: http://bugs.python.org/file34744/bench_translate.py ___ Python tracker ___