Re: Question about garbage collection

2024-01-17 Thread Left Right via Python-list
So, here's some info about how to see what's going on with Python's memory allocation: https://docs.python.org/3/library/tracemalloc.html . I haven't looked into this in a long time, but it used to be the case that you needed to compile native modules (and probably Python itself?) so that instrumen

Re: Question about garbage collection

2024-01-16 Thread Frank Millman via Python-list
On 2024-01-17 3:01 AM, Greg Ewing via Python-list wrote: On 17/01/24 1:01 am, Frank Millman wrote: I sometimes need to keep a reference from a transient object to a more permanent structure in my app. To save myself the extra step of removing all these references when the transient object is de

Re: Question about garbage collection

2024-01-16 Thread Greg Ewing via Python-list
On 17/01/24 1:01 am, Frank Millman wrote: I sometimes need to keep a reference from a transient object to a more permanent structure in my app. To save myself the extra step of removing all these references when the transient object is deleted, I make them weak references. I don't see how wea

Re: Question about garbage collection

2024-01-16 Thread Greg Ewing via Python-list
On 17/01/24 4:00 am, Chris Angelico wrote: class Form: def __init__(self): self.elements = [] class Element: def __init__(self, form): self.form = form form.elements.append(self) If you make the reference from Element to Form a weak reference, it won't keep

Re: Question about garbage collection

2024-01-16 Thread Barry via Python-list
> On 16 Jan 2024, at 12:10, Frank Millman via Python-list > wrote: > > My problem is that my app is quite complex, and it is easy to leave a > reference dangling somewhere which prevents an object from being gc'd. What I do to track these problems down is use gc.get_objects() then summerize

Re: Question about garbage collection

2024-01-16 Thread Barry via Python-list
> On 16 Jan 2024, at 13:17, Thomas Passin via Python-list > wrote: > > The usual advice is to call deleteLater() on objects derived from PyQt > classes. I don't know enough about PyQt to know if this takes care of all > dangling reference problems, though. It works well and robustly. Bar

Re: Question about garbage collection

2024-01-16 Thread Chris Angelico via Python-list
On Wed, 17 Jan 2024 at 01:45, Frank Millman via Python-list wrote: > > On 2024-01-16 2:15 PM, Chris Angelico via Python-list wrote: > > > > Where do you tend to "leave a reference dangling somewhere"? How is > > this occurring? Is it a result of an incomplete transaction (like an > > HTTP request

Re: Question about garbage collection

2024-01-16 Thread Frank Millman via Python-list
On 2024-01-16 2:15 PM, Chris Angelico via Python-list wrote: Where do you tend to "leave a reference dangling somewhere"? How is this occurring? Is it a result of an incomplete transaction (like an HTTP request that never finishes), or a regular part of the operation of the server? I have a c

Re: Question about garbage collection

2024-01-16 Thread Thomas Passin via Python-list
On 1/16/2024 4:17 AM, Barry wrote: On 16 Jan 2024, at 03:49, Thomas Passin via Python-list wrote: This kind of thing can happen with PyQt, also. There are ways to minimize it but I don't know if you can ever be sure all Qt C++ objects will get deleted. It depends on the type of object an

Re: Question about garbage collection

2024-01-16 Thread Chris Angelico via Python-list
On Tue, 16 Jan 2024 at 23:08, Frank Millman via Python-list wrote: > > On 2024-01-15 3:51 PM, Frank Millman via Python-list wrote: > > Hi all > > > > I have read that one should not have to worry about garbage collection > > in modern versions of Python - it 'just works'. > > > > I don't want to r

Re: Question about garbage collection

2024-01-16 Thread Frank Millman via Python-list
On 2024-01-15 3:51 PM, Frank Millman via Python-list wrote: Hi all I have read that one should not have to worry about garbage collection in modern versions of Python - it 'just works'. I don't want to rely on that. My app is a long-running server, with multiple clients logging on, doing stu

Re: Question about garbage collection

2024-01-16 Thread Barry via Python-list
> On 16 Jan 2024, at 03:49, Thomas Passin via Python-list > wrote: > > This kind of thing can happen with PyQt, also. There are ways to minimize it > but I don't know if you can ever be sure all Qt C++ objects will get deleted. > It depends on the type of object and the circumstances. Whe

Re: Question about garbage collection

2024-01-15 Thread Thomas Passin via Python-list
On 1/15/2024 9:47 PM, Akkana Peck via Python-list wrote: I wrote: Also be warned that some modules (particularly if they're based on libraries not written in Python) might not garbage collect, so you may need to use other methods of cleaning up after those objects. Chris Angelico writes: Go

Re: Question about garbage collection

2024-01-15 Thread Chris Angelico via Python-list
On Tue, 16 Jan 2024 at 13:49, Akkana Peck via Python-list wrote: > > I wrote: > > > Also be warned that some modules (particularly if they're based on > > > libraries not written in Python) might not garbage collect, so you may > > > need to use other methods of cleaning up after those objects.

Re: Question about garbage collection

2024-01-15 Thread Akkana Peck via Python-list
I wrote: > > Also be warned that some modules (particularly if they're based on > > libraries not written in Python) might not garbage collect, so you may need > > to use other methods of cleaning up after those objects. Chris Angelico writes: > Got any examples of that? The big one for me was

Re: Question about garbage collection

2024-01-15 Thread Chris Angelico via Python-list
On Tue, 16 Jan 2024 at 06:32, Akkana Peck via Python-list wrote: > > > Frank Millman wrote at 2024-1-15 15:51 +0200: > > >I have read that one should not have to worry about garbage collection > > >in modern versions of Python - it 'just works'. > > Dieter Maurer via Python-list writes: > > There

Re: Question about garbage collection

2024-01-15 Thread Akkana Peck via Python-list
> Frank Millman wrote at 2024-1-15 15:51 +0200: > >I have read that one should not have to worry about garbage collection > >in modern versions of Python - it 'just works'. Dieter Maurer via Python-list writes: > There are still some isolated cases when not all objects > in an unreachable cycle a

Re: Question about garbage collection

2024-01-15 Thread Dieter Maurer via Python-list
Frank Millman wrote at 2024-1-15 15:51 +0200: >I have read that one should not have to worry about garbage collection >in modern versions of Python - it 'just works'. There are still some isolated cases when not all objects in an unreachable cycle are destroyed (see e.g. step 2 of "https://devgui

Re: Question about garbage collection

2024-01-15 Thread Skip Montanaro via Python-list
> I do have several circular references. My experience is that if I do not > take some action to break the references when closing the session, the > objects remain alive. Below is a very simple program to illustrate this. > > Am I missing something? All comments appreciated. Python has normal ref

Re: Question(s)

2023-10-27 Thread Greg Ewing via Python-list
On 25/10/23 2:32 pm, Chris Angelico wrote: Error correcting memory, redundant systems, and human monitoring, plus the ability to rewrite the guidance software on the fly if they needed to. Although the latter couldn't actually be done with the AGC, as the software was in ROM. They could poke va

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
On Behalf Of Thomas Passin via Python-list Sent: Thursday, October 26, 2023 6:50 PM To: python-list@python.org Subject: Re: Question(s) On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote: I am not one for IDLE worship, Tenor. But if you have been getting a message here, it is that there are

RE: Question(s)

2023-10-26 Thread AVI GROSS via Python-list
: Thursday, October 26, 2023 6:50 PM To: python-list@python.org Subject: Re: Question(s) On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote: > I am not one for IDLE worship, Tenor. But if you have been getting a message here, it is that there are an amazing number of programs that support your

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
On 10/26/2023 6:36 PM, AVI GROSS via Python-list wrote: I am not one for IDLE worship, Tenor. But if you have been getting a message here, it is that there are an amazing number of programs that support your use of python during the development phase and perhaps later. I actually often use an

RE: Question(s)

2023-10-26 Thread AVI GROSS via Python-list
. -Original Message- From: Python-list On Behalf Of o1bigtenor via Python-list Sent: Thursday, October 26, 2023 8:34 AM To: Michael Torrie Cc: python-list@python.org Subject: Re: Question(s) On Wed, Oct 25, 2023 at 10:19 AM Michael Torrie via Python-list wrote: > > On 10/25/23

Re: Question(s)

2023-10-26 Thread Dan Purgert via Python-list
On 2023-10-26, o1bigtenor wrote: > On Wed, Oct 25, 2023 at 10:19 AM Michael Torrie via Python-list > wrote: >> >> On 10/25/23 05:51, o1bigtenor via Python-list wrote: >> > Looks like I have another area to investigate. (grin!) >> > Any suggestions? >> >> Seems to me you're trying to run before you

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
On 10/26/2023 4:25 PM, o1bigtenor via Python-list wrote: On Thu, Oct 26, 2023 at 11:43 AM Michael Torrie via Python-list wrote: On 10/26/23 06:34, o1bigtenor wrote: Interesting - - - - ". . . see if it runs." - - - that's the issue! When the code is accessing sensors there isn't an easy way

Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Thu, Oct 26, 2023 at 11:47 AM Michael Torrie via Python-list wrote: > > On 10/26/23 10:41, Michael Torrie wrote: > > By the way you definitely can step > > through MicroPython code one line at a time with a remote debugger, say > > with Visual Studio Code. > > I meant to edit that bit out. Af

Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Thu, Oct 26, 2023 at 11:43 AM Michael Torrie via Python-list wrote: > > On 10/26/23 06:34, o1bigtenor wrote: > > Interesting - - - - ". . . see if it runs." - - - that's the issue! > > When the code is accessing sensors there isn't an easy way to > > check that the code is working until one ha

Re: Question(s)

2023-10-26 Thread Michael Torrie via Python-list
On 10/26/23 10:41, Michael Torrie wrote: > By the way you definitely can step > through MicroPython code one line at a time with a remote debugger, say > with Visual Studio Code. I meant to edit that bit out. After doing a bit more research, it appears remote debugging with MicroPython may not b

Re: Question(s)

2023-10-26 Thread Michael Torrie via Python-list
On 10/26/23 06:34, o1bigtenor wrote: > Interesting - - - - ". . . see if it runs." - - - that's the issue! > When the code is accessing sensors there isn't an easy way to > check that the code is working until one has done the all of the > physical construction. If I'm trying to control a pulsatio

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
On 10/26/2023 7:50 AM, o1bigtenor via Python-list wrote: On Wed, Oct 25, 2023 at 9:10 AM Dieter Maurer wrote: o1bigtenor wrote at 2023-10-25 08:29 -0500: ... It would appear that something has changed. Went to the Eclipse download page, downloaded and verified (using sha-512). Expanded softw

Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 3:56 PM Jim Schwartz wrote: > Does this link help? It seems to have a Linux package here. > > Eclipse Packages | The Eclipse Foundation - home to a global community, > the Eclipse IDE, Jakarta EE and over 350 open source projects... >

Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 11:58 AM Michael F. Stemper via Python-list wrote: > > On 25/10/2023 05.45, o1bigtenor wrote: > > On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list > > wrote: > > >> 3. Catch the failure before you commit and push. Unit tests are great for > >> this. > > > >

Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 10:19 AM Michael Torrie via Python-list wrote: > > On 10/25/23 05:51, o1bigtenor via Python-list wrote: > > Looks like I have another area to investigate. (grin!) > > Any suggestions? > > Seems to me you're trying to run before you have learned to walk. > > Slow down, go to

Re: Question(s)

2023-10-26 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 9:10 AM Dieter Maurer wrote: > > o1bigtenor wrote at 2023-10-25 08:29 -0500: > > ... > >It would appear that something has changed. > > > >Went to the Eclipse download page, downloaded and verified (using sha-512). > >Expanded software to # opt . > >There is absolutely NO m

RE: Question(s)

2023-10-25 Thread AVI GROSS via Python-list
python.org Subject: Re: Question(s) On 24/10/2023 18.15, o1bigtenor wrote: > What is interesting about this is the absolute certainty that it is impossible > to program so that that program is provably correct. Not entirely true. If I was to write a program to calculate Fibonacci numbe

Re: Question(s)

2023-10-25 Thread Jim Schwartz via Python-list
Does this link help? It seems to have a Linux package here. [1]Eclipse Packages | The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and [2]favicon.ico over 350 open source projects... eclipse.org Sent from my iPhone On Oct 25, 2023

Re: Question(s)

2023-10-25 Thread Dan Purgert via Python-list
On 2023-10-25, o1bigtenor wrote: > On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer wrote: >> [...] >> There are several others, >> e.g. "ECLIPSE" can be used for Python development. > > Is 'Eclipse' a Windows oriented IDE? > (Having a hard time finding linux related information on the > website.)

Re: Question(s)

2023-10-25 Thread Thomas Passin via Python-list
On 10/25/2023 9:20 AM, Michael F. Stemper via Python-list wrote: On 24/10/2023 17.50, Thomas Passin wrote:    The programming team for the Apollo moon mission developed a system which,> if you would write your requirements in a certain way, could generate correct C code for them. Since the l

Re: Question(s)

2023-10-25 Thread Thomas Passin via Python-list
On 10/25/2023 8:50 AM, o1bigtenor via Python-list wrote: On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer wrote: o1bigtenor wrote at 2023-10-25 06:44 -0500: On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer wrote: ... There are different kinds of errors. Some can be avoided by using an integrated

Re: Question(s)

2023-10-25 Thread Alan Gauld via Python-list
On 25/10/2023 12:44, o1bigtenor via Python-list wrote: > Haven't heard of a python IDE - - - doesn't mean that there isn't such - - There are literally dozens with varying degrees of smartness. The big 4 all have Python plugins/environments: Eclipse, Netbeans, VisualStudio, IntelliJ And of cours

Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list
On 25/10/2023 05.45, o1bigtenor wrote: On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list wrote: 3. Catch the failure before you commit and push. Unit tests are great for this. Where might I find such please. You don't "find" unit tests; you write them. A unit test tests a spe

RE: Question(s)

2023-10-25 Thread AVI GROSS via Python-list
ything, what do developers using Python do to try to make sure they get properly paid and others do not just use their work without permission? -Original Message- From: o1bigtenor Sent: Wednesday, October 25, 2023 6:59 AM To: avi.e.gr...@gmail.com Cc: Chris Angelico ; python-list@python.

Re: Question(s)

2023-10-25 Thread Michael Torrie via Python-list
On 10/25/23 05:51, o1bigtenor via Python-list wrote: > Looks like I have another area to investigate. (grin!) > Any suggestions? Seems to me you're trying to run before you have learned to walk. Slow down, go to the beginning and just learn python, write some code, see if it runs. Go through the

Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list
On 24/10/2023 18.15, o1bigtenor wrote: What is interesting about this is the absolute certainty that it is impossible to program so that that program is provably correct. Not entirely true. If I was to write a program to calculate Fibonacci numbers, or echo back user input, that program could

Re: Question(s)

2023-10-25 Thread Michael F. Stemper via Python-list
On 24/10/2023 17.50, Thomas Passin wrote: The programming team for the Apollo moon mission developed a system which,> if you would write your requirements in a certain way, could generate correct C code for them. Since the last Apollo mission was in 1972, when C was first being developed,

Re: Question(s)

2023-10-25 Thread Dan Purgert via Python-list
On 2023-10-24, o1bigtenor wrote: > On Tue, Oct 24, 2023 at 5:28 PM Rob Cliffe wrote: >> >> There is no general way to prove that a program is "correct". Or even >> whether it will terminate or loop endlessly. >> [...] >> When you come to run your program "for real", and you have to >> troubleshoo

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 08:29 -0500: > ... >It would appear that something has changed. > >Went to the Eclipse download page, downloaded and verified (using sha-512). >Expanded software to # opt . >There is absolutely NO mention of anything python - - - java, c and >its permutations, >'scien

Re: Question(s)

2023-10-25 Thread Thomas Passin via Python-list
On 10/25/2023 9:21 AM, Thomas Passin wrote: On 10/25/2023 8:50 AM, o1bigtenor via Python-list wrote: On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer wrote: o1bigtenor wrote at 2023-10-25 06:44 -0500: On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer wrote: ... There are different kinds of error

Re: Question(s)

2023-10-25 Thread Grant Edwards via Python-list
On 2023-10-25, o1bigtenor via Python-list wrote: > Haven't heard of a python IDE - - - doesn't mean that there isn't such - - > just that I haven't heard of such. Is there a python IDE? Seriously? Now you're just trolling. google.com/search?q=python+ide&oq=python+ide -- Grant -- https://mail

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 7:56 AM Dieter Maurer wrote: > > o1bigtenor wrote at 2023-10-25 07:50 -0500: > >> There are several others, > >> e.g. "ECLIPSE" can be used for Python development. > > > >Is 'Eclipse' a Windows oriented IDE? > > No. > ==> "https://en.wikipedia.org/wiki/Eclipse_(software)"

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 07:50 -0500: >> There are several others, >> e.g. "ECLIPSE" can be used for Python development. > >Is 'Eclipse' a Windows oriented IDE? No. ==> "https://en.wikipedia.org/wiki/Eclipse_(software)" -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 7:00 AM Dieter Maurer wrote: > > o1bigtenor wrote at 2023-10-25 06:44 -0500: > >On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer wrote: > > ... > >> There are different kinds of errors. > >> > >> Some can be avoided by using an integrated development environment > >> (e.g. mi

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-25 06:44 -0500: >On Wed, Oct 25, 2023 at 6:24?AM Dieter Maurer wrote: > ... >> There are different kinds of errors. >> >> Some can be avoided by using an integrated development environment >> (e.g. misspellings, type mismatches, ...). > >Haven't heard of a python IDE -

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 6:20 AM Chris Angelico via Python-list wrote: > > On Wed, 25 Oct 2023 at 21:46, o1bigtenor wrote: > > > 2. Catch the failure as you save. We have a lot of tools that can help > > > you to spot bugs. > > > > Tools like this for python please. > > Various ones. Type checkers

Re: Question(s)

2023-10-25 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 22:46, o1bigtenor via Python-list wrote: > > On Wed, Oct 25, 2023 at 6:24 AM Dieter Maurer wrote: > > > > o1bigtenor wrote at 2023-10-24 07:22 -0500: > > > ... > > >Is there a way to verify that a program is going to do what it is > > >supposed to do even > > >before all th

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 6:24 AM Dieter Maurer wrote: > > o1bigtenor wrote at 2023-10-24 07:22 -0500: > > ... > >Is there a way to verify that a program is going to do what it is > >supposed to do even > >before all the hardware has been assembled and installed and tested? > > Others have already n

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Wed, Oct 25, 2023 at 6:25 AM Chris Angelico via Python-list wrote: > > On Wed, 25 Oct 2023 at 21:53, o1bigtenor wrote: > > > > Hmm - - - - now how can I combine 'Hamming codes' > > and a raid array? > > > > TIA > > Normally you wouldn't. But let's say you're worried that a file might >

Re: Question(s)

2023-10-25 Thread Dieter Maurer via Python-list
o1bigtenor wrote at 2023-10-24 07:22 -0500: > ... >Is there a way to verify that a program is going to do what it is >supposed to do even >before all the hardware has been assembled and installed and tested? Others have already noted that "verify" is a very strong aim. There are different kinds o

Re: Question(s)

2023-10-25 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 21:53, o1bigtenor wrote: > > Hmm - - - - now how can I combine 'Hamming codes' > and a raid array? > > TIA Normally you wouldn't. But let's say you're worried that a file might get randomly damaged. (I don't think single-bit errors are really a significant issue wit

Re: Question(s)

2023-10-25 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 21:46, o1bigtenor wrote: > > 2. Catch the failure as you save. We have a lot of tools that can help > > you to spot bugs. > > Tools like this for python please. Various ones. Type checkers like MyPy fall into this category if you set your system up to run them when you save

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 9:36 PM AVI GROSS via Python-list wrote: > > Agreed, Chris. There are many methods way better than the sort of RAID > architecture I supplied as AN EXAMPLE easy to understand. But even so, if a > hard disk or memory chip is fried or a nuclear bomb takes out all servers in >

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 8:43 PM Chris Angelico via Python-list wrote: > > On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list > wrote: > > Consider an example of bit rot. I mean what if your CPU or hard disk has a > > location where you can write a byte and read it back multiple times and >

Re: Question(s)

2023-10-25 Thread o1bigtenor via Python-list
A post with useful ideas - - - - thanks (it generates some questions! interleaved) On Tue, Oct 24, 2023 at 8:35 PM Chris Angelico via Python-list wrote: > > On Wed, 25 Oct 2023 at 12:11, Thomas Passin via Python-list > wrote: > > This doesn't mean that no program can ever be proven to halt, nor

Re: Question(s)

2023-10-24 Thread Thomas Passin via Python-list
On 10/24/2023 7:37 PM, Grant Edwards via Python-list wrote: On 2023-10-24, Thomas Passin via Python-list wrote: Something less ambitious than a full proof of correctness of an arbitrary program can sometimes be achieved. The programming team for the Apollo moon mission developed a system whic

RE: Question(s)

2023-10-24 Thread AVI GROSS via Python-list
, 2023 9:41 PM To: python-list@python.org Subject: Re: Question(s) On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list wrote: > Consider an example of bit rot. I mean what if your CPU or hard disk has a location where you can write a byte and read it back multiple times and sometimes get the wr

Re: Question(s)

2023-10-24 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 12:20, AVI GROSS via Python-list wrote: > Consider an example of bit rot. I mean what if your CPU or hard disk has a > location where you can write a byte and read it back multiple times and > sometimes get the wrong result. To be really cautions, you might need your > so

Re: Question(s)

2023-10-24 Thread Chris Angelico via Python-list
On Wed, 25 Oct 2023 at 12:11, Thomas Passin via Python-list wrote: > This doesn't mean that no program can ever be proven to halt, nor that > no program can never be proven correct by formal means. Will your > program be one of those? The answer may never come ... Indeed, and I would go further

RE: Question(s)

2023-10-24 Thread AVI GROSS via Python-list
rg Subject: Re: Question(s) On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list wrote: > snip > > By now you have read many responses that basically say that you cannot > prove that a given program has no errors, even apart from the hardware > question. Even if it c

Re: Question(s)

2023-10-24 Thread Thomas Passin via Python-list
On 10/24/2023 7:15 PM, o1bigtenor wrote: On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list wrote: snip By now you have read many responses that basically say that you cannot prove that a given program has no errors, even apart from the hardware question. Even if it could be don

Re: Question(s)

2023-10-24 Thread Alan Gauld via Python-list
On 25/10/2023 00:08, o1bigtenor via Python-list wrote: > So how does one test software then? Testing is very different to proving! As an industry we do a lot of testing at many different levels. On bigger projects you'll find: - Unit tests - testing small fragments of a bigger program - Integrati

Re: Question(s)

2023-10-24 Thread Alan Gauld via Python-list
On 24/10/2023 22:51, Grant Edwards via Python-list wrote: >>> Is there a way to verify that a program is going to do what it is >>> supposed to do even before all the hardware has been assembled and >>> installed and tested? > And the specified customer requirements are usually wrong too. Sure, >

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, o1bigtenor via Python-list wrote: > So how does one test software then? That's what customers are for! [Actually, that's true more often than it should be.] -- https://mail.python.org/mailman/listinfo/python-list

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, Thomas Passin via Python-list wrote: > Something less ambitious than a full proof of correctness of an > arbitrary program can sometimes be achieved. The programming team > for the Apollo moon mission developed a system which, if you would > write your requirements in a certain wa

Re: Question(s)

2023-10-24 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 6:09 PM Thomas Passin via Python-list wrote: > snip > > By now you have read many responses that basically say that you cannot > prove that a given program has no errors, even apart from the hardware > question. Even if it could be done, the kind of specification that you

Re: Question(s)

2023-10-24 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 5:28 PM Rob Cliffe wrote: > > There is no general way to prove that a program is "correct". Or even > whether it will terminate or loop endlessly. > These are of course theoretical statements of computer science. But > they can be rigorously proven. (Sorry if I'm just sa

Re: Question(s)

2023-10-24 Thread Thomas Passin via Python-list
On 10/24/2023 8:22 AM, o1bigtenor via Python-list wrote: Greetings (Sorry for a nebulous subject but dunno how to have a short title for a complex question.) I have been using computers for a long time but am only beginning my foray into the galaxy of programming. Have done little to this point

Re: Question(s)

2023-10-24 Thread o1bigtenor via Python-list
On Tue, Oct 24, 2023 at 4:54 PM Grant Edwards via Python-list wrote: > > On 2023-10-24, Dan Purgert via Python-list wrote: > > On 2023-10-24, o1bigtenor wrote: > >> Greetings > >> > >> (Sorry for a nebulous subject but dunno how to have a short title for > >> a complex question.) > >> [...] > >>

Re: Question(s)

2023-10-24 Thread Barry via Python-list
> On 24 Oct 2023, at 18:25, o1bigtenor via Python-list > wrote: > > Is there a way to verify that a program is going to do what it is > supposed to do In the general case not proven to be not possible. Have a read about the halting problem https://en.wikipedia.org/wiki/Halting_problem It i

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, Dan Purgert via Python-list wrote: > On 2023-10-24, o1bigtenor wrote: >> Greetings >> >> (Sorry for a nebulous subject but dunno how to have a short title for >> a complex question.) >> [...] >> Is there a way to verify that a program is going to do what it is >> supposed to do even

Re: Question(s)

2023-10-24 Thread Dan Purgert via Python-list
On 2023-10-24, o1bigtenor wrote: > Greetings > > (Sorry for a nebulous subject but dunno how to have a short title for > a complex question.) > [...] > Is there a way to verify that a program is going to do what it is > supposed to do even > before all the hardware has been assembled and installed

Re: Question(s)

2023-10-24 Thread Grant Edwards via Python-list
On 2023-10-24, o1bigtenor via Python-list wrote: > Is there a way to verify that a program is going to do what it is > supposed to do even before all the hardware has been assembled and > installed and tested? It depends on what you mean by "verify ...". If you want to prove a program correct (

Re: Question(s)

2023-10-24 Thread Dom Grigonis via Python-list
I don’t think there i a simple answer to this, although if you find something interesting, please share. From my experience, industry is applying variety of testing methods. Starting from lowest level components and implementing unit tests, finishing with end-to-end testing platforms. https://

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-26 Thread Mark Bourne
Lorenzo Catoni wrote: Dear Python Mailing List members, I am writing to seek your assistance in understanding an unexpected behavior that I encountered while using the __enter__ method. I have provided a code snippet below to illustrate the problem: ``` class X: ... __enter__ = int ...

RE: Question regarding unexpected behavior in using __enter__ method

2023-04-25 Thread avi.e.gross
knowing there will be a first argument. Avi -Original Message- From: Python-list On Behalf Of Rob Cliffe via Python-list Sent: Saturday, April 22, 2023 9:56 AM To: Lorenzo Catoni ; python-list@python.org Subject: Re: Question regarding unexpected behavior in using __enter__ method Thi

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-25 Thread Rob Cliffe via Python-list
This puzzled me at first, but I think others have nailed it.  It is not to do with the 'with' statement, but with the way functions are defined. When a class is instantiated, as in x=X():     the instance object gets (at least in effect), as attributes, copies of functions defined *in the class*

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-21 Thread aapost
On 4/20/23 18:44, Lorenzo Catoni wrote: Here, the TypeError occurred because "self" was passed as an input Instantiate X and observe it there x2 = X() >>> X.__enter__ >>> X.__exit__ at 0x...> >>> x2.__enter__ >>> x2.__exit__ of <__main__.X object at 0x...>> To receive self the method mu

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-21 Thread Lorenzo Catoni
Thankyou for your answer, i think i found the reason for this behavior, is has to do with the function being user defined or not, rather than being a plain function or type, as stated here https://docs.python.org/3/reference/datamodel.html#:~:text=Also%20notice%20that%20this%20transformation%20only

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-21 Thread Peter Otten
On 21/04/2023 00:44, Lorenzo Catoni wrote: Dear Python Mailing List members, I am writing to seek your assistance in understanding an unexpected behavior that I encountered while using the __enter__ method. I have provided a code snippet below to illustrate the problem: ``` class X: ... _

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-20 Thread Cameron Simpson
On 21Apr2023 00:44, Lorenzo Catoni wrote: I am writing to seek your assistance in understanding an unexpected behavior that I encountered while using the __enter__ method. I have provided a code snippet below to illustrate the problem: ``` class X: ... __enter__ = int ... __exit__ = l

Re: Question regarding unexpected behavior in using __enter__ method

2023-04-20 Thread dn via Python-list
On 21/04/2023 10.44, Lorenzo Catoni wrote: I am writing to seek your assistance in understanding an unexpected behavior that I encountered while using the __enter__ method. I have provided a code snippet below to illustrate the problem: It is expected behavior - just not what WE might have expe

Re: Question about logging.config.dictConfig

2023-02-08 Thread Ivan "Rambius" Ivanov
On Tue, Feb 7, 2023 at 7:35 PM Peter J. Holzer wrote: > > On 2023-02-07 17:58:26 -0500, Ivan "Rambius" Ivanov wrote: > > I am trying to configure my loggers using dictConfig, but they do not > > print anything. Here are more details. > [...] > > from myloggingconf import configure_logging > > > >

Re: Question about logging.config.dictConfig

2023-02-07 Thread Peter J. Holzer
On 2023-02-07 17:58:26 -0500, Ivan "Rambius" Ivanov wrote: > I am trying to configure my loggers using dictConfig, but they do not > print anything. Here are more details. [...] > from myloggingconf import configure_logging > > logger = logging.getLogger(os.path.basename(__file__)) [...] > > def

Re: Question.

2023-01-08 Thread Thomas Passin
On 1/8/2023 7:54 AM, Angitolol36 wrote: Hello, i installed phyton in Windows 10 22H2 and i can’t find the program. I used the repair that doesnt work. This is as if you had said "I bought a car and it doesn't work". Please tell us what you did and noticed that caused you to say "i can

Re: Question.

2023-01-08 Thread Barry
> On 8 Jan 2023, at 21:20, Angitolol36 wrote: > >  Hello, i installed phyton in Windows 10 22H2 and i can’t find the program. > I used the repair that doesnt work. Does this help? https://docs.python.org/3/using/windows.html Barry > > > > > > Enviado desde [1]Correo para W

Re: Question about learning Python

2022-09-09 Thread Chris Angelico
On Sat, 10 Sept 2022 at 06:45, Dennis Lee Bieber wrote: > > On Thu, 8 Sep 2022 07:42:19 +1200, dn > declaimed the following: > > >TSRs? Now that was an ugly period of history! (trying to make a > >single-process operating system do multi-processing - only to find that > >many program[me]s assumed

Re: Question about learning Python

2022-09-09 Thread Chris Angelico
On Sat, 10 Sept 2022 at 06:38, Greg Ewing wrote: > > On 8/09/22 6:57 am, Chris Angelico wrote: > > Not as detrimental as starting with BASIC, and then moving on to x86 > > assembly language, and trying to massage the two together using CALL > > ABSOLUTE in order to get mouse input in your GW-BASIC

Re: Question about learning Python

2022-09-09 Thread Dennis Lee Bieber
On Thu, 8 Sep 2022 07:42:19 +1200, dn declaimed the following: >TSRs? Now that was an ugly period of history! (trying to make a >single-process operating system do multi-processing - only to find that >many program[me]s assumed they had full use and undisputed control of >the computer. Happy days

Re: Question about learning Python

2022-09-09 Thread Meredith Montgomery
writes: > Maybe we should ask WHY the person asking the question about how to learn a > computer language called Python is pairing it with the idea of whether to > also learn C. Excellent point! -- https://mail.python.org/mailman/listinfo/python-list

Re: Question about learning Python

2022-09-09 Thread Greg Ewing
On 8/09/22 6:57 am, Chris Angelico wrote: Not as detrimental as starting with BASIC, and then moving on to x86 assembly language, and trying to massage the two together using CALL ABSOLUTE in order to get mouse input in your GW-BASIC programs. Or starting with hand-assembled SC/MP machine code

  1   2   3   4   5   6   7   8   9   10   >