[issue20438] inspect: Deprecate getfullargspec?

2016-12-01 Thread Nick Coghlan
Nick Coghlan added the comment: Noting for the record, as the general way of querying an unbound method for the name of the first parameter and adding it to the bound arguments: def add_instance_arg(callable, bound_args): try: self = callable.__self__ func =

[issue28733] Show how to use mock_open in modules other that __main__

2016-12-01 Thread Michał Bultrowicz
Michał Bultrowicz added the comment: One more update - I had the problem, because I was using monkeypatch.setattr() from Pytest, and assumed that it will work the same as patch(). This assumption turned out to be wrong. -- ___ Python tracker

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-12-01 Thread Emanuel Barry
Emanuel Barry added the comment: Let's just close this. -- nosy: +ebarry resolution: -> rejected stage: -> resolved status: open -> closed ___ Python tracker

[issue23507] Tuple creation is too slow

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is an example that shows increased stack consumption. With old code it counts to 74700, with the patch it counts only to 65400. Please revert your changes. -- Added file: http://bugs.python.org/file45725/stack_overflow.py

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: > I agree with Josh, PyTuple_New() can be faster than PyMem_Malloc() due to > tuple free list. According to benchmarks, PyTuple_New() is slower than PyMem_Malloc(). It's not surprising for me, using a tuple object requires extra work: * Track and then

[issue28851] namedtuples field_names sequence preferred

2016-12-01 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: docs@python -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The problem with C stack overflow is not new, but your patch may make it worse (I don't know if it actually make it worse). Py_EnterRecursiveCall() is used for limiting Python stack. It can't prevent C stack overflow. --

[issue23507] Tuple creation is too slow

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "I don't propose to commit this complicated patch, but these results can be used as a guide to the optimization of tuple creating. It is surprising to me that this patch has any effect at all." A new "fast call" calling convention was added to Python

[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-12-01 Thread Nick Coghlan
Nick Coghlan added the comment: The concern with using the "generate a private module that can be cached" approach is that it doesn't generalise well - any time you want to micro-optimise a new module that way, you have to add a custom Makefile rule. By contrast, Argument Clinic is a general

[issue10444] A mechanism is needed to override waiting for Python threads to finish

2016-12-01 Thread Michael Hughes
Michael Hughes added the comment: Given that this is from five years ago, and I've moved on, I honestly can't say I care too deeply about this. My use case was for handling threads: * created by inexperienced python programmers that don't know about daemons * using third party python scripts

Re: The Case Against Python 3

2016-12-01 Thread Paul Moore
On Tuesday, 29 November 2016 01:01:01 UTC, Chris Angelico wrote: > So what is it that's trying to read something and is calling an > f-string a mere string? gettext.c2py: """Gets a C expression as used in PO files for plural forms and returns a Python lambda function that implements an

[issue27172] Undeprecate inspect.getfullargspec()

2016-12-01 Thread Nick Coghlan
Nick Coghlan added the comment: Updated patch adding What's New and NEWS entries, and addressing Martin's review comments (mostly by accepting his suggestions). I ended up leaving `inspect.getcallargs()` deprecated, and instead added a comment to issue 20438 noting how to achieve the bound

[issue23507] Tuple creation is too slow

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think it would be better to optimize PyObject_CallFunctionObjArgs(). -- ___ Python tracker ___

[issue28638] Creating namedtuple is too slow to be used in common stdlib (e.g. functools)

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Argument Clinic is not needed, since we can use Makefile. -- Added file: http://bugs.python.org/file45724/functools-CacheInfo-Makefile.patch ___ Python tracker

[issue28835] Change in behavior when overriding warnings.showwarning and with catch_warnings(record=True)

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: It seems like a regression of Python 3.6, probably introduced by myself with add addition of warnings._showwarningmsg() and the source parameter. -- nosy: +haypo, ned.deily priority: normal -> release blocker ___

[issue28851] namedtuples field_names sequence preferred

2016-12-01 Thread Francesco Grondona
New submission from Francesco Grondona: A change by mhettinger in the doc of Python 2 years ago implicitely stated a sequence of strings as preferred way to provide 'field_names' to a namedtuple: https://github.com/python/cpython/commit/7be6326e09f2062315f995a18ab54baedfd0c0ff Same change

[issue23507] Tuple creation is too slow

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset b9c9691c72c5 by Victor Stinner in branch 'default': Replace PyObject_CallFunctionObjArgs() with fastcall https://hg.python.org/cpython/rev/b9c9691c72c5 -- nosy: +python-dev ___ Python tracker

[issue23507] Tuple creation is too slow

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: I rewrote bench_builtins.py to use my new perf module. Python 3.7 is between 1.27x and 1.42x faster than Python 3.6, but sorted(list) is slower. I don't know why sorted(list) is slower. It doesn't use a key function, and so should not be impacted by FASTCALL

[issue18971] calendar

2016-12-01 Thread Wolfgang Maier
Changes by Wolfgang Maier : -- title: Use argparse in the profile/cProfile modules -> calendar ___ Python tracker

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: @Chi Hsuan Yen And please, let us not waste any more time on lost battles, this suggestion of using sys.implementation has already been rejected at issue 27442 (see msg269748) as you must know since you were involved in the discussion there. --

[issue28852] sorted(range(1000)) is slower in Python 3.7 compared to Python 3.5

2016-12-01 Thread STINNER Victor
New submission from STINNER Victor: Follow-up of my comment http://bugs.python.org/issue23507#msg282187 : "sorted(list): Median +- std dev: [3.5] 17.5 us +- 1.0 us -> [3.7] 19.7 us +- 1.1 us: 1.12x slower (+12%)" "(...) sorted(list) is slower. I don't know why sorted(list) is slower. It

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: I pushed th echange b9c9691c72c5 to replace PyObject_CallFunctionObjArgs() with _PyObject_CallNoArg() or _PyObject_CallArg1(). These functions are simpler and don't allocate memory on the C stack. I made similar to PyObject_CallFunctionObjArgs() in Python 3.6

[issue28843] asyncio.Task implemented in C loses __traceback__ for exceptions

2016-12-01 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks for reviewing the patch, Inada-san. Closing the issue. -- priority: release blocker -> normal resolution: -> fixed stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker

[issue28852] sorted(range(1000)) is slower in Python 3.7 compared to Python 3.5

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: Benchmark: ./python -m perf timeit -s 'x=list(range(1000))' 'sorted(x)' Python 3.6 and 3.7 compared to Python 3.5: $ python3 -m perf compare_to 3.5.json.gz 3.6.json.gz 3.7.json.gz Median +- std dev: [3.5] 18.4 us +- 0.9 us -> [3.6] 20.5 us +- 0.9 us:

[issue28843] asyncio.Task implemented in C loses __traceback__ for exceptions

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset c9f68150cf90 by Yury Selivanov in branch '3.6': Issue #28843: Fix asyncio C Task to handle exceptions __traceback__. https://hg.python.org/cpython/rev/c9f68150cf90 New changeset a21a8943c59e by Yury Selivanov in branch 'default': Merge 3.6 (issue

[issue28853] locals() and free variables

2016-12-01 Thread Marco Buttu
New submission from Marco Buttu: The locals() documentation [1] says that "Free variables are returned by locals() when it is called in function blocks". A free variable inside a function has a global scope, and in fact it is not returned by locals():: >>> x = 33 >>> def foo(): ...

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Sorry for mixing different issues and proposing bad alternatives. My last hope is that someone looks into lemburg's msg281253: "I don't think the sys module is the right place to put the API, since it doesn't have anything to do with the Python system

[issue28852] sorted(range(1000)) is slower in Python 3.7 compared to Python 3.5

2016-12-01 Thread Eric N. Vander Weele
Changes by Eric N. Vander Weele : -- nosy: +ericvw ___ Python tracker ___ ___

Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
I started to use json.dumps to put things in a SQLite database. But I think it would be handy when it would be easy to change the values manually. When I have a value dummy which contains: ['An array', 'with several strings', 'as a demo'] Then json.dumps(dummy) would generate: '["An

Re: Can json.dumps create multiple lines

2016-12-01 Thread Zachary Ware
On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote: > I would prefer when it would generate: > '[ > "An array", > "with several strings", > "as a demo" > ]' > > Is this possible, or do I have to code this myself?

Re: Can json.dumps create multiple lines

2016-12-01 Thread John Gordon
In <87lgvz4no8@equus.decebal.nl> Cecil Westerhof writes: > I started to use json.dumps to put things in a SQLite database. But I > think it would be handy when it would be easy to change the values > manually. > When I have a value dummy which contains: > ['An array',

[issue18971] Use argparse in the profile/cProfile modules

2016-12-01 Thread Wolfgang Maier
Wolfgang Maier added the comment: oops, typing in wrong window. Very sorry. -- nosy: +wolma title: calendar -> Use argparse in the profile/cProfile modules ___ Python tracker

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: > How about renaming sys.implementation._multiarch to > sys.implementation.target_architecture and make it public? > sys.androidapilevel() sounds too specific to me. Please do not hijack this issue. The removal of sys.implementation._multiarch for Android is

[issue23507] Tuple creation is too slow

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka: "Victor, your changes introduced a regression." I suppose that you are refering to sorted(list) which seems to be slower. Do you have a specific change in mind? As I wrote, it doesn't use a key function, and so should not be impacted by my

[issue28851] namedtuples field_names sequence preferred

2016-12-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for the reminder. I'll make the doc updates after 3.6 is released (we're trying to not make any changes at all right now). -- resolution: -> later versions: -Python 3.3, Python 3.4, Python 3.5 ___

[issue23507] Tuple creation is too slow

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Victor, your changes introduced a regression. -- resolution: fixed -> status: closed -> open ___ Python tracker ___

[issue28850] Regression in Python 3: Subclassing PrettyPrinter.format doesn't work anymore

2016-12-01 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___

[issue28854] FIPS mode causes dead-lock in ssl module

2016-12-01 Thread Christian Heimes
New submission from Christian Heimes: Python's ssl module is dead-locking when OpenSSL is running in FIPS mode. I first noticed it with pip. The issue is also reproducible with Python's test suite. $ sudo touch /etc/system-fips $ OPENSSL_FORCE_FIPS_MODE=1 ./python -m test.regrtest -v

Re: Asyncio -- delayed calculation

2016-12-01 Thread Ian Kelly
On Thu, Dec 1, 2016 at 12:53 AM, Christian Gollwitzer wrote: > well that works - but I think it it is possible to explain it, without > actually understanding what it does behind the scences: > > x = foo() > # schedule foo for execution, i.e. put it on a TODO list This implies

[issue28840] IDLE: Document tk's long line display limitation

2016-12-01 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> test needed title: IDLE not handling long lines correctly -> IDLE: Document tk's long line display limitation versions: +Python 2.7, Python 3.6, Python 3.7 ___ Python tracker

[issue26363] __builtins__ propagation is misleading described in exec and eval documentation

2016-12-01 Thread Julien Palard
Julien Palard added the comment: So, is there still an inconsistency in the documentation? -- ___ Python tracker ___

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 17:55 CET, Zachary Ware wrote: > On Thu, Dec 1, 2016 at 10:30 AM, Cecil Westerhof wrote: >> I would prefer when it would generate: >> '[ >> "An array", >> "with several strings", >> "as a demo" >> ]' >> >> Is this possible, or do I have to code this

[issue28840] IDLE not handling long lines correctly

2016-12-01 Thread Terry J. Reedy
Terry J. Reedy added the comment: Currently, the code displayed is the code saved and run when requested. Your idea would require that IDLE keep a 'true' copy of the code separate from the 'display' copy in the Text widget, with the two being kept in sync except in special situations such as

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: > getandroidapilevel-3.patch: Updated version of getandroidapilevel.patch: > replace "runtime" with "build time" in the doc :-) Remove also "version > 0" > check in support/__init__.py. LGTM > About the version > 0 check: would it make sense to add the check

[issue28854] FIPS mode causes dead-lock in ssl module

2016-12-01 Thread Alex Gaynor
Changes by Alex Gaynor : -- nosy: +alex, dstufft, janssen ___ Python tracker ___ ___

[issue28854] FIPS mode causes dead-lock in ssl module

2016-12-01 Thread Christian Heimes
Christian Heimes added the comment: It's a dead lock in OpenSSL. :( if (n == CRYPTO_LOCK_RAND) { fprintf(stderr, "%s%s %i %s:%i\n", (mode & CRYPTO_READ) ? "R" : "W", (mode & CRYPTO_LOCK) ? "L" : "U", n, file, line); } test_random

[issue27779] Sync-up docstrings in C version of the the decimal module

2016-12-01 Thread Lisa Roach
Lisa Roach added the comment: This (should) be the patch with the python docstrings copied over to the C version. -- Added file: http://bugs.python.org/file45728/docstrings.patch ___ Python tracker

Re: Can json.dumps create multiple lines

2016-12-01 Thread Tim Chase
On 2016-12-01 17:30, Cecil Westerhof wrote: > When I have a value dummy which contains: > ['An array', 'with several strings', 'as a demo'] > Then json.dumps(dummy) would generate: > '["An array", "with several strings", "as a demo"]' > I would prefer when it would generate: > '[ >

Error In querying Genderize.io. Can someone please help

2016-12-01 Thread handar94
import requests import json names={'katty','Shean','Rajat'}; for name in names: request_string="http://api.genderize.io/?"+name r=requests.get(request_string) result=json.loads(r.content) Error--- Traceback (most recent call last): File

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: > Now I need to convert the database. But that should not be a big > problem. I did the conversion with: cursor.execute('SELECT tipID FROM tips') ids = cursor.fetchall() for id in ids: id = id[0]

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: > The version > 0 check was done because sysconfig.get_config_var() returns 0 > when a variable is found as '#undef' in pyconfig.h. Oh right, I see. In this case, we don't need to have a special case in sys.getandroidapilevel(). I pushed

[issue2771] Test issue

2016-12-01 Thread Ezio Melotti
Ezio Melotti added the comment: Testing that the link to PR 46 works. Pull Request 46 should also be a link. PullRequest 46 too. Generally you should just use PR46. -- ___ Python tracker

Re: Can json.dumps create multiple lines

2016-12-01 Thread Peter Otten
Cecil Westerhof wrote: > On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: > >> Now I need to convert the database. But that should not be a big >> problem. > > I did the conversion with: > cursor.execute('SELECT tipID FROM tips') > ids = cursor.fetchall() > for id in ids: >

Re: correct way to catch exception with Python 'with' statement

2016-12-01 Thread Ned Batchelder
On Thursday, December 1, 2016 at 2:31:11 PM UTC-5, DFS wrote: > After a simple test below, I submit that the above scenario would never > occur. Ever. The time gap between checking for the file's existence > and then trying to open it is far too short for another process to sneak > in and

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset be70d64bbf88 by Victor Stinner in branch 'default': Add sys.getandroidapilevel() https://hg.python.org/cpython/rev/be70d64bbf88 -- nosy: +python-dev ___ Python tracker

Re: Error In querying Genderize.io. Can someone please help

2016-12-01 Thread John Gordon
In handa...@gmail.com writes: > import requests > import json > names={'katty','Shean','Rajat'}; > for name in names: > request_string="http://api.genderize.io/?"+name > r=requests.get(request_string) >

[issue26363] __builtins__ propagation is misleading described in exec and eval documentation

2016-12-01 Thread Xavier Combelle
Xavier Combelle added the comment: not an inconsisties but in the eval documentaion nothing specify that the builtins propagate between levels updates -- ___ Python tracker

Re: Can json.dumps create multiple lines

2016-12-01 Thread Cecil Westerhof
On Thursday 1 Dec 2016 23:58 CET, Peter Otten wrote: > Cecil Westerhof wrote: > >> On Thursday 1 Dec 2016 22:52 CET, Cecil Westerhof wrote: >> >>> Now I need to convert the database. But that should not be a big >>> problem. >> >> I did the conversion with: >> cursor.execute('SELECT tipID FROM

Re: The Case Against Python 3

2016-12-01 Thread Ned Batchelder
On Thursday, December 1, 2016 at 9:03:46 AM UTC-5, Paul Moore wrote: > While I agree that f-strings are more dangerous than people will immediately > realise (the mere fact that we call them f-*strings* when they definitely > aren't strings is an example of that), the problem here is clearly

Re: OSError: [Errno 12] Cannot allocate memory

2016-12-01 Thread duncan smith
On 01/12/16 01:12, Chris Kaynor wrote: > On Wed, Nov 30, 2016 at 4:54 PM, duncan smith wrote: >> >> Thanks. So something like the following might do the job? >> >> def _execute(command): >> p = subprocess.Popen(command, shell=False, >>

[issue23224] LZMADecompressor object is only initialized in __init__

2016-12-01 Thread Aaron Hill
Aaron Hill added the comment: I've upload a patch which should address the issue in both the lzma and bz2 modules. -- keywords: +patch nosy: +Aaron1011 Added file: http://bugs.python.org/file45730/fix-lzma-bz2-segfaults.patch ___ Python tracker

Re: compile error when using override

2016-12-01 Thread Ho Yeung Lee
from __future__ import division import ast from sympy import * x, y, z, t = symbols('x y z t') k, m, n = symbols('k m n', integer=True) f, g, h = symbols('f g h', cls=Function) import inspect def op2(a,b): return a*b+a class AA(object): @staticmethod def

Re: Request Help With Byte/String Problem

2016-12-01 Thread Wildman via Python-list
On Wed, 30 Nov 2016 07:54:45 -0500, Dennis Lee Bieber wrote: > On Tue, 29 Nov 2016 22:01:51 -0600, Wildman via Python-list > declaimed the following: > >>I really appreciate your reply. Your suggestion fixed that >>problem, however, a new error appeared. I am doing

Re: Request Help With Byte/String Problem

2016-12-01 Thread Wildman via Python-list
On Wed, 30 Nov 2016 14:39:02 +0200, Anssi Saari wrote: > There'll be a couple more issues with the printing but they should be > easy enough. I finally figured it out, I think. I'm not sure if my changes are what you had in mind but it is working. Below is the updated code. Thank you for not

Re: correct way to catch exception with Python 'with' statement

2016-12-01 Thread Ned Batchelder
On Thursday, December 1, 2016 at 7:26:18 PM UTC-5, DFS wrote: > On 12/01/2016 06:48 PM, Ned Batchelder wrote: > > On Thursday, December 1, 2016 at 2:31:11 PM UTC-5, DFS wrote: > >> After a simple test below, I submit that the above scenario would never > >> occur. Ever. The time gap between

[issue28852] sorted(range(1000)) is slower in Python 3.7 compared to Python 3.5

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: On my laptop, the revision introducing the performance regression is: --- changeset: 101858:5a62d682636e user:Brett Cannon date:Fri Jun 10 14:37:21 2016 -0700 files: Doc/library/os.rst Lib/test/test_os.py Misc/NEWS

[issue23507] Tuple creation is too slow

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: > I opened a new issue #28852 to track this performance regression. So can I close again this issue? -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue28855] Compiler warnings in _PyObject_CallArg1()

2016-12-01 Thread STINNER Victor
New submission from STINNER Victor: _PyObject_CallArg1() is the following macro: --- #define _PyObject_CallArg1(func, arg) \ _PyObject_FastCall((func), &(arg), 1) --- It works well in most cases, but my change 8f258245c391 or change b9c9691c72c5 added compiler warnings, because an argument

[issue28856] %b format for bytes does not support objects that follow the buffer protocol

2016-12-01 Thread Alexander Belopolsky
New submission from Alexander Belopolsky: Python 3.7.0a0 (default:be70d64bbf88, Dec 1 2016, 21:21:25) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from array import array >>> a = array('B', [1,

[issue28858] Fastcall uses more C stack

2016-12-01 Thread STINNER Victor
New submission from STINNER Victor: Serhiy Storchaka reported that Python 3.6 crashs earlier than Python 3.5 on calling json.dumps() when sys.setrecursionlimit() is increased. I tested the script he wrote. Results on Python built in release mode: Python 3.7: ... 58100 116204 Segmentation

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: Here is the output of getandroidapilevel(), a verbose run of test_sys and a run of the test suite on the Android x86 emulator API 21. All the results are as expected, the failed tests are the usual ones, BTW all of the failed tests have either a patch ready

[issue23507] Tuple creation is too slow

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: haypo: "status: open -> closed" Oops, it's a mistake, sorry. I only wanted to ask the question, not to close the issue. Serhiy Storchaka: "No, I'm referring to the crashing. The code that worked before your changes now are crashing." Sorry, I didn't notice

[issue28855] Compiler warnings in _PyObject_CallArg1()

2016-12-01 Thread Benjamin Peterson
Benjamin Peterson added the comment: I also think forcing callers to cast is fine. Most of our APIs require PyObject *. -- ___ Python tracker ___

What do you think: good idea to launch a marketplace on python+django?

2016-12-01 Thread Gus_G
Hello, what do you think about building a marketplace website on connection of python+django? End effect-side should look and work similar to these: https://zoptamo.com/uk/s-abs-c-uk, https://www.ownerdirect.com/ . What are your opinions on this idea? Maybe there is other, better way to build

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: @Xavier: Cool, thanks for checking :-) I don't have access to an Android platform yet. -- resolution: -> fixed status: open -> closed ___ Python tracker

[issue28833] cross compilation of third-party extension modules

2016-12-01 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Well, cross compiling extension modules already works fine... $ _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_aarch64-linux-android PYTHONHOME=~/Projects/python3-android/build/21-aarch64-linux-android-4.9/usr python3.7 setup.py build_ext running build_ext

[issue28833] cross compilation of third-party extension modules

2016-12-01 Thread Xavier de Gaye
Xavier de Gaye added the comment: $ _PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata_m_linux_aarch64-linux-android PYTHONHOME=~/Projects/python3-android/build/21-aarch64-linux-android-4.9/usr python3.7 setup.py build_ext > Variables prefixed by an underscore such as '_PYTHON_SYSCONFIGDATA_NAME' are

[issue28849] do not define sys.implementation._multiarch on Android

2016-12-01 Thread Xavier de Gaye
New submission from Xavier de Gaye: Android is not a multiarch system and the unix build system can cross compile non-multiarch systems as well as multiarch systems. This is a follow up of the decisions implemented in issue 28046 and the patch fixes also an oversight made in this issue in

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: getandroidapilevel-3.patch: Updated version of getandroidapilevel.patch: replace "runtime" with "build time" in the doc :-) Remove also "version > 0" check in support/__init__.py. About the version > 0 check: would it make sense to add the check in

[issue28740] Add sys.getandroidapilevel()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: I suggest to start to add sys.getandroidapilevel(), and then discuss how to expose (or not) the runtime version. Reminder: The first step is to have a working Python on Android. I opened this issue to fix the issue #28596. Getting the runtime version is a new

[issue11145] '%o' % user-defined instance

2016-12-01 Thread Roundup Robot
Roundup Robot added the comment: New changeset adb296e4bcaa by Serhiy Storchaka in branch '2.7': Issue #11145: Fixed miscellaneous issues with C-style formatting of types https://hg.python.org/cpython/rev/adb296e4bcaa -- nosy: +python-dev ___ Python

Re: Merge Two List of Dict

2016-12-01 Thread Peter Otten
Nikhil Verma wrote: > Hey guys > > What is the most optimal and pythonic solution forthis situation > > A = [{'person_id': '1', 'adop_count': '2'}, {'person_id': '3', > 'adop_count': '4'}] > *len(A) might be above 10L* > > B = [{'person_id': '1', 'village_id': '3'}, {'person_id': '3', >

[issue17490] Improve ast.literal_eval test suite coverage

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agreed with Raymond, the current version of the code looks clearer. -- nosy: +serhiy.storchaka ___ Python tracker

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file45720/bench_fastcalldict.py ___ Python tracker ___

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: (Oops, I attached the wrong benchmark script. It's now fixed.) -- Added file: http://bugs.python.org/file45721/bench_fastcalldict.py ___ Python tracker

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread STINNER Victor
STINNER Victor added the comment: bench_fastcalldict.py: hardcore microbenchmark on _PyFunction_FastCallDict(). Pass keyword arguments to the tp_init slot of a Python constructor. Result for 1, 5 and 10 keyword arguments: kw1: Median +- std dev: [ref] 329 ns +- 21 ns -> [patch] 306 ns +- 17

[issue28755] Rework syntax highlighing in howto/clinic.rst

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > (Ned asked for only release-critical changes to go into 3.6 at the moment.) Except the documentation changes. -- nosy: +serhiy.storchaka ___ Python tracker

Re: Merge Two List of Dict

2016-12-01 Thread Tim Chase
On 2016-12-01 12:44, Nikhil Verma wrote: > A = [{'person_id': '1', 'adop_count': '2'}, {'person_id': '3', > 'adop_count': '4'}] > *len(A) might be above 10L* > > B = [{'person_id': '1', 'village_id': '3'}, {'person_id': '3', > 'village_id': '4'}] > *len(B) might be above 20L* > > > OutPut List

[issue26363] __builtins__ propagation is misleading described in exec and eval documentation

2016-12-01 Thread Xavier Combelle
Xavier Combelle added the comment: Hi Julien, You are fully right that it is the builtin module dictionnary which is inserted in eval or exec context. However, if a "__builtins__" entry is passed to eval or exec, this builtin module dictionnary is modified hence the following work: >>>

[issue17490] Improve ast.literal_eval test suite coverage

2016-12-01 Thread Nick Coghlan
Nick Coghlan added the comment: Right, the only reason this is still open is because I thought the extra test cases might be interesting in their own right (just not interesting enough to sit down and apply). -- ___ Python tracker

[issue28847] dumbdbm should not commit if in read mode

2016-12-01 Thread Jonathan Ng
Jonathan Ng added the comment: I'm not sure how to create an OSError. But perhaps something like this: ''' from dbm import dumb import os db = dumb.open('temp', flag='n') db['foo'] = 'bar' db.close() db = dumb.open('temp', flag='r') print(len(db.keys())) db.close os.rename('temp.dir',

[issue11145] '%o' % user-defined instance

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

Re: Merge Two List of Dict

2016-12-01 Thread Peter Otten
Peter Otten wrote: > If the data stems from a database you can run (untested) > > select B.village_id, sum(A.adop_count) from A inner join B on A.person_id > = B.person_id; > Oops, I forgot the group-by clause: select B.village_id, sum(A.adop_count) from A inner join B on A.person_id =

[issue28840] IDLE not handling long lines correctly

2016-12-01 Thread piotr.sk
piotr.sk added the comment: Thank you for explanation of the background problem. Updating documentation as you mention is a good next step. Thanks as well for the proposed solution of splitting the input string, but as long as it is just a display issue, this is not needed for test strings.

[issue28839] _PyFunction_FastCallDict(): replace PyTuple_New() with PyMem_Malloc()

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I agree with Josh, PyTuple_New() can be faster than PyMem_Malloc() due to tuple free list. small_stack increases C stack consumption even for calls without keyword arguments. This is serious problem since we can't control stack overflow. --

[issue26483] docs unclear on difference between str.isdigit() and str.isdecimal()

2016-12-01 Thread Julien Palard
Julien Palard added the comment: “digits which do not form decimal radix forms” > “forming a form” seems a long way of saying very little. The difference seems > a bit vague > I gather that digits not in the Unicode “decimal digit” category are often > (always?) still decimal digits I

[issue28833] cross compilation of third-party extension modules

2016-12-01 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: I know. I guess it can be determined without manually specifying but haven't investigated into details. Maybe some patches are necessary. -- ___ Python tracker

[issue28838] Uniformize argument names of "call" functions (C API)

2016-12-01 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > * Callable object: callable, o, callable_object => func The original names better describes the argument type in functions like PyObject_Call(). It works not just with functions, but with arbitrary callables. For example it is used with type objects for

[issue27286] str object got multiple values for keyword argument

2016-12-01 Thread Shai Berger
Shai Berger added the comment: Following the last comment, and just as clarification for anyone else running into this and thinking like me: The bumped code is not included in v3.5.2, and v3.5.3 hasn't been released yet. Should it be undone? No, because the bump which was encountered by John

[issue28849] do not define sys.implementation._multiarch on Android

2016-12-01 Thread Chi Hsuan Yen
Chi Hsuan Yen added the comment: Actually all UNIX-like platforms now have non-empty sys.implementation._multiarch now (msg273875). An idea is renaming it to something like target_architecture to make things clearer. It will be a triplet on all system, whether cross-built or not. --

  1   2   >