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

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

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

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

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

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.

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

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

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

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

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.

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:

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

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

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

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

Re: Question(s)

2023-10-26 Thread Thomas Passin via Python-list
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 an amazing number

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
on. -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.

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

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

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

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

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

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

RE: Question(s)

2023-10-25 Thread AVI GROSS via Python-list
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 numbers, or ech

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,

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

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

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

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

RE: Question(s)

2023-10-25 Thread AVI GROSS via Python-list
g, 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.org S

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

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

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 >>

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,

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

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=python+ide -- Grant --

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.

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

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

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

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

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

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

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

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 >

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

RE: Question(s)

2023-10-24 Thread AVI GROSS via Python-list
: 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 could be

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

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 -

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

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

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

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

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

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.

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
ans 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

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

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

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

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__ =

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

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

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

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

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

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

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   >