Re: What does stats = await asyncio.to_thread(os.stat, url) do? (Was async I/O via threads is extremly slow)

2025-06-25 Thread Peter J. Holzer
measured how long it takes to create and join a thread. Here CPython with 72 µs is quite a bit faster than PyPy with 150 µs, but even that should be able to do about 250 create thread/stat/join cycles (although of course that would be a stupid thing to do). Oh, and lo and behold, that's about t

Re: What does stats = await asyncio.to_thread(os.stat, url) do? (Was async I/O via threads is extremly slow)

2025-06-24 Thread Peter J. Holzer
On 2025-06-24 00:32:26 +0200, Mild Shock wrote: > So what does: > > stats = await asyncio.to_thread(os.stat, url) > > Whell it calls in a sparate new secondary thread: > > os.stat(url) > > It happends that url is only a file path, and > the file path points to an existing file. So the > seconda

Re: What does stats = await asyncio.to_thread(os.stat, url) do? (Was async I/O via threads is extremly slow)

2025-06-23 Thread Inada Naoki via Python-list
I use a custom async I/O file property > > predicate. It doesn't need to be async for file > > > > system access. But by some historical circumstances > > I made it async since the same file property routine > > might also do a http HEAD request. But what I was &

What does the Async Detour usually cost (Was: What does stats = await asyncio.to_thread(os.stat, url) do?)

2025-06-23 Thread Mild Shock
Hi, I have some data what the Async Detour usually costs. I just compared with another Java Prolog that didn't do the thread thingy. Reported measurement with the async Java Prolog: > JDK 24: 50 ms (using Threads, not yet VirtualThreads) New additional measurement with an alternat

What does stats = await asyncio.to_thread(os.stat, url) do? (Was async I/O via threads is extremly slow)

2025-06-23 Thread Mild Shock
since the same file property routine might also do a http HEAD request. But what I was testing and comparing was a simple file system access inside a wrapped thread, that is async awaited. Such a thread is called for a couple of directory entries to check a directory tree whether updates are n

Re: Where I do ask for a new feature

2023-10-20 Thread dn via Python-list
On 21/10/2023 01.32, Thomas Passin via Python-list wrote: On 10/19/2023 11:16 PM, Bongo Ferno via Python-list wrote: On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, avi.e...@gmail.com wrote: There are many ways to make transient variables that disappear at some time and do we need yet

Re: Where I do ask for a new feature

2023-10-20 Thread Michael Torrie via Python-list
On 10/19/23 19:32, Bongo Ferno via Python-list wrote: > >> You can actually just do that with simple assignment! >> >> short_view = my_object.stuff.long_stuff.sub_object >> print(short_view.some_method()) > > but then have to delete the variable manually >

RE: Where I do ask for a new feature

2023-10-20 Thread AVI GROSS via Python-list
your own carelessness. I do note that reusing a variable like "i" is not uncommon and especially when it is merely used as a looping variable. Generally anything else using the same variable does not need to refer to the other use and is in another scope. May I politely ask if you ca

Re: Where I do ask for a new feature

2023-10-20 Thread Thomas Passin via Python-list
On 10/19/2023 11:16 PM, Bongo Ferno via Python-list wrote: On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, avi.e...@gmail.com wrote: There are many ways to make transient variables that disappear at some time and do we need yet another? Yes, you can create one of those ways but what is the

Re: Where I do ask for a new feature

2023-10-20 Thread Roel Schroeven via Python-list
Op 20/10/2023 om 5:16 schreef Bongo Ferno via Python-list: On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, avi.e...@gmail.com wrote: > There are many ways to make transient variables that disappear at some time > and do we need yet another? Yes, you can create one of those ways bu

Re: Where I do ask for a new feature

2023-10-19 Thread Cameron Simpson via Python-list
On 19Oct2023 20:16, Bongo Ferno wrote: A with statement makes clear that the alias is an alias and is local, and it automatically clears the variable after the block code is used. No it doesn't: >>> with open('/dev/null') as f: ... print(f) ... <_io.TextIOWrapper name='/dev/

Re: Where I do ask for a new feature

2023-10-19 Thread Bongo Ferno via Python-list
On Thursday, October 19, 2023 at 11:26:52 PM UTC-3, avi.e...@gmail.com wrote: > There are many ways to make transient variables that disappear at some time > and do we need yet another? Yes, you can create one of those ways but what > is the big deal with deleting a variable when no lo

RE: Where I do ask for a new feature

2023-10-19 Thread AVI GROSS via Python-list
Bongo, Variables in most programming languages either have to be removed manually or allowed to drift outside a boundary when they disappear for scoping reasons and perhaps are garbage collected at some point. There are many ways to make transient variables that disappear at some time and do we

Re: Where I do ask for a new feature

2023-10-19 Thread Bongo Ferno via Python-list
> You can actually just do that with simple assignment! > > short_view = my_object.stuff.long_stuff.sub_object > print(short_view.some_method()) but then have to delete the variable manually del short_view -- https://mail.python.org/mailman/listinfo/python-list

Re: Where I do ask for a new feature

2023-10-16 Thread Chris Angelico via Python-list
nested object using the short alias: > print(short_view.some_method()) > > This is much more concise and readable than having to write out the full > object path every time. > You can actually just do that with simple assignment! short_view = my_object.stuff.long_stuff.sub_ob

Where I do ask for a new feature

2023-10-16 Thread Bongo Ferno via Python-list
Where I can ask python developers for a new feature? This feature would allow us to create short aliases for long object paths, similar to the with statement. This would make code more readable and maintainable. For example, if we have a long object like "MyObject.stuff.longStuff.SubObject", w

Re: Why do I always get an exception raised in this __init__()?

2023-09-03 Thread Chris Green via Python-list
x27;t find pin '" + pin + "'") > > You don't store the line anywhere. > You need to use self.line > self.line = chip.get_line(l) > if pin... > > > def print_name(self): > > print (self.line.name()) > >

Re: Why do I always get an exception raised in this __init__()?

2023-09-01 Thread Alan Gauld via Python-list
ou need to use self.line self.line = chip.get_line(l) if pin... > def print_name(self): > print (self.line.name()) > > def set(self): > self.line.set_value(1) > > def clear(self): > self.line.set_value(0) A

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Larry Martell via Python-list
a diagnostic for example. However I really can't understand why I > see the following when I try it:- > > >>> import ngp > >>> ngp.Gpiopin("P9_23") > Found: P9_23 > Traceback (most recent call last): > File &

Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
recent call last): File "", line 1, in File "/home/chris/.cfg/hosts/bbb/bin/ngp.py", line 24, in __init__ return ValueError: Can't find pin 'P9_23' >>> Does a return in __init__() not do what I think it does? How else could/should I do this? -- Chris Green · -- https://mail.python.org/mailman/listinfo/python-list

Re: Why do I always get an exception raised in this __init__()?

2023-08-31 Thread Chris Green via Python-list
Chris Green wrote: [snip code and question] Sorry folks, it was a caching problem, I wasn't running the code I thought I was running! When I made sure I had cleared everything out and tried again it all worked as I expected. -- Chris Green · -- https://mail.python.org/mailman/listinfo/python

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-12 Thread Chris Angelico
captured_output += line (You can play around with other ways of scoping this, I'm just using a global for simplicity) Inside run_command, you can then spawn three independent tasks and await them simultaneously. Once all three finish, you have your captured output, and the process

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-12 Thread Horst Koiner
Using asyncio for this is a good possibility I was not aware of. My best try with asyncio was: import asyncio async def run_command(): # Create subprocess process = await asyncio.create_subprocess_exec( './test.sh', stdout=asyncio.subprocess.PIPE, # Redirect stdout to a p

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-10 Thread Mats Wichmann
On 5/10/23 12:51, Dieter Maurer wrote: Horst Koiner wrote at 2023-5-9 11:13 -0700: ... For production i run the program with stdout=subprocess.PIPE and i can fetch than the output later. For just testing if the program works, i run with stdout=subprocess.STDOUT and I see all program output on

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-10 Thread Dieter Maurer
Horst Koiner wrote at 2023-5-9 11:13 -0700: > ... >For production i run the program with stdout=subprocess.PIPE and i can fetch >than the output later. For just testing if the program works, i run with >stdout=subprocess.STDOUT and I see all program output on the console, but my >program afterwa

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-09 Thread Eryk Sun
On 5/9/23, Thomas Passin wrote: > > I'm not sure if this exactly fits your situation, but if you use > subprocess with pipes, you can often get a deadlock because the stdout > (or stderr, I suppose) pipe has a small capacity and fills up quickly > (at least on Windows), The pipe size is relativel

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-09 Thread jak
output the effort is much to high. ####### Do you have further ideas for implementing such a behavior? Do you think that a feature request should be done of I'm omitting something obvious? Thanks you in advance for your suggestions, Horst. I agree with @'thomas Passin&#

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-09 Thread Thomas Passin
output the effort is much to high. ####### Do you have further ideas for implementing such a behavior? Do you think that a feature request should be done of I'm omitting something obvious? I'm not sure if this exactly fits your situation, but if you use

Re: Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-09 Thread Mats Wichmann
On 5/9/23 12:13, Horst Koiner wrote: Hi @all, i'm running a program which is still in development with subprocess.run (Python version 3.10), further i need to capture the output of the program in a python variable. The program itself runs about 2 minutes, but it can also freeze in case of new

Do subprocess.PIPE and subprocess.STDOUT sametime

2023-05-09 Thread Horst Koiner
thrown and communicate returns at all. 3. Use threading instead => For being that simple and universal like subprocess you will more or less reimplement subprocess with threading, like its done in subprocess.py. Just for a debug output the effort is much to high. ####

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-09 Thread Cameron Simpson
On 08May2023 12:19, jak wrote: In reality you should also take into account the fact that if the header contains a 'b' instead of a 'q' as a penultimate character, then the rest of the package is converted on the basis64 "=?utf-8?Q?" --> "=?utf-8?B?" Aye. Specification: https://datatra

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Dieter Maurer
Chris Green wrote at 2023-5-6 15:58 +0100: >Chris Green wrote: >> I'm having a real hard time trying to do anything to a string (?) >> returned by mailbox.MaildirMessage.get(). >> >What a twit I am :-) > >Strings are immutable, I have to do:- > >new

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Keith Thompson
Chris Green writes: > Chris Green wrote: >> I'm having a real hard time trying to do anything to a string (?) >> returned by mailbox.MaildirMessage.get(). >> > What a twit I am :-) > > Strings are immutable, I have to do:- > > newstring = oldst

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread jak
Peter Pearson ha scritto: On Sat, 6 May 2023 14:50:40 +0100, Chris Green wrote: [snip] So, what do those =?utf-8? and ?= sequences mean? Are they part of the string or are they wrapped around the string on output as a way to show that it's utf-8 encoded? Yes, "=?utf-8?" signa

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Peter Pearson
On Sat, 6 May 2023 14:50:40 +0100, Chris Green wrote: [snip] > So, what do those =?utf-8? and ?= sequences mean? Are they part of > the string or are they wrapped around the string on output as a way to > show that it's utf-8 encoded? Yes, "=?utf-8?" signals "MIME

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread jak
Chris Green ha scritto: Keith Thompson wrote: Chris Green writes: Chris Green wrote: I'm having a real hard time trying to do anything to a string (?) returned by mailbox.MaildirMessage.get(). What a twit I am :-) Strings are immutable, I have to do:- newstring = oldstring.re

What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
I'm having a real hard time trying to do anything to a string (?) returned by mailbox.MaildirMessage.get(). I'm extracting the Subject: header from a message and, if I write what it returns to a log file using the python logging module what I see in the log file (when the Subject: has

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
Keith Thompson wrote: > Chris Green writes: > > Chris Green wrote: > >> I'm having a real hard time trying to do anything to a string (?) > >> returned by mailbox.MaildirMessage.get(). > >> > > What a twit I am :-) > > > >

Re: What do these '=?utf-8?' sequences mean in python?

2023-05-08 Thread Chris Green
Chris Green wrote: > I'm having a real hard time trying to do anything to a string (?) > returned by mailbox.MaildirMessage.get(). > What a twit I am :-) Strings are immutable, I have to do:- newstring = oldstring.replace("_", " ") Job done! -- Chris G

Re: What can I do about this?

2022-08-29 Thread gene heskett
4 ton, 80 yo Sheldon lathe with linuxcnc just to see if I could do it, first on an rpi3b. Had to build my own realtime kernel and figure out how to install it because I wanted to do it on a pi, got black holed on their forum. The amazing part is that the tarball to install it is only 28 megs

Re: What can I do about this?

2022-08-29 Thread Mark Bourne
gene heskett wrote: On 8/29/22 12:50, Mark Bourne wrote: Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me, tryi

Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 11:12:17 -0400, gene heskett wrote: > I've not had to deal with venv's before. Can more than one of these > venv things peacefully coexist? Yes. Having multiple venvs is the main reason for their existence. hp -- _ | Peter J. Holzer| Story must make more sense than

Re: What can I do about this?

2022-08-29 Thread Peter J. Holzer
On 2022-08-29 13:43:18 -0400, gene heskett wrote: > On 8/29/22 12:50, Mark Bourne wrote: > > Roel Schroeven wrote: > > > $ pip3 install -r requirements.txt  # finally invoke pip3 > > > > > > or: > > > > > > $ {path_to_venv}/bin/pip3 install -r requirements.txt > That got me to showstopper #2: (le

Re: What can I do about this?

2022-08-29 Thread gene heskett
On 8/29/22 12:50, Mark Bourne wrote: Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me, trying to make pronterfac

Re: What can I do about this?

2022-08-29 Thread Roel Schroeven
Mark Bourne schreef op 29/08/2022 om 13:02: Roel Schroeven wrote: > $ source {path_to_venv}/bin/pip3  # activate the venv I think this first line should probably be: $ source {path_to_venv}/bin/activate # activate the venv i.e. with `activate` rather than `pip3`? Oops, yes, of course. Thank

Re: What can I do about this?

2022-08-29 Thread Dennis Lee Bieber
ackages: wx3.0-doc The following NEW packages will be installed: libwxbase3.0-0v5 libwxgtk3.0-gtk3-0v5 python3-wxgtk4.0 0 upgraded, 3 newly installed, 0 to remove and 161 not upgraded. Need to get 10.5 MB of archives. After this operation, 51.6 MB of additional disk space will be used. Do you

Re: What can I do about this?

2022-08-29 Thread Mark Bourne
Roel Schroeven wrote: Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me, trying to make pronterface, inside a venv: When the package man

Re: What can I do about this?

2022-08-29 Thread gene heskett
p speed from its default 500mm. The other printer is a Prusa MK3S+ I've about $1500 USD in. It works nice _now_ but came with a high leakage hot block some gorilla had over tightened and stripped the heat break threads, but is slow if fed at cura's default 60mm speeds. So what should I do

Re: What can I do about this?

2022-08-29 Thread Roel Schroeven
Op 29/08/2022 om 2:55 schreef gene heskett: On 8/28/22 19:39, Peter J. Holzer wrote: On 2022-08-28 18:40:17 -0400, gene heskett wrote: Persuant to my claim the py3.10 is busted, here is a sample. This is me, trying to make pronterface, inside a venv: When the package manager version will only

Re: What can I do about this?

2022-08-29 Thread gene heskett
ttrdict'   [end of output]   note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned ab

Re: What can I do about this?

2022-08-28 Thread Dennis Lee Bieber
btained a 4.2.0 tar.gz version of wxPython? Maybe try overriding it with a 4.1 variant of it -- or whatever you can find in the OS's package manager. > >What do I need to do to fix this? It supposedly works on a rpi4b, but >this is a rock64, V2, >older stuff with 4 gigs of dram.

Re: What can I do about this?

2022-08-28 Thread gene heskett
writeable and second, because of this message, which you don't get if you invoke pip inside a venv (at least not if you can write it). So, first thing to do is to create the venv and activate it. Procedure? Or a url to it? Thank you Peter. Take care & stay well. hp Cheers,

Re: What can I do about this?

2022-08-28 Thread gene heskett
note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details.

Re: What can I do about this?

2022-08-28 Thread Peter J. Holzer
nv here. First, your prompt doesn't show the name of the venv, > Defaulting to user installation because normal site-packages is not > writeable and second, because of this message, which you don't get if you invoke pip inside a venv (at least not if you can write it). So,

Re: What can I do about this?

2022-08-28 Thread Chris Angelico
Defaulting to user installation because normal site-packages is not > writeable I don't think Python 3.10 is busted; it's more likely your venv is not providing a pip3 command. Try "pip3 --version", "python3 --version", and then "python3 -m pip install -r r

What can I do about this?

2022-08-28 Thread gene heskett
from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. What do I need to do to fix

Re: Why do I see digest replies to posts I never saw in a digest?

2022-07-23 Thread Peter J. Holzer
On 2022-07-23 14:01:09 -0400, pjfarl...@earthlink.net wrote: > OT to the original subject, but can anyone explain to me why in the > forum digest emails I receive I often see a reply to a post that I > never saw the original of in any prior digest? I think in most cases this is because both messag

Why do I see digest replies to posts I never saw in a digest? [was: RE: Why I fail so bad to check for memory leak with this code?]

2022-07-23 Thread pjfarley3
OT to the original subject, but can anyone explain to me why in the forum digest emails I receive I often see a reply to a post that I never saw the original of in any prior digest? Peter > -Original Message- > From: Marco Sulla > Sent: Friday, July 22, 2022 3:41 PM > To: Barry > Cc:

Re: Fwd: Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Mats Wichmann
On 5/6/22 09:24, Sam Ezeh wrote: > -- Forwarded message - > From: Sam Ezeh > Date: Fri, 6 May 2022, 15:29 > Subject: Re: Do projects exist to audit PyPI-hosted packages? > To: Skip Montanaro > > > I've had similar thoughts in the past. I don't

Re: Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Skip Montanaro
> > A related problem is that even if a package is maintained by somebody with > good intentions, the account might be hijacked by a malicious actor and > since PyPi is separate from source control, people might not be able to > find out easily and malware could spread through PyPi. > I hadn't con

Fwd: Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Sam Ezeh
-- Forwarded message - From: Sam Ezeh Date: Fri, 6 May 2022, 15:29 Subject: Re: Do projects exist to audit PyPI-hosted packages? To: Skip Montanaro I've had similar thoughts in the past. I don't know of anything but I wonder if repositiories for other languages

Do projects exist to audit PyPI-hosted packages?

2022-05-06 Thread Skip Montanaro
yboard and mouse activity, I was happy when I stumbled upon pynput <https://pypi.org/project/pynput/>. "Yay!", I thought. My worries are over. Then extremely early this morning I woke thinking, "Damn, this runs on my computer and it can see my mouse and keyboard activity. How do I

Re: What to do to correct the error written below:

2022-04-12 Thread Peter Pearson
ks exceeds >>the number of students. Is there some reason to assume that the >>number of books cannot exceed the number of students? > > Since this is an online library the number of students can be any when > compared to number of books or the number of students has nothing t

Re: What to do to correct the error written below:

2022-04-12 Thread Greg Ewing
On 12/04/22 2:28 am, Peter Pearson wrote: By looping over elements in "books" and incrementing counter i, which is used as an index both for "books" and for "students", you will produce an error whenever the number of books exceeds the number of students. More fundamentally, it assumes there is

Re: What to do to correct the error written below:

2022-04-11 Thread Dennis Lee Bieber
On Mon, 11 Apr 2022 00:14:49 -0700 (PDT), NArshad declaimed the following: >for i in issuedBooks: Loop control variable is "i"... >i=0 Control variable "i" has been overwritten so any use of "i" following this is suspicious >for l in books: Inner-

Re: What to do to correct the error written below:

2022-04-11 Thread Dennis Lee Bieber
On 11 Apr 2022 14:28:51 GMT, Peter Pearson declaimed the following: >Is this homework? In this newsgroup, by custom, homework problems >should be announced as such, since the best answer to a homework >question is different from the best answer to a real-life problem. > It's a return to

Re: What to do to correct the error written below:

2022-04-11 Thread Peter Pearson
On Mon, 11 Apr 2022 00:14:49 -0700 (PDT), NArshad wrote: [snip] > books = list(models.Book.objects.filter(isbn=i.isbn)) > students = list(models.Student.objects.filter(user=i.student_id)) > i=0 > for l in books: > > t=(students[i].user,students[i].user_i

Re: What to do to correct the error written below:

2022-04-10 Thread Peter Pearson
On Sat, 9 Apr 2022 04:59:05 -0700 (PDT), NArshad wrote: > I have accidentally deleted one account in a Django project because of > which one of the pages is no more accessible and is giving the error > written below: > > IndexError at /view_issued_book/ > list index out of range > > and the error

Do you support The #Python Software Foundation making a statement in support of peace?

2022-03-13 Thread René Dudfield
hey hey, Do you support The Python Software Foundation making a statement in support of peace? Vote here: https://twitter.com/pygame_org/status/1502989885296238593 cheerio, -- https://mail.python.org/mailman/listinfo/python-list

Re: How do you log in your projects?

2022-02-11 Thread alister via Python-list
l the program but I most of the time I end up with very > confusing logs. > > There are exceptions, yes, but I prefer the line by line where the log > should explain what is doing the code. > >>> - Which kind of variable contents do you write into your logfiles? >>>

Re: How do you log in your projects?

2022-02-10 Thread Martin Di Paola
the user don't care about it. If the error is due something that the user did wrong, then the message should say that and, if possible, add a suggestion of how to do it. For example "The file 'foo.md' was not found." is quite descriptive. If you add to that message a

Re: How do you log in your projects?

2022-02-10 Thread Marco Sulla
On Wed, 9 Feb 2022 at 20:40, Martin Di Paola wrote: > > If the logs are meant to be read by my users I log high level messages, > specially before parts that can take a while (like the classic > "Loading..."). ? Logs are not intended to be read by end users. Logs are primarily used to understand

Re: How do you log in your projects?

2022-02-09 Thread Martin Di Paola
, yes, but I prefer the line by line where the log should explain what is doing the code. - Which kind of variable contents do you write into your logfiles? - How do you decide, which kind of log message goes into which level? - How do you prevent logging cluttering your actual code? These

Re: Kind Remainder: How do Practitioners Approach towards Requirements Engineering?

2022-02-08 Thread Avi Gross via Python-list
Is there any way to get this mesage to stop showing up in my mailbox in what seems to be a shotgun approach asking everybody everywhere they can think of to participate in something very amorphous and at the same time having NOTHING particular to do with Python? I consider things like this SPAM

Re: How do you log in your projects?

2022-02-08 Thread Barry
t help you turn to, and sometimes it is the only way > to know what is going on. Not that the code of most (FLOSS) software is not > available, but you simply do not have the time to read into the code of every > piece of software you run. > > So of course I want to write software

Re: How do you log in your projects?

2022-02-08 Thread Marco Sulla
These are a lot of questions. I hope we're not off topic. I don't know if mine are best practices. I can tell what I try to do. On Tue, 8 Feb 2022 at 15:15, Lars Liedtke wrote: > - On a line per line basis? on a function/method basis? I usually log the start and end of functions.

How do you log in your projects?

2022-02-08 Thread Lars Liedtke
) software is not available, but you simply do not have the time to read into the code of every piece of software you run. So of course I want to write software on my own, if I have to or wpuld like to, that has got a decent amount of logging. But how often to actually log things? Of course the

Kind Remainder: How do Practitioners Approach towards Requirements Engineering?

2022-02-08 Thread ETEM ÇETİN TOPTANİ
Dear Sir or Madam, We prepared a short survey to understand practitioners’ perspectives towards the requirements engineering. Our survey basically aims to clarify on many aspects of the requirements engineering applied in industry, including (i) requirements gathering and specifications, (ii) req

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Avi Gross via Python-list
time_after_time But to be more pythonic, throw some double underscores before and after. -Original Message- From: Igor Berger To: python-list@python.org Sent: Fri, Feb 4, 2022 12:40 pm Subject: Re: Waht do you think about my repeated_timer class On Friday, February 4, 2022 at 12:28:53

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Cecil Westerhof via Python-list
; name … >> >> >> >> The class starts a thread where every by the user defined interval a >> >> by the user define function is called. >> > >> > How about `timed_repeat` or `repeat_timer`? >> >> timed_repeat does have something. >

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Martin Di Paola
create a more efficient class. (This means I have to change also the code that uses it.) There I have to do something like you suggest. (I am already working on it.) Personally I am also of the opinion that the function should finish in less as 10% from the interval. (That was one of my rewrite

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Chris Angelico
On Sat, 5 Feb 2022 at 04:33, Cecil Westerhof via Python-list wrote: > > Ethan Furman writes: > > > On 2/4/22 6:28 AM, Cecil Westerhof via Python-list wrote: > > > >> It was already not a good name, but I am rewriting the class > >> completely, so now the name is a complete bumper. (No more timer.

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Cecil Westerhof via Python-list
Igor Berger writes: > On Friday, February 4, 2022 at 12:28:53 PM UTC-5, Cecil Westerhof wrote: >> Ethan Furman writes: >> >> > On 2/4/22 6:28 AM, Cecil Westerhof via Python-list wrote: >> > >> >> It was already not a good name, but I am rewriting the class >> >> completely, so now the name

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Igor Berger
On Friday, February 4, 2022 at 12:28:53 PM UTC-5, Cecil Westerhof wrote: > Ethan Furman writes: > > > On 2/4/22 6:28 AM, Cecil Westerhof via Python-list wrote: > > > >> It was already not a good name, but I am rewriting the class > >> completely, so now the name is a complete bumper. (No more

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Cecil Westerhof via Python-list
Ethan Furman writes: > On 2/4/22 6:28 AM, Cecil Westerhof via Python-list wrote: > >> It was already not a good name, but I am rewriting the class >> completely, so now the name is a complete bumper. (No more timer.) I >> am thinking about naming the class repeating_thread, but I cannot say >> th

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Ethan Furman
On 2/4/22 6:28 AM, Cecil Westerhof via Python-list wrote: > It was already not a good name, but I am rewriting the class > completely, so now the name is a complete bumper. (No more timer.) I > am thinking about naming the class repeating_thread, but I cannot say > that I find it a very good name

Re: Waht do you think about my repeated_timer class

2022-02-04 Thread Cecil Westerhof via Python-list
Cecil Westerhof writes: It was already not a good name, but I am rewriting the class completely, so now the name is a complete bumper. (No more timer.) I am thinking about naming the class repeating_thread, but I cannot say that I find it a very good name. So if someone has a good idea for a name

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread Cecil Westerhof via Python-list
all the run function record the time.time() as start_time. > Then you can calculate next_interval = max( .001, interval - time.time() - > start_time) > I use 1ms as the min interval. But I am working on a complete rewrite to create a more efficient class. (This means I have to change also th

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread Barry
> On 3 Feb 2022, at 04:45, Cecil Westerhof via Python-list > wrote: > > Have to be careful that timing keeps correct when target takes a 'lot' > of time. > Something to ponder about, but can wait. You have noticed that your class does call the function at the repeat interval but rather at t

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread Albert-Jan Roskam
On Feb 2, 2022 23:31, Barry wrote: > On 2 Feb 2022, at 21:12, Marco Sulla wrote: > > You could add a __del__ that calls stop :) Didn't python3 make this non deterministic when del is called? I thought the recommendation is to not rely on __del__ in python3 code

Re: Waht do you think about my repeated_timer class

2022-02-03 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 05:52:19 +0100, Cecil Westerhof via Python-list wrote: > 2qdxy4rzwzuui...@potatochowder.com writes: > > > FWIW, I'd find some way to tell users the units (seconds, milliseconds, > > fortnights, etc.) instead of making them wade through your code to find > > the call to (and poss

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
tion, but there's nothing wrong with that if >> >> > you're looking for something simple.) >> >> >> >> It is just something I wrote fast. How could I do this in a better way? >> > >> > I'll answer your question, but first and

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Cecil Westerhof writes: > I need (sometimes) to repeatedly execute a function. For this I wrote > the below class. What do you think about it? I wrote some unit test for the class. Is this the correct way to do this? For example in test_correct_params_no_start I check four things. Some

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
2qdxy4rzwzuui...@potatochowder.com writes: > FWIW, I'd find some way to tell users the units (seconds, milliseconds, > fortnights, etc.) instead of making them wade through your code to find > the call to (and possibly the [broken] help text of) Timer. You mean with docstring? -- Cecil Westerho

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
> >> > you're looking for something simple.) > >> > >> It is just something I wrote fast. How could I do this in a better way? > > > > I'll answer your question, but first and foremost: Your code was fine, > > and if something does what it's

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Cecil Westerhof via Python-list
Chris Angelico writes: >> > (Side point: The OP's code is quite inefficient, as it creates a new >> > thread for each reiteration, but there's nothing wrong with that if >> > you're looking for something simple.) >> >> It is just somet

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
more correct, but certainly this > > is not a simplification of the other code, it's a distinctly different > > validation. > > Okay, "simplified" isn't quite the right word. Given two examples (with > known deficiencies) and no actual use cases or specifications,

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 15:07:22 +1100, Chris Angelico wrote: > On Thu, 3 Feb 2022 at 14:52, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > > > On 2022-02-03 at 12:39:43 +1100, > > Cameron Simpson wrote: > > > > > You have: > > > > > > def _check_interval(self, interval): > > > if not type

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread Chris Angelico
On Thu, 3 Feb 2022 at 14:52, <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-02-03 at 12:39:43 +1100, > Cameron Simpson wrote: > > > You have: > > > > def _check_interval(self, interval): > > if not type(interval) in [int, float]: > > raise TypeError('{} is not nume

Re: Waht do you think about my repeated_timer class

2022-02-02 Thread 2QdxY4RzWzUUiLuE
On 2022-02-03 at 12:39:43 +1100, Cameron Simpson wrote: > You have: > > def _check_interval(self, interval): > if not type(interval) in [int, float]: > raise TypeError('{} is not numeric'.format(interval)) > > This check is better written: > > if not isinstance(inte

  1   2   3   4   5   6   7   8   9   10   >