[issue32349] Add detailed return value information for set.intersection function

2017-12-16 Thread 양유석
New submission from 양유석 : I think it's intentional behavior seems to be minor though. At a glance, I assume that a.set(b) should return items in a. But I found out the implementation always return items in smaller set. There is no issue for common case, but custom class can make a trouble. So,

[issue32264] move pygetopt.h into internal/

2017-12-16 Thread David Bolen
David Bolen added the comment: After some further testing, it does not appear to be configure related but something environmental (maybe MACOSX_DEPLOYMENT_TARGET) - using the same configure options manually as build-installer seems ok. For what it's worth, since there do appear to be duplicat

[issue32264] move pygetopt.h into internal/

2017-12-16 Thread David Bolen
David Bolen added the comment: This commit appears to have broken OSX installer builds using the build-installer.py script (as in the last two attempts on the bolen-dmg-3.x builder), confirmed with a bisection from the first failing worker build (covering the range 02a0a19..3327a2d) It fails

[issue32348] Optimize asyncio.Future schedule/add/remove callback

2017-12-16 Thread Yury Selivanov
Change by Yury Selivanov : -- keywords: +patch pull_requests: +4801 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue32348] Optimize asyncio.Future schedule/add/remove callback

2017-12-16 Thread Yury Selivanov
New submission from Yury Selivanov : Key observation: 99.9% of the time Futures and Tasks have only one callback. Currently we have a list of callbacks in each Future/Task. We can avoid list object allocation if we add a field to store the first callback. This way we'll only need to ever a

[issue32226] Implement PEP 560: Core support for typing module and generic types

2017-12-16 Thread Ivan Levkivskyi
Change by Ivan Levkivskyi : -- pull_requests: +4800 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue32250] Add asyncio.current_task() and asyncio.all_tasks() funcitons

2017-12-16 Thread Andrew Svetlov
Change by Andrew Svetlov : -- components: +Library (Lib) resolution: -> fixed stage: patch review -> resolved status: open -> closed type: -> enhancement ___ Python tracker __

[issue32250] Add asyncio.current_task() and asyncio.all_tasks() funcitons

2017-12-16 Thread Andrew Svetlov
Andrew Svetlov added the comment: New changeset 44d1a5912ea629aa20fdc377a5ab69d9ccf75d61 by Andrew Svetlov in branch 'master': bpo-32250: Implement asyncio.current_task() and asyncio.all_tasks() (#4799) https://github.com/python/cpython/commit/44d1a5912ea629aa20fdc377a5ab69d9ccf75d61 ---

[issue32347] System Integrity Protection breaks shutil.copystat()

2017-12-16 Thread Ryan Govostes
New submission from Ryan Govostes : On macOS, shutil.copystat() uses chflags() to try to copy filesystem flags from the source to destination. In recent years, Apple introduced System Integrity Protection, which prevents modification of system files. These files have the non-standard SF_RESTRI

[issue32324] [Security] "python3 directory" inserts "directory" at sys.path[0] even in isolated mode

2017-12-16 Thread Steve Dower
Steve Dower added the comment: The more interesting part is the relative directory and how often is it resolved? Can you change a program's imports by inducing it to change its working directory immediately after startup (or before any lazy imports)? If so, we should resolve it to a full path

[issue32339] Make the dict type used in csv.DictReader configurable

2017-12-16 Thread shangdahao
Change by shangdahao : -- keywords: +patch pull_requests: +4799 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-

[issue32346] Speed up slot lookup for class creation

2017-12-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- priority: normal -> low ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4903 makes the error message more specific for this case. >>> a, b = 1 Traceback (most recent call last): File "", line 1, in TypeError: cannot unpack int object I don't know whether it is worth to do this change. -- _

[issue32346] Speed up slot lookup for class creation

2017-12-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: Some micro-benchmarks: $ ./python -m timeit "class Test: pass" - before: 8.84 usec per loop - after: 7.03 usec per loop $ ./python -m timeit "class Test(tuple): pass" - before: 10.1 usec per loop - after: 8.4 usec per loop $ ./python -m timeit -s "from loggin

[issue32346] Speed up slot lookup for class creation

2017-12-16 Thread Antoine Pitrou
Change by Antoine Pitrou : -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4798 stage: needs patch -> patch review ___ Python tracker ___ ___ Python-bugs-list m

[issue32346] Speed up slot lookup for class creation

2017-12-16 Thread Antoine Pitrou
Antoine Pitrou added the comment: I posted https://github.com/python/cpython/pull/4902 for this. This approach has two drawbacks: - uses an additional tp_ slot (and a corresponding TPFLAGS) - adds a bit of code complexity (but quite localized) -- stage: patch review -> __

[issue32346] Speed up slot lookup for class creation

2017-12-16 Thread Antoine Pitrou
Change by Antoine Pitrou : -- keywords: +patch pull_requests: +4797 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-li

[issue32346] Speed up slot lookup for class creation

2017-12-16 Thread Antoine Pitrou
New submission from Antoine Pitrou : As mentioned in https://mail.python.org/pipermail/python-dev/2017-December/151298.html, slot lookup can take 75 to 80% of the runtime when creating a new class. This was slightly improved in https://bugs.python.org/issue31336 but we're still doing one loo

[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2017-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: PR 4901 implements Inada's idea about changing dk_lookup to an index. This decreases the size, but can have negative performance effect (I didn't make benchmarks). -- ___ Python tracker

[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2017-12-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- pull_requests: +4796 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue32259] Misleading "not iterable" Error Message when generator return a "simple" type, and a tuple is expected

2017-12-16 Thread Camion
Camion added the comment: Jerry, I've been troubleshooting thing for 30 years and I'm quite experienced at it, and in the end I was perfectly able to manage this problem and solve this problem by myself. My point is not about my own difficulty to solve this problem, but about the fact that

[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

2017-12-16 Thread Julien Palard
Julien Palard added the comment: I concur with Raymond and Serhiy here, and monkeypatching tmpfile should not be that hard, maybe patching `tempfile._Random` with `partial(random.Random, seed)` if done soon enough? -- ___ Python tracker

[issue19764] subprocess: use PROC_THREAD_ATTRIBUTE_HANDLE_LIST with STARTUPINFOEX on Windows Vista

2017-12-16 Thread Segev Finer
Segev Finer added the comment: The PR has been sitting there for quite a while now... -- ___ Python tracker ___ ___ Python-bugs-list

[issue32344] Explore whether peephole.c tuple of constants folding can be an AST transformation

2017-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Tuples represented in AST already are optimized at AST level. But there are tuples created at compilation stage (see the code emitting BUILD_TUPLE). Inada's PR 4879 simplifies the peephole optimizer. I tried to move this optimization at the compiler level,

[issue32345] EIO from write() is only fatal if print() contains a newline

2017-12-16 Thread Creideiki
New submission from Creideiki : This is Python 2.7.14 on Gentoo Linux. I ran into an issue where a program crashes if I run it from a terminal, put it in the background, and then close the terminal too soon. Upstream bug report: https://github.com/micahflee/torbrowser-launcher/issues/298 It s

[issue32321] functools.reduce has a redundant guard or needs a pure Python fallback

2017-12-16 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: -> ncoghlan nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue32344] Explore whether peephole.c tuple of constants folding can be an AST transformation

2017-12-16 Thread Raymond Hettinger
New submission from Raymond Hettinger : Can the peephole optimizer's fold_tuple_on_constants() be moved to ast_opt? It looks to me like there is sufficient information in the tree: import ast print(ast.dump(ast.parse('c = (50+1, 60+2)'))) --- Module(

[issue32002] test_c_locale_coercion fails when the default LC_CTYPE != "C"

2017-12-16 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset 9c19b020249c451891affd81751947321a1e6957 by Nick Coghlan in branch 'master': bpo-32002: Refactor C locale coercion tests (GH-4369) https://github.com/python/cpython/commit/9c19b020249c451891affd81751947321a1e6957 -- _

[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2017-12-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I also have misgivings about the extra field. Perhaps solicit some other opinions about whether the trade-off is worth it. Maybe Tim can provide an insight. My suspicion is that the current tight coupling is going to cost us in other ways. The OrderedDi

[issue32315] can't run any scripts with 2.7.x, 32 and 64-bit

2017-12-16 Thread Martin
Martin added the comment: I used Python on other machines, I know how it's supposed to work. I'm using Windows 7 and this problem happened with 2.7.14, 2.7.13 and 2.7.9. I didn't bother trying all other versions because it looked like it didn't matter what version it was. For every version, I

[issue29084] C API of OrderedDict

2017-12-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: With today's announcement of guaranteed ordering for regular dicts, OrderedDict just became much less important (almost insignificant). Also, the original reason for having this C API no longer applies. There is a reasonable case to be made for removing t

[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2017-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But this increases the size of regular dicts. Is it appropriate? -- ___ Python tracker ___ ___ P

[issue32276] there is no way to make tempfile reproducible (i.e. seed the used RNG)

2017-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I concur with Raymond. Monkey patching the tempfile module looks the right solution of this uncommon problem. -- nosy: +serhiy.storchaka resolution: -> fixed stage: -> resolved status: open -> closed ___ Python

[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2017-12-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: This looks reasonable to me. The previous design was too tightly coupled. The regular dict shouldn't have to care about the OrderedDict at all. -- ___ Python tracker __

[issue31954] Don't prevent dict optimization by coupling with OrderedDict

2017-12-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Could you please make a review Raymond? -- assignee: -> rhettinger ___ Python tracker ___ ___ P

[issue29084] C API of OrderedDict

2017-12-16 Thread Serhiy Storchaka
Change by Serhiy Storchaka : -- keywords: +patch pull_requests: +4795 stage: -> patch review ___ Python tracker ___ ___ Python-bugs-