[issue29336] merge tuples in module

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: I vote +0 on merge-constants.patch: LGTM, may be useful, but not impressed :-) Hopefully, .py => .pyc compilation "should" occur only once. Except of the main script, but more and more applications use a tiny entry point of 3 lines. I don't expect any

[issue29336] merge tuples in module

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > merge-constants.patch looks simple enought, but I'm not really impressed by > such result. Is 2% worth it? I'm not impressed too. And merging constants can take time. > Since code objects loaded by import are likely for stay for the whole > lifetime of a

[issue29336] merge tuples in module

2017-01-24 Thread INADA Naoki
INADA Naoki added the comment: > More generally, would it be possible to share co_consts (None,) tuples > between code objects of two different modules? Or is it already the case with > merge-constants.patch? No. I didn't do it because I don't know it's worth enough. > merge-constants.patch

[issue29121] sqlite3 Controlling Transactions documentation not updated

2017-01-24 Thread Ma Lin
Changes by Ma Lin : -- nosy: +Ma Lin ___ Python tracker ___ ___ Python-bugs-list mailing

[issue29365] parallel make test or make install can fail building pgen when configure --enable-optimizations is used

2017-01-24 Thread Gregory P. Smith
Gregory P. Smith added the comment: great, the issue you filed covers my second paragraph comment which really should be its own issue. :) -- ___ Python tracker

[issue29243] --enable-optimizations makes common build commands always need to compile from scratch

2017-01-24 Thread Gregory P. Smith
Changes by Gregory P. Smith : -- nosy: +gregory.p.smith ___ Python tracker ___ ___

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2017-01-24 Thread paul j3
paul j3 added the comment: An alternative fix is to disallow tuple metavars for positionals. A tuple metavar may look nice in the usage. But a well selected dest seems better in the help line, and error messages. Using dest in all 3 roles, as we do now, is the simplest compromise.

[issue29243] --enable-optimizations makes common build commands always need to compile from scratch

2017-01-24 Thread INADA Naoki
INADA Naoki added the comment: That's why I want to enable only --with-lto -- nosy: +inada.naoki ___ Python tracker ___

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-24 Thread Jelle Zijlstra
Changes by Jelle Zijlstra : -- assignee: Jelle Zijlstra -> ___ Python tracker ___

[issue29310] Document typing.NamedTuple default argument syntax

2017-01-24 Thread Jelle Zijlstra
Changes by Jelle Zijlstra : -- keywords: +patch Added file: http://bugs.python.org/file46410/issue29310.patch ___ Python tracker

[issue29366] os.listdir has inconsistent behavior when run on a non-directory

2017-01-24 Thread raylu
New submission from raylu: According to https://github.com/python/cpython/blob/4ed71dae9d23a412f9f73d3a0b1f4be37543e49e/Lib/test/test_unicode_file_functions.py#L106 listdir can sometimes return FileNotFoundError on Windows. Tangentially related: https://hg.python.org/cpython/rev/385c2ec78f16

[issue29365] parallel make test or make install can fail building pgen when configure --enable-optimizations is used

2017-01-24 Thread Xiang Zhang
Xiang Zhang added the comment: > Making the suggested "make, make test, make install" process effectively > useless or at least take 3x longer than it should. About this, I once opened #29243. -- nosy: +xiang.zhang ___ Python tracker

[issue29365] parallel make test or make install can fail building pgen when configure --enable-optimizations is used

2017-01-24 Thread Gregory P. Smith
New submission from Gregory P. Smith: If you do a make -j12 test or make install before having run a separate 'make all' the build _can_ fail trying to build pgen. (it seems to be parallel make related, it won't always fail) Even if you have run a separate 'make all', the make test and make

[issue14074] argparse allows nargs>1 for positional arguments but doesn't allow metavar to be a tuple

2017-01-24 Thread paul j3
Changes by paul j3 : -- priority: normal -> high ___ Python tracker ___ ___

[issue29311] Argument Clinic: convert dict methods

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you for your review Martin. -- ___ Python tracker ___ ___

[issue29311] Argument Clinic: convert dict methods

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset ffc0840762e4 by Serhiy Storchaka in branch 'default': Issues #29311, #29289: Fixed and improved docstrings for dict and OrderedDict https://hg.python.org/cpython/rev/ffc0840762e4 -- ___ Python tracker

[issue29289] Convert OrderedDict methods to Argument Clinic

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset ffc0840762e4 by Serhiy Storchaka in branch 'default': Issues #29311, #29289: Fixed and improved docstrings for dict and OrderedDict https://hg.python.org/cpython/rev/ffc0840762e4 -- ___ Python tracker

[issue17720] pickle.py's load_appends should call append() on objects other than lists

2017-01-24 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I don't recall where I picked up the referred spec. Looking at PEP 307 and pickle docs [1], it does look like that objects which provides the listitems field of the reduce tuple should support extend() too. It might best to try both in the

[issue28845] Clean up known issues for AIX

2017-01-24 Thread Eric N. Vander Weele
Eric N. Vander Weele added the comment: > I request that you review issue27435 - in particular msg284557 - as I feel > ctypes implementation for AIX is broken - at least as far as the supporting > routines are concerned. I believe this request is outside the scope of this particular issue. >

[issue29121] sqlite3 Controlling Transactions documentation not updated

2017-01-24 Thread Aviv Palivoda
Aviv Palivoda added the comment: I would just like to note that I think that the correct solution is to do an implicit commit before: 1. VACUUM 2. ATTACH 3. DETACH 4. BEGIN -- ___ Python tracker

[issue29358] Add tp_fastnew and tp_fastinit to PyTypeObject, 15-20% faster object instanciation

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: First benchmark result on the fast_init compared to the default branch. Warning: the patch is still a WIP, there are maybe performance issues (in this case, this benchmark should help to identify them). --- haypo@speed-python$ python3 -m perf compare_to

[issue28810] Document bytecode changes in 3.6

2017-01-24 Thread Brett Cannon
Brett Cannon added the comment: I'll review your patch sometime this week, Serhiy. -- ___ Python tracker ___

[issue28810] Document bytecode changes in 3.6

2017-01-24 Thread Brett Cannon
Changes by Brett Cannon : -- assignee: docs@python -> brett.cannon ___ Python tracker ___

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: Probably not because an enum class' __call__ comes from the type EnumMeta -- so having two different __call__ methods would mean two different metaclasses, and I'm pretty sure I don't want to go there. ;) There is a __doc__ defined for the __call__ method,

[issue29167] Race condition in enum.py:_decompose()

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 95e184bd2d89 by Ethan Furman in branch '3.6': closes issue29167: fix race condition in (Int)Flag https://hg.python.org/cpython/rev/95e184bd2d89 New changeset e6b98c270718 by Ethan Furman in branch 'default': issue29167: fix race condition in

[issue28810] Document bytecode changes in 3.6

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Several third-party bytecode manipulating projects still are not updated to 3.6. Correct documentation is needed for them. Could anyone please make a review of the patch (or maybe totally rewrite it)? -- ___

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I'm wondering is it worth to set different __call__ methods for enum types with and without members? -- ___ Python tracker

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: There are actually two signatures: EnumCls(value) --> return member with value `value` EnumCls(name, members, module, qualname, type, start) --> create new Enum An example of the first: class A(Enum): x = 1 A(1) --> an example of the second: class

[issue29083] Readd PyArg_VaParse to the stable API

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 5cdf383ef35c by Serhiy Storchaka in branch '3.5': Issue #29083: Fixed the declaration of some public API functions. https://hg.python.org/cpython/rev/5cdf383ef35c New changeset 8eae65136000 by Serhiy Storchaka in branch '3.6': Issue #29083: Fixed

[issue29337] BytesWarning at compile time

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: I'm surprised that removing the type from the key works. Since tests pass, it's ok for me :-) I'm happy that I spent time to write these tests, I'm now more confident when this code is modified. Serhiy asked me to write these tests if I recall correctly ;-)

[issue29358] Add tp_fastnew and tp_fastinit to PyTypeObject, 15-20% faster object instanciation

2017-01-24 Thread Josh Rosenberg
Josh Rosenberg added the comment: So just to be clear, the issue with non-string or non-unique keywords is purely about performance, right, not correctness/non-crashiness? Non-string keywords, while technically accepted by CPython, are at best barely legal by the language standard. The

[issue29352] provide the authorative source for s[i:j] negative slice indices (<-len(s)) behavior for standard sequences

2017-01-24 Thread Josh Rosenberg
Josh Rosenberg added the comment: I think the wording could be improved, but there is another option I wanted to put here. Right now, we're being overly detailed about the implementation, specifying the bounds substitutions performed. If we're just trying to describe logical behavior, we

[issue29337] BytesWarning at compile time

2017-01-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29337] BytesWarning at compile time

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2bd2ef1696cf by Serhiy Storchaka in branch '3.5': Issue #29337: Fixed possible BytesWarning when compare the code objects. https://hg.python.org/cpython/rev/2bd2ef1696cf New changeset f6c327f2daa6 by Serhiy Storchaka in branch '3.6': Issue #29337:

[issue29364] msilib Fetch raises MSIError rather than return None

2017-01-24 Thread Jason Matthew
New submission from Jason Matthew: Fairly new to MSIs here. Working towards extracting the same information which is available via Orca graphical interfaces. I believe I've hit a bug within _msi.View class, namely the inability to safely determine the number of records in my result.

[issue29358] Add tp_fastnew and tp_fastinit to PyTypeObject, 15-20% faster object instanciation

2017-01-24 Thread Yury Selivanov
Yury Selivanov added the comment: Great. Can you share the Richards benchmark results? It specifically stresses class instantiation, so we should be able to see the improvement. -- ___ Python tracker

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This line is came from the signature of the __call__ method. >>> import enum, inspect >>> class A(enum.Enum): ...x = 1 ... >>> inspect.signature(A) >>> inspect.signature(A.__call__) >>> inspect.signature(enum.EnumMeta.__call__) But calling A with

[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-24 Thread Eric Fahlgren
Changes by Eric Fahlgren : -- nosy: +eric.fahlgren ___ Python tracker ___ ___

[issue29282] Fused multiply-add: proposal to add math.fma()

2017-01-24 Thread Mark Dickinson
Mark Dickinson added the comment: The patch needs tests for the case where a*b overflows and c is infinite (either of the same sign as a*b or not). This combination should never return NaN, but a poor emulation of fma might do so. -- ___ Python

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
Ethan Furman added the comment: That that is very unhelpful help text. :( Better would be: Color(value) So how do we allow Python code to determine the help text? -- ___ Python tracker

[issue29363] allow Python code to determine class help text

2017-01-24 Thread Ethan Furman
New submission from Ethan Furman: >From issue29338, msg286139: -- It is easy to fix the [pydoc] test by adding missed lines. But I'm not sure that output the (correct) signature of enum classes makes the help better. Color(value, names=None, *, module=None,

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Eric N. Vander Weele
Eric N. Vander Weele added the comment: > Hmm, the patch seems to be incomplete, as it just removes all the AIX support > scripts and mentions, without adding anything new to accommodate for the > removal. The new changes to accommodate for the script removal are in

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 24.01.2017 16:47, Eric N. Vander Weele wrote: > > I have a (large) patch that completely eliminates the need for ld_so_aix and > makeexp_aix. I've applied and been using this with for Python 2.7 and 3.5+, > but I still need to go back and validate the

[issue29328] struct module should support variable-length strings

2017-01-24 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- nosy: +twouters ___ Python tracker ___ ___

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Eric N. Vander Weele
Eric N. Vander Weele added the comment: I have a (large) patch that completely eliminates the need for ld_so_aix and makeexp_aix. I've applied and been using this with for Python 2.7 and 3.5+, but I still need to go back and validate the tests to ensure everything passes as expected. It's

[issue29362] regrtest: don't fail immediately if a child does crash

2017-01-24 Thread STINNER Victor
New submission from STINNER Victor: When regrtest is used with -jN, regrtest spawn child processes to run tests. If a child crashs, regrtest master process immedialtely fails. It would prefer to be able to continue to run following tests. It's not because a single test crashed that all tests

[issue29362] regrtest: don't fail immediately if a child does crash

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: At least, I would like to see which tests were executed, which tests failed, total duration, etc. Get a summary! -- ___ Python tracker

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Michael Felt
Michael Felt added the comment: OK - so details on the failing tests - for the record only. However, I would appreciate some 'expert' feedback on what is expected to be happening in this test: == FAIL:

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Michael Felt
Michael Felt added the comment: I am back at this: (note: short answer to msg277745 - No. does not work for me) As ... expressed before, this needs to work in three contexts: 2) In-tree testing of build module feature (test_distutils). Below are results of 'in tree' and 'out of tree' testing.

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
Changes by STINNER Victor : -- resolution: -> fixed status: open -> closed ___ Python tracker ___

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 24.01.2017 15:23, Michael Felt wrote: > As far as issue10656 and this issue are concerned: > > Python-3.4 is out of context (but 3.4.6 was just released) - and does not > work with 'out of tree' builds. > > The other versions: 2.7.13, 3.5.3 and 3.6.0

[issue19500] Add client-side SSL session resumption

2017-01-24 Thread Rob Reilink
Rob Reilink added the comment: With this code in place, ftplib should / could also be updated to support session resumption. This would fix bugs with connections to FTP servers that require session resumption [1], [2] In ftplib.FTP_TLS.ntransfercmd, just add a reference to the current session

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Michael Felt
Michael Felt added the comment: As far as issue10656 and this issue are concerned: Python-3.4 is out of context (but 3.4.6 was just released) - and does not work with 'out of tree' builds. The other versions: 2.7.13, 3.5.3 and 3.6.0 do build out-of-tree. Note 3.5.3 and 3.6.0 use a different

[issue29308] venv should match virtualenv VIRTUAL_ENV_DISABLE_PROMPT config

2017-01-24 Thread Jack Bennett
Jack Bennett added the comment: That works fine here. Thank you On 24 January 2017 at 13:15, Vinay Sajip wrote: > > Vinay Sajip added the comment: > > Other scripts (activate, activate.csh, activate.csh) support this > environment variable already. This patch updates

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Thanks Serhiy and Naoki. I really wanted more eyes on this weird issue :-) It's also a reminder that we should be careful when converting keyword arguments, especially when duplicates are not allowed. -- ___ Python

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2d2210b36b25 by Victor Stinner in branch 'default': Issue #29360: _PyStack_AsDict() doesn't check kwnames https://hg.python.org/cpython/rev/2d2210b36b25 -- nosy: +python-dev ___ Python tracker

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: pystack_asdict-2.patch LGTM. -- assignee: -> haypo stage: -> commit review ___ Python tracker ___

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Michael Felt
Michael Felt added the comment: re: msg286115, 1) Building modules in the tree during the build process. ** if "in the tree" means building outside of source - such as: ../src/python-X.Y.Z/configure ... make ** the tarball for Python-2.7.13 is building from ../src/Python-2.7.13/configure

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: > I don't know. To that that is crashed when pass non-string keys. Oh ok. I found a way to create a dictionary with equal keys and pass it to dict(**kw) in my fast_init branch (I already removed the PyUnicode_Check() asssertion in this branch): haypo@selma$

[issue29308] venv should match virtualenv VIRTUAL_ENV_DISABLE_PROMPT config

2017-01-24 Thread Vinay Sajip
Vinay Sajip added the comment: Other scripts (activate, activate.csh, activate.csh) support this environment variable already. This patch updates Activate.ps1 to respect the variable - can you confirm if this change works for you? -- assignee: -> vinay.sajip keywords: +patch stage:

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Martin Panter
Martin Panter added the comment: Sorry I meant Issue 10656. I recently committed a fix regarding out-of-tree builds and ld_so_aix, and it sounds like you were thinking of reverting that. -- ___ Python tracker

[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-24 Thread Jim Fasarakis-Hilliard
Changes by Jim Fasarakis-Hilliard : Added file: http://bugs.python.org/file46406/patchlevel_with.patch ___ Python tracker ___

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I don't know. To that that is crashed when pass non-string keys. -- ___ Python tracker ___

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Martin Panter
Martin Panter added the comment: I don’t run AIX, but my understanding is there are three distinct branches (2.7, 3.5, and 3.6+). Some of the following is guessed, so please correct me if I am wrong: Python 2.7: _sysconfigdata.py incorrectly created with LDSHARED = Modules/ld_so_aix. Result:

[issue29349] Update old Python 2 code in Docs/tools/extensions/patchlevel.py

2017-01-24 Thread Jim Fasarakis-Hilliard
Jim Fasarakis-Hilliard added the comment: I'm breaking these to separate files to make it easier to apply. I also noticed that other files in `Doc/tools/extensions/` use old constructs so I'm not sure about the *with*. I'm guessing that either it should be changed in other files too or, since

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "Try following keys: (...)" To which function am I supposed to pass such keys? I was unable to find a simple way how to pass arbitrary keys to _PyStack_AsDict(). -- ___ Python tracker

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Try following keys: class Key: def __eq__(self, other): return self is other or random.getrandbits(1) def __hash__(self): return random.getrandbits(1) -- ___ Python tracker

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Attached pystack_asdict-2.patch removes the two assertions and rewrites _PyStack_AsDict() documentation to describe better how it handles non-string and duplicated keys (don't check keys type and merge duplicated keys). > We should either ensure that

[issue29360] _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique

2017-01-24 Thread STINNER Victor
Changes by STINNER Victor : -- title: Don't check if all keys are strings in _PyStack_AsDict() -> _PyStack_AsDict(): Don't check if all keys are strings nor if keys are unique ___ Python tracker

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: -pitrou ___ Python tracker ___ ___ Python-bugs-list

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: BTW: Does the ticket still apply to 3.5+ ? From reading the ticket, it seems that the problem is already fixed for those versions. -- ___ Python tracker

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Hmm, looking at the patch again: diff -r a089a8b1f93d Lib/sysconfig.py --- a/Lib/sysconfig.py Fri Jun 21 18:37:02 2013 -0400 +++ b/Lib/sysconfig.py Fri Jun 21 22:33:15 2013 -0700 @@ -368,7 +368,7 @@ # -- these paths are relative to the Python source,

[issue18235] _sysconfigdata.py wrong on AIX installations

2017-01-24 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Reading the ticket, it seems that there is some confusion about what LDSHARED and BLDSHARED are used for. BLDSHARED is used to override the LDSHARED value when building libpython and the shared modules (via setup.py). LDSHARED is what is meant to be used

[issue29361] bug in pyserial: serialposix.py

2017-01-24 Thread Berker Peksag
Berker Peksag added the comment: Thanks for the report, but pyserial is not part of the Python stdlib. Please open your bug report on https://github.com/pyserial/pyserial. -- nosy: +berker.peksag resolution: -> third party stage: -> resolved status: open -> closed type: crash ->

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > func(**{'x': 1, 'x': 2}) In this example the dictionary contains only one item. You need more complex example for making the assertion failing. Keys with non-constant hashes or equality, so first they are different, and later they become equal.

[issue29336] merge tuples in module

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: I don't know what is the most efficient technic to reduce the memory usage of module, but at least I can say imports are the top #1 memory consumer. Look at tracemalloc examples: https://docs.python.org/dev/library/tracemalloc.html#display-the-top-10 "We can

[issue29361] bug in pyserial: serialposix.py

2017-01-24 Thread Reto Cavelti
New submission from Reto Cavelti: bug in pyserial: serialposix.py line 50: # set custom divisor buf[6] = buf[7] / baudrate TypeError: integer argument expected, got float fix: do cast: buf[6] = int(buf[7] / baudrate) -- components: Library (Lib) messages: 286168 nosy:

[issue29336] merge tuples in module

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: > Thanks. Your patch reduced memory consumption by 2%, merge-constants.patch looks simple enought, but I'm not really impressed by such result. Is 2% worth it? Since code objects loaded by import are likely for stay for the whole lifetime of a process, I

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: We should either ensure that _PyStack_AsDict() is called only by CALL_FUNCTION_KW, and not by other way, or remove both assertions. I prefer the second option. They were here only for self-testing. -- ___ Python

[issue29336] merge tuples in module

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: > But this can be done better with the AST optimizer (issue1346238, issue11549). There are also the PEP 511 (Code transformers) which was created to implement *external* AST optimizers, and the FAT Python which implements an AST optimizer. Hum, after "-o

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Victor> PyPy (and other Python implementations?) don't support non-string in type dictionary. INADA Naoki> Wow! I thought it's Python's language. If we can prohibit non string name in all namespace, there might be possible optimization. That's a different

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "The assertion was valid while all keywords did came from a constant keywords tuple in CALL_FUNCTION_KW. But if the FASTCALL protocol is extended for var-keyword arguments, keywords can be arbitrary and the assertion can fail. The assertion

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "The assertion was valid while all keywords did came from a constant keywords tuple in CALL_FUNCTION_KW. But if the FASTCALL protocol is extended for var-keyword arguments, keywords can be arbitrary and the assertion can fail. The assertion

[issue29358] Add tp_fastnew and tp_fastinit to PyTypeObject, 15-20% faster object instanciation

2017-01-24 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "Calling _PyStack_AsDict() with non-string or non-unique keywords means that the var-keyword argument was first unpacked to arrays of keyword names and values and then converted back to a dict. Seems something is done non-efficiently."

[issue29336] merge tuples in module

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: merge-constants.patch is rather a proof of concept. I think it may be more efficient after removing unneeded folded constants (issue28813). But this can be done better with the AST optimizer (issue1346238, issue11549). It would be worth also to merge nested

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The assertion was valid while all keywords did came from a constant keywords tuple in CALL_FUNCTION_KW. But if the FASTCALL protocol is extended for var-keyword arguments, keywords can be arbitrary and the assertion can fail. The assertion on the next line

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread INADA Naoki
INADA Naoki added the comment: patch LGTM. Python 2 supported `dict(**{1:3})`. But I don't know there are any functions supporting non-string keyword argument. > PyPy (and other Python implementations?) don't support non-string in type > dictionary. Wow! I thought it's Python's language. If

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread STINNER Victor
New submission from STINNER Victor: While running the test suite on issues #29259 (tp_fastcall) and #29358 (tp_fastnew and tp_fastinit), a few test failed on the following assertion of _PyStack_AsDict(): assert(PyUnicode_CheckExact(key)); For example, test_dict calls dict(**{1: 2}) which

[issue29360] Don't check if all keys are strings in _PyStack_AsDict()

2017-01-24 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +inada.naoki, serhiy.storchaka ___ Python tracker ___

[issue29359] Deprecate string concatenation without plus

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See also the topic "Implicit string literal concatenation considered harmful?" on Python-Ideas: https://mail.python.org/pipermail/python-ideas/2013-May/020527.html If you want to revive this issue, it is better to do this on the Python-Ideas mailing list.

[issue29359] Deprecate string concatenation without plus

2017-01-24 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: See PEP 3126. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue29336] merge tuples in module

2017-01-24 Thread INADA Naoki
INADA Naoki added the comment: merge-constants.patch LGTM -- ___ Python tracker ___ ___ Python-bugs-list

[issue29357] New NamedTuple syntax silently ignores method definitions

2017-01-24 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: This has been already reported in https://github.com/python/typing/issues/352 and fixed in https://hg.python.org/cpython/rev/f100619e7137 and https://github.com/python/typing/pull/364 Now adding new methods works but overwriting existing special attributes

[issue29359] Deprecate string concatenation without plus

2017-01-24 Thread Aivar Annamaa
Changes by Aivar Annamaa : -- components: +Interpreter Core ___ Python tracker ___

[issue29359] Deprecate string concatenation without plus

2017-01-24 Thread Aivar Annamaa
New submission from Aivar Annamaa: How quickly will you notice the bug here: for sequence in ["Command", "MagicCommand", "Open", "Save", "SaveAs", "NewFile", "EditorTextCreated"

[issue29358] Add tp_fastnew and tp_fastinit to PyTypeObject, 15-20% faster object instanciation

2017-01-24 Thread STINNER Victor
New submission from STINNER Victor: After #29259 "Add tp_fastcall to PyTypeObject: support FASTCALL calling convention for all callable objects", the two last slots which still use the (args: tuple, kwargs: dict) calling convention are tp_new and tp_init, two major slots to instanciate

[issue29337] BytesWarning at compile time

2017-01-24 Thread INADA Naoki
INADA Naoki added the comment: LGTM -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28556] typing.py upgrades

2017-01-24 Thread Ivan Levkivskyi
Ivan Levkivskyi added the comment: Thank you Martin! Fixed this upstream https://github.com/python/typing/pull/365 -- ___ Python tracker ___