RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
I think I already agreed with much of your point. That is indeed the problem. You are allowed to do some possibly non-standard things. A static evaluation/replacement may show the wrong function being called and a dynamic one may still mess up as there are many ways to do indirection. I mention th

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Richard Damon
On 9/7/21 3:51 PM, Avi Gross via Python-list wrote: > and similarly changes any function imported directly > to also be fully qualified. One danger with this is that it can actual change the behavior of the program. Maybe more likely with global objects than functions, but still an issue. Remembe

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
Greg, Yes, a smart person may come up with such tricks but a really smart person, in my view, adjusts. With some exceptions, such as when trying to port existing code to a new language quickly, someone who is not too obsessive will try to pick up the goals and spirit of a new language and use them

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Greg Ewing
On 8/09/21 2:53 am, Grant Edwards wrote: #define IF if ( #define THEN ) { #define ELSE } else { #define ENDIF } ... I gather that early versions of some of the Unix utilities were written by someone who liked using macros to make C resemble Algol. I guess you can get away with t

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Alan Gauld via Python-list
On 07/09/2021 15:53, Grant Edwards wrote: > I remember engineering manager I worked with about 35 years ago who > used a set of C macros to try to make his code look as much like BASIC > as possible: > > #define IF if ( > #define THEN ) { > #define ELSE } else { > #define ENDIF } > ...

[RELEASE] Python 3.10.0rc2 is available

2021-09-07 Thread Pablo Galindo Salgado
Python 3.10 is one month away, can you believe it? This snake is still trying to bite as it has been an interesting day of fighting fires, release blockers, and a bunch of late bugs but your friendly release team always delivers :) You can get this new release while is still fresh here: https://w

Re: on floating-point numbers

2021-09-07 Thread Joe Pfeiffer
Hope Rouselle writes: > Christian Gollwitzer writes: >> >> I believe it is not commutativity, but associativity, that is >> violated. > > Shall we take this seriously? (I will disagree, but that doesn't mean I > am not grateful for your post. Quite the contary.) It in general > violates assoc

RE: on writing a while loop for rolling two dice

2021-09-07 Thread Avi Gross via Python-list
Although I sort of agree with Alister, I also note that many languages deliberately provide you with the means to customize in ways that make your personal life more amenable while making it perhaps harder for others. Consider the humble import statement frequently used as: import numpy as np imp

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Dennis Lee Bieber
On Tue, 7 Sep 2021 16:08:04 +1200, Greg Ewing declaimed the following: >On 7/09/21 11:38 am, Avi Gross wrote: > >> #define INDEFINITELY_LOOP while (true) >> >> So, how to do something like that in python, is a challenge left to the user >> ? > >def hell_frozen_over(): > return False > >whil

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Hope Rouselle
Grant Edwards writes: > On 2021-09-06, Stefan Ram wrote: >> "Avi Gross" writes: >>> In languages like C/C++ there are people who make up macros like: >>>#define INDEFINITELY_LOOP while (true) >>>Or something like that and then allow the preprocessor to replace >>>INDEFINITELY_LOOP with valid C

Re: on writing a while loop for rolling two dice

2021-09-07 Thread alister via Python-list
On Tue, 07 Sep 2021 14:53:29 +, Grant Edwards wrote: > On 2021-09-06, Stefan Ram wrote: >> "Avi Gross" writes: >>> In languages like C/C++ there are people who make up macros like: >>>#define INDEFINITELY_LOOP while (true) >>>Or something like that and then allow the preprocessor to replace

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Grant Edwards
On 2021-09-06, Stefan Ram wrote: > "Avi Gross" writes: >> In languages like C/C++ there are people who make up macros like: >>#define INDEFINITELY_LOOP while (true) >>Or something like that and then allow the preprocessor to replace >>INDEFINITELY_LOOP with valid C code. > > Those usually are

Re: on writing a while loop for rolling two dice

2021-09-07 Thread Greg Ewing
On 7/09/21 11:38 am, Avi Gross wrote: #define INDEFINITELY_LOOP while (true) So, how to do something like that in python, is a challenge left to the user 😉 def hell_frozen_over(): return False while not hell_frozen_over(): -- Greg -- https://mail.python.org/mailman/listinfo/py