Re: [Python-Dev] User + sys time bigger than real time, in case of no real parallelism

2017-02-05 Thread Hans-Peter Jansen
On Sonntag, 5. Februar 2017 07:59:04 Marco Buttu wrote: > I am really sorry for the OT :-( I asked elsewhere but without any > answer :-( > I can not figure out why in this short example the user+sys time is > bigger than real time. The example executes the task() functions twice, > with each execu

[Python-Dev] Context manager lifetime rules Was: Re: Adding bytes.frombuffer() constructor to PEP 467

2017-01-06 Thread Hans-Peter Jansen
Hi Yury, adjusted subject, since I'm dragging the discussion away from it. On Donnerstag, 5. Januar 2017 20:28:26 Yury Selivanov wrote: > On 2017-01-05 7:11 PM, INADA Naoki wrote: > >> bytes.frombuffer(x) is bytes(memoryview(x)) or memoryview(x).tobytes(). > > > > There is pitfall: memoryview sh

Re: [Python-Dev] ctypes, memory mapped files and context manager

2017-01-05 Thread Hans-Peter Jansen
On Freitag, 6. Januar 2017 00:28:37 Hans-Peter Jansen wrote: > Hi Eryk, > > This is exactly, what I was after: > > @contextmanager > def cstructmap(cstruct, mm, offset = 0): > # resize the mmap (and backing file), if structure exceeds mmap size > # mmap

Re: [Python-Dev] ctypes, memory mapped files and context manager

2017-01-05 Thread Hans-Peter Jansen
Hi Eryk, On Donnerstag, 5. Januar 2017 15:30:33 eryk sun wrote: > > > manager introduce a layer of indirection: > I think that's the best you can do with the current state of ctypes. > > from_buffer was made safer in Python 3 by ensuring it keeps a > memoryview reference in the _objects attribut

Re: [Python-Dev] ctypes, memory mapped files and context manager

2017-01-05 Thread Hans-Peter Jansen
Hi Nick, On Donnerstag, 5. Januar 2017 12:37:20 Nick Coghlan wrote: > I don't know ctypes well enough myself to comment on the idea of > offering fully deterministic cleanup, but the closest you could get to > that without requiring a change to ctypes is to have the context > manager introduce a l

[Python-Dev] ctypes, memory mapped files and context manager

2017-01-04 Thread Hans-Peter Jansen
Hi, first of all, sorry for being such a pest, but all former attempts to solve this issue on other fora has been grinding to a halt. In short: I try to combine a context manager with ctypes structures on memory mapped files in order to manage huge binary files. (An approach, that performs gre

[Python-Dev] distutils_ui 0.1.1 released

2016-12-04 Thread Hans-Peter Jansen
For those of you, who like PyQt{4,5} as much as I do, as well as for those who don't like it that much, because of the poor integration with setuptools et.al., here's another piece of software to bridge the gap: A distutils build extension for PyQt{4,5} applications that makes handling