On Sat, Sep 11, 2021 at 3:26 PM dn via Python-list
wrote:
>
> On 31/08/2021 01.50, Chris Angelico wrote:
> > On Mon, Aug 30, 2021 at 11:13 PM David Raymond
> > wrote:
> >>
> >>> def how_many_times():
> >>> x, y = 0, 1
> >>> c = 0
> >>> while x != y:
> >>> c = c + 1
> >>> x, y = rol
On 31/08/2021 01.50, Chris Angelico wrote:
> On Mon, Aug 30, 2021 at 11:13 PM David Raymond
> wrote:
>>
>>> def how_many_times():
>>> x, y = 0, 1
>>> c = 0
>>> while x != y:
>>> c = c + 1
>>> x, y = roll()
>>> return c, (x, y)
>>
>> Since I haven't seen it used in answers yet, her
2qdxy4rzwzuui...@potatochowder.com writes:
> On 2021-09-10 at 15:08:19 -0600,
> Joe Pfeiffer wrote:
>
>> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>
>> > The existence of statements like "break" renders
>> > proof techniques for loops (such as Hoare's) with
>> > their invariants and inf
On 9/10/2021 7:38 AM, Alan Gauld via Python-list wrote:
But python complicates this tenet still further by adding an else
clause to its loops. And complicating this still more is that these
else clauses have almost exactly opposite effects.
To the contrary...
if...else
executes the else part
On Saturday, September 11, 2021 at 7:43:44 AM UTC+8, hongy...@gmail.com wrote:
> On Friday, September 10, 2021 at 2:12:31 PM UTC+8, Roland Mueller wrote:
> > pe 10. syysk. 2021 klo 8.53 hongy...@gmail.com (hongy...@gmail.com)
> > kirjoitti:
> > > On Thursday, September 9, 2021 at 8:57:37 PM UTC+
On Friday, September 10, 2021 at 2:12:31 PM UTC+8, Roland Mueller wrote:
> pe 10. syysk. 2021 klo 8.53 hongy...@gmail.com (hongy...@gmail.com)
> kirjoitti:
> > On Thursday, September 9, 2021 at 8:57:37 PM UTC+8, Roland Mueller wrote:
> > > Hello
> > >
> > > to 9. syysk. 2021 klo 6.53 hongy...@g
On 2021-09-10 at 15:08:19 -0600,
Joe Pfeiffer wrote:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
> > The existence of statements like "break" renders
> > proof techniques for loops (such as Hoare's) with
> > their invariants and inference rules unapplicable.
>
> Also the reason to avo
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
--
https://mail.python.org/mailman/listinfo/python-list
In this discussion, I shudder to mention that people often simply use all kinds
of additional logic to get a result. How much code have you seen that has some
variable like "completed = False" that can be set to True in multiple places
and many areas inside the loop are enclosed in an IF stateme
So why use the word "else" when it really does not mean what users consider
else?
Again, we have words like "finally" used in some places to mean it should be
done no matter what, like closing a file that may be open.
What phrase used either in one or all contexts might have been better, if
longe
r...@zedat.fu-berlin.de (Stefan Ram) writes:
> r...@zedat.fu-berlin.de (Stefan Ram) writes:
>>can be misleading, because the "..." part can still contain
>>"break", "raise", "continue", and "return" statement. So one
>>better should always be on the watch when reading source code
>>of a language l
pe 10. syysk. 2021 klo 17.22 Greg Ewing (greg.ew...@canterbury.ac.nz)
kirjoitti:
> On 10/09/21 6:11 pm, Roland Mueller wrote:
> > When I call print(s) it even shows ABCD and D is underscored. But
> copying
> > the output to mail looses the underscore ...
>
> If the terminal understands unicode, C
On 10/09/2021 16:36, MRAB wrote:
>> while...else...
>>
>> executes the else if the body of the loop does NOT get executed.
>>
>> for...else...
>>
>> executes the else iff ALL iterations of the for loop DO complete.
>>
> [snip]
>
> In both cases, it executes the 'else' part if it didn't break out
On 2021-09-10 12:38, Alan Gauld via Python-list wrote:
On 09/09/2021 22:36, dn via Python-list wrote:
Even in fairly modest Python constructs, we quickly repeal the one-in,
one-out philosophy because try...except operates by providing another
exit-path.
Exceptions are exceptional by their nat
On 10/09/2021 00:47, Terry Reedy wrote:
> even one loop is guaranteed.) "do-while" or "repeat-until is even rarer
> since fractional-loop include this as a special case.
Is there any empirical evidence to support this?
Or is it just a case of using the tools that are available?
In my experience
George Fischhof writes:
> George Fischhof ezt írta (időpont: 2021. aug. 29., V,
> 21:27):
>
>>
>>
>> Loris Bennett ezt írta (időpont: 2021. aug.
>> 26., Cs, 16:02):
>>
>>> George Fischhof writes:
>>>
>>> [snip (79 lines)]
>>>
>>> >> > Hi,
>>> >> >
>>> >> > Also you can give a try to click and
On 10/09/21 6:11 pm, Roland Mueller wrote:
When I call print(s) it even shows ABCD and D is underscored. But copying
the output to mail looses the underscore ...
If the terminal understands unicode, Combining Low Line: U+0332
might help
--
Greg
--
https://mail.python.org/mailman/listinfo/pyth
On 09/09/2021 22:36, dn via Python-list wrote:
> Even in fairly modest Python constructs, we quickly repeal the one-in,
> one-out philosophy because try...except operates by providing another
> exit-path.
Exceptions are exceptional by their nature (or should be!) As such
they can arguably be excu
On 10/09/21 11:47 am, Terry Reedy wrote:
2. It is rare useful. For loops are common. While loops are occasional
(nearly an order of magnitude less common than for loops. Fractional
loop constructs are rare.
I would say that fractional loops are more common than loops
which truly need to exe
19 matches
Mail list logo