Neal Becker wrote:
but it does violate the principle "Exceptions should
be used for exceptional conditions).
Python doesn't really go in for that philosophy.
Exceptions are often used for flow control, e.g.
StopIteration.
--
Greg
--
https://mail.python.org/mailman/listinfo/python-list
On 2018-09-26 21:06, Mark Lawrence wrote:
>
> To me the Ned Batchelder presentation
> https://www.youtube.com/watch?v=EnSu9hHGq5o "Loop like a Native" is the
> definitive way on how to deal with loops in Python.
>
Hear, hear.
Great talk.
--
https://mail.python.org/mailman/listinfo/python-list
Christian Gollwitzer wrote:
> Am 26.09.18 um 12:28 schrieb Bart:
>> On 26/09/2018 10:10, Peter Otten wrote:
>>> class Break(Exception):
>>> pass
>>>
>>> try:
>>> for i in range(10):
>>> print(f'i: {i}')
>>> for j in range(10):
>>> print(f'\tj: {j}')
>>> for k in range(10):
>>> print(f'\t\tk: {k}')
Am 26.09.18 um 12:28 schrieb Bart:
On 26/09/2018 10:10, Peter Otten wrote:
class Break(Exception):
pass
try:
for i in range(10):
print(f'i: {i}')
for j in range(10):
print(f'\tj: {j}')
for k in range(10):
On Wednesday, September 26, 2018 at 12:50:20 AM UTC-7, vito.d...@gmail.com
wrote:
> I have "abused" the "else" clause of the loops to makes a break "broke" more
> loops
I did this once upon a time. In recent years, when I start writing tricky
nested loops, I frequently find myself reaching fo
On 26/09/18 08:50, vito.detul...@gmail.com wrote:
Hi
Today I've added a couple of lines in my source code, and I'm very ashamed of
it.
it "runs", and I know what it does (for now), but it's "too clever".
I have "abused" the "else" clause of the loops to makes a break "broke" more
loops
f
vito.detul...@gmail.com wrote:
> Hi
> Today I've added a couple of lines in my source code, and I'm very ashamed
> of it. it "runs", and I know what it does (for now), but it's "too
> clever". I have "abused" the "else" clause of the loops to makes a break
> "broke" more loops
>
>
> for i in
On Wed, Sep 26, 2018 at 5:56 PM wrote:
>
> Hi
> Today I've added a couple of lines in my source code, and I'm very ashamed of
> it.
> it "runs", and I know what it does (for now), but it's "too clever".
> I have "abused" the "else" clause of the loops to makes a break "broke" more
> loops
>
>
>
Hi
Today I've added a couple of lines in my source code, and I'm very ashamed of
it.
it "runs", and I know what it does (for now), but it's "too clever".
I have "abused" the "else" clause of the loops to makes a break "broke" more
loops
for i in range(10):
print(f'i: {i}')
f