Re: for -- else: what was the motivation?

2022-10-08 Thread Chris Angelico
On Sun, 9 Oct 2022 at 16:05, Axy via Python-list wrote: > > > On 09/10/2022 05:47, Chris Angelico wrote: > > On Sun, 9 Oct 2022 at 15:39, Axy via Python-list > > wrote: > >> Got it, thanks! > >> > >> Actually the reason I never used "else" was the violation of the rule of > >> beauty "shortest

Re: for -- else: what was the motivation?

2022-10-08 Thread Axy via Python-list
On 09/10/2022 05:47, Chris Angelico wrote: On Sun, 9 Oct 2022 at 15:39, Axy via Python-list wrote: Got it, thanks! Actually the reason I never used "else" was the violation of the rule of beauty "shortest block first". With if--else you can easily follow this rule by inverting "if"

Re: for -- else: what was the motivation?

2022-10-08 Thread Chris Angelico
On Sun, 9 Oct 2022 at 15:39, Axy via Python-list wrote: > > Got it, thanks! > > Actually the reason I never used "else" was the violation of the rule of > beauty "shortest block first". With if--else you can easily follow this > rule by inverting "if" expression, but with for--else you can't. The

Re: for -- else: what was the motivation?

2022-10-08 Thread Axy via Python-list
Got it, thanks! Actually the reason I never used "else" was the violation of the rule of beauty "shortest block first". With if--else you can easily follow this rule by inverting "if" expression, but with for--else you can't. The loop body of the simplest example is already three lines, in

Re: Polot severa figures inside a for loopin

2022-10-08 Thread Cameron Simpson
On 08Oct2022 16:22, "Jorge Conrado Conforte" wrote: I already use the IDL to plot data. Inside a for looping I plot and save my data and kill the window using the wdelete IDL command for close the window automatically. Now I'm using the Python to rea several netcdf 2d data. I plot my data and

Re: TkSheet

2022-10-08 Thread Michael F. Stemper
On 08/10/2022 07.58, Benny Rieger wrote: What a great work;-) I need a solution for save my tabel as csv. How to do that? Has someone a solution for that? Is this what you're seeking? -- Michael F. Stemper No animals

Re: for -- else: what was the motivation?

2022-10-08 Thread rbowman
On 10/7/22 21:32, Axy wrote: So, seriously, why they needed else if the following pieces produce same result? Does anyone know or remember their motivation? In real scenarios there would be more logic in the for block that would meet a condition and break out of the loop. If the condition is

Polot severa figures inside a for loopin

2022-10-08 Thread "Jorge Conrado Conforte"
HI, I already use the IDL to plot data. Inside a for looping I plot and save my data and kill the window using the wdelete IDL command for close the window automatically. Now I'm using the Python to rea several netcdf 2d data. I plot my data and save it. But, I don't know how can I kill

Re: Ref-strings in logging messages (was: Performance issue with CPython 3.10 + Cython)

2022-10-08 Thread Weatherby,Gerard
Logging does support passing a callable, if indirectly. It only calls __str__ on the object passed if debugging is enabled. class Defer: def __init__(self,fn): self.fn = fn def __str__(self): return self.fn() def some_expensive_function(): return "hello"