[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-07-31 Thread INADA Naoki
New submission from INADA Naoki: like GH-2966, most types with Py_TPFLAGS_HAVE_GC should call PyObject_GC_UnTrack() at top of the tp_dealloc. For example, I found lru_cache doesn't call it and I can produce segmentation fault. I'll check other types too. -- components: Extension

[issue29304] dict: simplify lookup functions

2017-08-05 Thread INADA Naoki
INADA Naoki added the comment: On i386 docker image, pyperformance: ./python -m perf compare_to before.json after.json -G --min-speed=2 Slower (4): - regex_dna: 279 ms +- 1 ms -> 288 ms +- 3 ms: 1.03x slower (+3%) - deltablue: 17.9 ms +- 0.3 ms -> 18.3 ms +- 1.0 ms: 1.03x slow

[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki
New submission from INADA Naoki: Since dict preserves insertion order, doubly linked list in OrderedDict can be removed. There is small performance improvement for odict creation: $ curl https://api.github.com/orgs/python/repos > repos.json $ ./py-patched -m perf timeit --compare-to `pwd`

[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki
INADA Naoki added the comment: There are some failing tests remaining, and I want to discuss about some of them here. Traceback (most recent call last): File "/home/inada-n/work/python/nodebug/Lib/test/test_ordered_dict.py", line 261, in test_pop self.assertEqual(m.pop('a', def

[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +3232 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31265> ___

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-05-11 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-05-11 Thread INADA Naoki
INADA Naoki added the comment: New changeset 5e94dedcddf5e09164bf20f18a3c701eeb96c71e by INADA Naoki in branch '3.5': bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1547) https://github.com/python/cpython/commit/5e94dedcddf5e09164bf20f18a3c701eeb96c71e

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-05-11 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +1646 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30048> ___

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-05-11 Thread INADA Naoki
INADA Naoki added the comment: New changeset 991adca012f5e106c2d4040ce619c696ba6f9c46 by INADA Naoki in branch 'master': bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1097) https://github.com/python/cpython/commit/991adca012f5e106c2d4040ce619c696ba6f9c46

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-05-11 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +1645 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30048> ___

[issue30048] If a task is canceled at the right moment, the cancellation is ignored

2017-05-11 Thread INADA Naoki
INADA Naoki added the comment: New changeset 3dc7c52a9f4fb83be3e26e31e2c7cd9dc1cb41a2 by INADA Naoki in branch '3.6': bpo-30048: asyncio: fix Task.cancel() was ignored. (GH-1546) https://github.com/python/cpython/commit/3dc7c52a9f4fb83be3e26e31e2c7cd9dc1cb41a2

[issue29304] dict: simplify lookup functions

2017-06-23 Thread INADA Naoki
INADA Naoki added the comment: New changeset 073ae487b3ff9001c69d530c7555ddaa530dee16 by INADA Naoki in branch 'master': bpo-29304: simplify lookdict_index() function. (GH-2273) https://github.com/python/cpython/commit/073ae487b3ff9001c69d530c7555ddaa530dee16

[issue15216] Add encoding & errors parameters to TextIOWrapper.reconfigure()

2017-06-22 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2387 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15216> ___

[issue29304] dict: simplify lookup functions

2017-06-26 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2455 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29304> ___

[issue29304] dict: simplify lookup functions

2017-06-26 Thread INADA Naoki
INADA Naoki added the comment: Antonie: Thank you for you comment. Actually speaking, size of instructions are reduced on amd64@gcc. lookdict_unicode_nodummy and lookdict_split doesn't have any reason to have duplicated code anymore. I'll do dedupe for them first. lookdict

[issue29304] dict: simplify lookup functions

2017-06-26 Thread INADA Naoki
INADA Naoki added the comment: Tim Peters: Thanks for your suggestion. But I want to focus on very simple code cleanup without any change to proving algorithm nor memory access pattern in this issue. I'll reply about my thought about reducing collision on the ML

[issue29304] dict: simplify lookup functions

2017-06-23 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2402 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29304> ___

[issue29304] dict: simplify lookup functions

2017-06-27 Thread INADA Naoki
INADA Naoki added the comment: Finally, I removed `freeslot` and all lookdict*() functions are much simpler in GH-2407. Macro bench doesn't show any significant performance change. I'll try to write micro benchmarks. -- ___ Python tracker <

[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread INADA Naoki
INADA Naoki added the comment: You may misunderstood current lookup loop. In your collisions_count.py, `yield i` must be added right before `while True:` -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30686] make `make install` faster

2017-06-16 Thread INADA Naoki
New submission from INADA Naoki: Currently, `make install` doesn't use -jN option of compileall.py My idea is: * Use os.cpu_count() for -j0. * Use the option in Makefile -- components: Build messages: 296216 nosy: inada.naoki priority: normal severity: normal status: open title: make

[issue30565] PEP 538: silence locale coercion and compatibility warnings by default?

2017-06-17 Thread INADA Naoki
INADA Naoki added the comment: If this warnings are disabled by default, who enable it? How about just remove them? I'm OK to remove them all. Since it's not ideal, nothing go worse than Python 3.6. Additionally, if PEP 540 is accepted, we can use UTF-8 for stdio and filesystem encoding even

[issue30686] make `make install` faster

2017-06-17 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2315 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30686> ___

[issue30671] dict: simplify and improve lookup function

2017-06-15 Thread INADA Naoki
INADA Naoki added the comment: Firstly, do you understand the lookup without perturb? It's documented here: https://github.com/python/cpython/blob/258bfc462b1e58689b43f662a10e44ece3a10bef/Objects/dictobject.c#L161-L182 >>> n = 0; L = [] >>> for i in range(16): ... L.append(n

[issue30671] dict: simplify and improve lookup function

2017-06-16 Thread INADA Naoki
INADA Naoki added the comment: It seems not "simplify". Please try implement it and show benchmark result if you think it's really worth enough. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.py

[issue29304] dict: simplify lookup function

2017-06-18 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +2323 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29304> ___

[issue29304] dict: simplify lookup functions

2017-06-18 Thread INADA Naoki
INADA Naoki added the comment: pr-2237 only changes lookdict_index() function. The function is used from only dict_popitem(). So it's not performance critical part. And microbench doesn't show significant performance changes: $ ./python.default -m perf timeit -q -l 2000 -s 'd=dict.fromkeys

[issue19325] _osx_support imports many modules

2017-06-28 Thread INADA Naoki
INADA Naoki added the comment: FYI, issue29585 removes _osx_support dependency from site.py -- nosy: +inada.naoki ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue31484] Cache single-character strings outside of the Latin1 range

2017-09-16 Thread INADA Naoki
INADA Naoki added the comment: Interesting optimization. But I don't know how common `for c in s` or `s[i]` is used for Japanese text. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue31475] Bug in argparse - not supporting utf8

2017-09-17 Thread INADA Naoki
INADA Naoki added the comment: You reported stack trace on Github pull request. But discussion should be made here, not in pull request. As far as reading traceback, your problem is solved already in Python 3.6, by PEP 528. -- nosy: +inada.naoki

[issue31415] Add -X option to show import time

2017-09-19 Thread INADA Naoki
INADA Naoki added the comment: It means μs (micro seconds), in ASCII. On 2017年9月20日(水) 3:35 Brett Cannon <rep...@bugs.python.org> wrote: > > Brett Cannon added the comment: > > What does the "[us]" mean? > > -- > nosy: +brett.cannon > > _

[issue31671] IntFlag makes re.compile slower

2017-10-05 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: Instead caching type(flags), how about this? if not isinstance(flags, int): raise TypeError(f"flags must be int or RegexFlag, got {flags!r}") flags = int(flags) -- __

[issue31671] IntFlag makes re.compile slower

2017-10-05 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset c1c47c166b1012d34f2c6e111ee9ccb5c4d12de7 by INADA Naoki in branch 'master': bpo-31671: re: Convert RegexFlag to int before compile (GH-3862) https://github.com/python/cpython/commit/c1c47c166b1012d34f2c6e111ee9ccb5c4

[issue31671] IntFlag makes re.compile slower

2017-10-05 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue31672] string.Template should use re.ASCII flag

2017-10-04 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: Current pull request override `Template.flags = re.I` after class creation for backward compatibility, without any API change. But I'm not sure it's right approach. How many people who subclass string.Template expect non-ASCII

[issue31672] string.Template should use re.ASCII flag

2017-10-04 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: > When optimizing, please don't make API changes. This is not only optimization, but bugfix. Document of string.Template says: > By default, "identifier" is restricted to any case-insensitive ASCII > alpha

[issue31672] string.Template should use re.ASCII flag

2017-10-04 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: > Yet one way -- make re.ASCII a local flag. Than we could just change the > idpattern attribute to r'(?a:[_a-z][_a-z0-9]*)', without touching the flags > attribute. https://docs.python.org/3.6/library/re.html#regular-ex

[issue31671] IntFlag makes re.compile slower

2017-10-04 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: Thank you for benchmarking. I've added news entry about it. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31690] Make RE "a", "L" and "u" inline flags local

2017-10-04 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3858 stage: needs patch -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31671] IntFlag makes re.compile slower

2017-10-03 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: > When proposing to undo recent decisions, please add the people to the nosy > list who were involved in making that decision in the first place. I don't propose reverting IntFlag. I just propose convert IntFlag to int

[issue31672] string.Template should use re.ASCII flag

2017-10-13 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +3966 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31672> ___

[issue31672] string.Template should use re.ASCII flag

2017-10-13 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset 7060380d577690a40ebc201c0725076349e977cd by INADA Naoki in branch '3.6': bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872) https://github.com/python/cpython/

[issue31672] string.Template should use re.ASCII flag

2017-10-14 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset 073150db39408c1800e4b9e895ad0b0e195f1056 by INADA Naoki in branch 'master': bpo-31672: doc: Remove one sentence from library/string.rst (GH-3990) https://github.com/python/cpython/

[issue31672] string.Template should use re.ASCII flag

2017-10-13 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset b22273ec5d1992b0cbe078b887427ae9977dfb78 by INADA Naoki in branch 'master': bpo-31672: Fix string.Template accidentally matched non-ASCII identifiers (GH-3872) https://github.com/python/cpython/

[issue31672] string.Template should use re.ASCII flag

2017-10-13 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- pull_requests: +3958 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31672> ___

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki
INADA Naoki added the comment: > Original Raymond's design didn't preserve ordering during deletion. Original Raymond's pure Python implementation rebuilds index table. Without it, proving can be very long or infinite loop. See L89-92 in http://code.activestate.com/recipes/578375/ Stric

[issue31415] Add -X option to show import time

2017-09-10 Thread INADA Naoki
New submission from INADA Naoki: I used my local patch to profile import time. I think it's useful for 3rd party authors. For example: ./python -Ximportprofile -c 'import traceback' - _codecs 71 [us] - codecs 677 [us] - encodings.aliases 412 [us] - encodings 1688 [us] - encodings.utf_8

[issue31415] Add -X option to show import time

2017-09-10 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3483 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-04 Thread INADA Naoki
INADA Naoki added the comment: FYI, my approach is not original, but copied from PyPy. https://bitbucket.org/pypy/pypy/src/3e52029e9a5a677f7de62ef49f36090465cfbf4c/rpython/rtyper/lltypesystem/rordereddict.py?at=default=file-view-default#rordereddict.py-1437:1551

[issue31333] Implement ABCMeta in C

2017-09-04 Thread INADA Naoki
INADA Naoki added the comment: > Hm, indeed, but I see that module 'abc' is in 'sys.modules', probably it is > then only used by 'collections.abc'/'_collections_abc'. This means that the > influence of 'ABCMeta' on interpreter start-up time will be smaller than I > thought. But st

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-05 Thread INADA Naoki
INADA Naoki added the comment: There is special internal API in dictobject.c _PyDict_LoadGlobal(PyDictObject *globals, PyDictObject *builtins, PyObject *key) Maybe, we can have special API like that _PyDict_LookupMro(PyObject *mro, PyObject *key); BTW, method cache in _PyType_Lookup

[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-06 Thread INADA Naoki
INADA Naoki added the comment: Confirmed: $ ./python-patched -m perf timeit --compare-to `pwd`/python -- 'class C: pass' python: . 11.9 us +- 0.1 us python-patched: . 10.3 us +- 0.1 us Mean +- std dev: [python] 11.9 us +- 0.1 us -> [python-patched] 1

[issue31333] Implement ABCMeta in C

2017-09-05 Thread INADA Naoki
INADA Naoki added the comment: "python_startup_nosite" benchmark imports io module, and "python_startup" benchmark imports os too. So no need to additional test for them. You can see it with `python -v -S -c 'pass'` and

[issue31377] remove *_INTERNED opcodes from marshal

2017-09-07 Thread INADA Naoki
INADA Naoki added the comment: > We end up interning each reference individually currently. But interning interned string is much faster. It only checks flag. Interning normal string requires dict lookup. -- ___ Python tracker &

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-12 Thread INADA Naoki
INADA Naoki added the comment: > Eric Snow added the comment: > > On Sun, Sep 10, 2017 at 10:27 PM, Serhiy Storchaka > <rep...@bugs.python.org> wrote: >> Note that mixed insertion and deletion is worst-case O(n) in current >> implementation. > > Could you e

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-12 Thread INADA Naoki
INADA Naoki added the comment: > I would side with Inada in thinking they both give the same amortized > complexity, but beyond that, benchmarks are the real answer. There is little > value in keeping the current implementation of OrderedDict *if* benchmarks > show that it is r

[issue31408] Leak in typeobject.c

2017-09-10 Thread INADA Naoki
INADA Naoki added the comment: Maybe, PyDict_ClearFreeList() is not called? -- nosy: +inada.naoki ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki
INADA Naoki added the comment: > I'm unclear about whether you understand and acknowledge why the > doubly-linked list was chosen and what kind of workloads it supports (we > didn't choose it because it was either convenient or fun, we chose it because > it was an algorithmically

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki
INADA Naoki added the comment: The discussion on [1] was for removing pure Python implementation, not about changing C implementation. [1]: https://mail.python.org/pipermail/python-dev/2017-September/149147.html While I withdrawed my suggestion about removing pure Python implementation, I

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki
INADA Naoki added the comment: > Just for the record, here is the draft of the post I was going to make on > python-dev but didn't prove to be necessary. Thank you for write down your thought. For move_to_end(), I admit new behavior is *amortized* O(1) and current behavior is *worst-cas

[issue31340] Use VS 2017 compiler for build

2017-09-06 Thread INADA Naoki
INADA Naoki added the comment: Nice! VS2017 is much lighter than VS2015 for install size! https://blogs.msdn.microsoft.com/vcblog/2016/08/22/the-lightweight-visual-studio-15-installer/ -- nosy: +inada.naoki ___ Python tracker <rep...@bugs.python.

[issue31377] remove *_INTERNED opcodes from marshal

2017-09-07 Thread INADA Naoki
INADA Naoki added the comment: w_ref() depends on refcnt already. I don't think removing *_INTERN opcode makes PYC reproducible. https://github.com/python/cpython/blob/1f06a680de465be0c24a78ea3b610053955daa99/Python/marshal.c#L269-L271 I think "intern one string, then share it 10

[issue31415] Add -X option to show import time

2017-09-25 Thread INADA Naoki
INADA Naoki added the comment: how can I make it more machine readable? On 2017年9月25日(月) 19:39 Christian Heimes <rep...@bugs.python.org> wrote: > > Christian Heimes added the comment: > > +1 for an option to profile import time. > > I have a minor complain: The outp

[issue31415] Add -X option to show import time

2017-09-24 Thread INADA Naoki
INADA Naoki added the comment: > Actually it is easy. You need just one global integer accumulator and a local > variable for keeping a temporary copy of it. You're right! I updated my pull request. See current output: https://gist.github.com/methane/185d75a3c8da762d85317dd959

[issue31415] Add -X option to show import time

2017-09-24 Thread INADA Naoki
INADA Naoki added the comment: I don't have any good idea for it. I usually run `python -X importtime -c 'import functools'` several times to ensure pyc files are created and it is cached by OS. On Linux, `strace -c` and `time` command can be used. But I don't know cross platform way to do

[issue31581] Reduce the number of imports for functools

2017-09-25 Thread INADA Naoki
New submission from INADA Naoki: Makes `import functools` about 1.5 ms faster. * heapq is used only when Counter.most_common(n). * types and waakref is used only for singledispatch. master: import time: - _functools 76 us (self 76 us) import time: - _operator 110 us (self 110 us

[issue31581] Reduce the number of imports for functools

2017-09-25 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3743 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue30152] Reduce the number of imports for argparse

2017-09-25 Thread INADA Naoki
INADA Naoki added the comment: Oh, the pull request is far larger than I thought! I doubt that avoiding functools and collections is worth enough, because it is very common. For example: * functools is very commonly imported, especially for wraps(). * collections is imported by functools

[issue31415] Add -X option to show import time

2017-09-24 Thread INADA Naoki
INADA Naoki added the comment: > If this proposition be accepted I would want to see not only cumulated times, > but also pure times, without time of nested imports. It can be calculated by script. I don't want to add more complexity to import.c. > I guess this feature doesn't work

[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-24 Thread INADA Naoki
INADA Naoki added the comment: Nice idea! I think it helps not only sharing more memory for forking application, but also long running large application. There are many static objects which is tracked by GC. It makes full GC time long. And CPU cache is filled by unused data. For example, web

[issue30806] netrc.__repr__() is broken for writing to file

2017-09-30 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset b24cd055ecb3eea9a15405a6ca72dafc739e6531 by INADA Naoki (James Sexton) in branch 'master': bpo-30806 netrc.__repr__() is broken for writing to file (GH-2491) https://github.com/python/cpython/

[issue31581] Reduce the number of imports for functools

2017-09-30 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset 9811e80fd0ed9d74c76a66f1dd4e4b8afa9e8f53 by INADA Naoki in branch 'master': bpo-31581: Reduce the number of imports for functools (GH-3757) https://github.com/python/cpython/commit/9811e80fd0ed9d74c76a66f1dd4e4b8afa

[issue31475] Bug in argparse - not supporting utf8

2017-09-30 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: We already accept PEP 529 and PEP 538. And there are #15216 (PR 2343). So I don't think we need more solutions. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31581] Reduce the number of imports for functools

2017-09-30 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki
New submission from INADA Naoki <songofaca...@gmail.com>: Current DER_cert_to_PEM_cert() uses textwrap like this: def DER_cert_to_PEM_cert(der_cert_bytes): """Takes a certificate in binary DER format and returns the PEM version of it as a string."

[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- components: +Library (Lib) versions: +Python 3.7 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: For the record, this is part of `import requests`. `import ssl` took 11 ms and `textwrap` weights 2.4 ms of it. - ipaddress 2048 us (self 2048 us) - textwrap 2402 us (self 2

[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-01 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3829 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-02 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset b75a228af8c0553aef44e4e03763af90fbc8737f by INADA Naoki in branch 'master': bpo-31659: Use simple slicing to format PEM cert (GH-3849) https://github.com/python/cpython/commit/b75a228af8c0553aef44e4e03763af90fb

[issue31659] ssl module should not use textwrap for wrapping PEM format.

2017-10-02 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: How often uuid1 is used? I never use it and it looks uuid1 makes uuid.py complicated. How about split it to _uuid1.py (or uuid/__init__.py and uuid/_uuid1.py)? I hope PEP 562 is accepted. It ease splitting out (heavy and slow and

[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: >> Sorry, I reject my idea. It clearly overdone. uuid.py is not so huge. > Can you please elaborate? Do you think that my PR is wrong? I looked https://github.com/python/cpython/pull/3684 and I wonder if I should rec

[issue11063] uuid.py module import has heavy side effects

2017-09-28 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: Sorry, I reject my idea. It clearly overdone. uuid.py is not so huge. -- versions: +Python 3.5 -Python 3.7 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31671] IntFlag makes re.compile slower

2017-10-03 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3842 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31415] Add -X option to show import time

2017-10-03 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: New changeset 1a87de7fcfa3c19f08e29047337c350b4a32b259 by INADA Naoki in branch 'master': bpo-31415: Add `-X importtime` option (GH-3490) https://github.com/python/cpython/commit/1a87de7fcfa3c19f08e29047337c350b4a

[issue31672] string.Template should use re.ASCII flag

2017-10-03 Thread INADA Naoki
New submission from INADA Naoki <songofaca...@gmail.com>: Currently, strings.Template uses re.IGNORECASE without re.ASCII: idpattern = r'[_a-z][_a-z0-9]*' flags = _re.IGNORECASE [a-z] matches against 'ı' (0x131, DOTLESS I) and 'ſ' (0x17f, LONG S). It is not intentional, and it

[issue31415] Add -X option to show import time

2017-10-03 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <https://bu

[issue31671] IntFlag makes re.compile slower

2017-10-03 Thread INADA Naoki
New submission from INADA Naoki <songofaca...@gmail.com>: flags exposed by re module are IntFlag from Python 3.4. Since it is passed to underlying sre_parse and sre_compile, tests in loop (e.g. `flags & SRE_FLAG_IGNORECASE`) calls IntFlag.__and__ and creates new instance everytime.

[issue31669] string.Template: cods, docs and PEP all disagree on definition of identifier

2017-10-03 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- superseder: -> string.Template should use re.ASCII flag ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31677] email.header uses re.IGNORECASE without re.ASCII

2017-10-03 Thread INADA Naoki
New submission from INADA Naoki <songofaca...@gmail.com>: email.header has this pattern: https://github.com/python/cpython/blob/85c0b8941f0c8ef3ed787c9d504712c6ad3eb5d3/Lib/email/header.py#L34-L43 # Match encoded-word strings in the form =?charset?q?Hello_World?=

[issue31677] email.header uses re.IGNORECASE without re.ASCII

2017-10-03 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3848 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31672] string.Template should use re.ASCII flag

2017-10-03 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- keywords: +patch pull_requests: +3851 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue31672] string.Template should use re.ASCII flag

2017-10-03 Thread INADA Naoki
INADA Naoki <songofaca...@gmail.com> added the comment: > This means if someone does subclass string.Template and changes the pattern > to accept Unicode identifiers, then with this change they will also have to > modify flags, whereas before they didn't. Thank you for poi

[issue31672] string.Template should use re.ASCII flag

2017-10-03 Thread INADA Naoki
Change by INADA Naoki <songofaca...@gmail.com>: -- stage: -> patch review type: -> behavior ___ Python tracker <rep...@bugs.python.org> <https://bugs.

[issue31558] gc.freeze() - an API to mark objects as uncollectable

2017-09-24 Thread INADA Naoki
INADA Naoki added the comment: AFAIK, Python shutdown process calls full GC. Don't touching permanent generation makes shutdown faster. On the other hand, there are some downside: * Some object may be not freed while shutdown. It looks like "leak" for application embedding Python i

[issue31475] Bug in argparse - not supporting utf8

2017-09-24 Thread INADA Naoki
INADA Naoki added the comment: ping? May I close this issue and pull request? -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki
INADA Naoki added the comment: Another idea is making "dict preserves insertion order" as language spec. There are still some difference between dict and odict: .move_to_end() and __eq__. But most use cases of odict is just keep insertion order. For example, parsing config file, js

[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-23 Thread INADA Naoki
INADA Naoki added the comment: When no change happens: $ ./py-patched -m perf timeit --compare-to `pwd`/py-default -s 'from collections import Ordedict; od = odict.fromkeys("abcdefghijklmnopqrstuvwxyz")' -- 'od.move_to_

[issue31265] Remove doubly-linked list from C OrderedDict

2017-08-24 Thread INADA Naoki
Changes by INADA Naoki <songofaca...@gmail.com>: -- nosy: +eric.snow ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31265> ___ _

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-22 Thread INADA Naoki
INADA Naoki added the comment: > Maybe it would help to have a short comment, maybe with a link to this issue, > on each PyObject_GC_UnTrack(). Is this looks good to you? /* UnTrack is needed before calling any callbacks (bpo-31095) */ PyObject_GC_UnTrac

[issue31095] Checking all tp_dealloc with Py_TPFLAGS_HAVE_GC

2017-08-22 Thread INADA Naoki
INADA Naoki added the comment: BTW, should this backported to Python 3.5? -- nosy: +larry ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

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