[issue39801] list.insert is slow, likely due to manual memmove

2020-02-29 Thread Stefan Pochmann
Change by Stefan Pochmann : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:

[issue39801] list.insert is slow, likely due to manual memmove

2020-02-29 Thread Stefan Pochmann
Stefan Pochmann added the comment: I think I have a decent way to isolate the memmove vs for-loop times, in Python code. Here are example results, five rounds of inserting with list.insert or with slice assignment. The times for each of the two ways are pretty stable: insertslice 0.0

[issue39801] list.insert is slow, likely due to manual memmove

2020-02-29 Thread Stefan Pochmann
Stefan Pochmann added the comment: I misspoke. I do the insertions at -1 and -500 not on the same list but each on a fresh list (of length 2**20+1). -- ___ Python tracker ___

[issue39804] timezone constants in time module inaccurate with negative DST (e.g. Ireland)

2020-02-29 Thread Paul Ganssle
New submission from Paul Ganssle : >From a report on the dateutil tracker today, I found that `time.timezone` and >`time.altzone` are not accurate in Ireland (at least on Linux, not tested on >other platforms): https://github.com/dateutil/dateutil/issues/1009 Europe/Dublin in the modern era h

[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-29 Thread Elad Lahav
Elad Lahav added the comment: "setup.py doesn't use multiprocessing. multiprocessing is super complex. Would it be possible to write a reproducer which doesn't use multiprocessing?" But the problem is with the handling of fork() by Python modules, and specifically with multi-threaded fork()s

[issue39763] distutils.spawn should use subprocess (hang in parallel builds on QNX)

2020-02-29 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: -p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue39805] Copying functions doesn't actually copy them

2020-02-29 Thread Steven D'Aprano
New submission from Steven D'Aprano : Function objects are mutable, so I expected that a copy of a function should be an actual independent copy. But it isn't. py> from copy import copy py> a = lambda: 1 py> b = copy(a) py> a is b True This burned me when I modified the co

[issue39800] Inconsistent/incomplete disassembly of methods vs method source code

2020-02-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: > BTW how else are methods/functions are created in Python except via def? Functions are objects like everything else in Python, so they have a type, which has a constructor: from types import FunctionType The documentation for FunctionType is a bit th

[issue39805] Copying functions doesn't actually copy them

2020-02-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think this is sufficient for a shallow copy. import copy import types def copyfunction(func): new = types.FunctionType( func.__code__, func.__globals__, func.__name__, func.__defaults__, func.

[issue39800] Inconsistent/incomplete disassembly of methods vs method source code

2020-02-29 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ah, I see now. I was using an older version of Python and the output of dis was different. It didn't recurse in to show the disassembly of the code object as well. > The first block of instructions here are for the def statement, and > the second block for

[issue39800] Inconsistent/incomplete disassembly of methods vs method source code

2020-02-29 Thread S Murthy
S Murthy added the comment: Yes, I know that a method body may contain more than just the return statement - I was referrring to the byte code for the method def f(x): return x**2. I don't think the output of dis.dis is correct here for the source string of f - it doesn't make sense for exam

[issue12915] Add inspect.locate and inspect.resolve

2020-02-29 Thread Michael Felt
Michael Felt added the comment: I am very busy with normal work this week. However I’ll attempt to add a pr with your (Victor”s) suggestion. Sent from my iPhone > On 29 Feb 2020, at 23:36, STINNER Victor wrote: > >  > STINNER Victor added the comment: > >> File >> "/home/buildbot/buil

<    1   2