pathlib

2019-09-29 Thread DL Neil via Python-list
Should pathlib reflect changes it has made to the file-system? Sample code, below, shows pathlib identifying a data-file and then renaming it. Yet, after the rename operation, pathlib doesn't recognise its own change; whereas the file system does/proves the change was actioned. $ touch bef

Re: Synchronous and Asynchronous callbacks

2019-09-29 Thread Eko palypse
Am Sonntag, 29. September 2019 19:18:32 UTC+2 schrieb Barry Scott: > > On 29 Sep 2019, at 14:14, Eko palypse wrote: > > > > Unfortunately, I can't make all callbacks synchronous or asynchronous > > because this has negative effects on the application in one way or another. > > Surely you can ma

Re: Interesting performance question

2019-09-29 Thread Terry Reedy
On 9/29/2019 9:45 AM, Eryk Sun wrote: On 9/29/19, Anthony Flury via Python-list wrote: Using python 3.6 building a tuple like this : my_tuple = tuple([x*x for x in range(1,1000)]) The list comprehension is implemented internally as a function that builds and returns the list. This function

Re: Synchronous and Asynchronous callbacks

2019-09-29 Thread Barry Scott
> On 29 Sep 2019, at 14:14, Eko palypse wrote: > > Unfortunately, I can't make all callbacks synchronous or asynchronous because > this has negative effects on the application in one way or another. Surely you can make all callbacks async? You do not have to have them wait, they can complete

Re: Generate simple image on a standalone Raspberrry Pi

2019-09-29 Thread Roy Hann
Eli the Bearded wrote: > In comp.lang.python, Roy Hann wrote: >> I am designing a mobile application to run on a Raspberry Pi 3 model B. >> It will not have any Internet access. I need to generate a static image >> consisting of a simple arc representing (say) a speedometer or a >> pressure gaug

Re: Interesting performance question

2019-09-29 Thread Eryk Sun
On 9/29/19, Anthony Flury via Python-list wrote: > > Using python 3.6 building a tuple like this : > > my_tuple = tuple([x*x for x in range(1,1000)]) The list comprehension is implemented internally as a function that builds and returns the list. This function creates an empty list and loops over

Re: Synchronous and Asynchronous callbacks

2019-09-29 Thread Eko palypse
Am Sonntag, 29. September 2019 01:02:48 UTC+2 schrieb Paul Rubin: > Eko palypse writes: > > Two dicts, one for sync and the other for async registrations? > > Why not make all the callbacks asynchronous? Clients that don't want to > handle a callback immediately can keep it pending until they ar

Interesting performance question

2019-09-29 Thread Anthony Flury via Python-list
I have just noticed an oddity : Using python 3.6 building a tuple like this : my_tuple = tuple([x*x for x in range(1,1000)]) is about 1/3 quicker than     my_tuple = tuple(x*x for x in range(1,1000)) Measurements : $  python3 -m timeit 'my_tuple = tuple([x*x for x in range(1,1000)])' 1