Re: Behavior of the for-else construct

2022-03-03 Thread computermaster360
On Thu, 3 Mar 2022 at 18:25, Schachner, Joseph wrote: > I don't know what that would be. "finally" is available 😊 Write up a > feature request. Not sure if you mean `finally` seriously but I think that would about as confusing as the current `else`, if not even more 😅 Meanwhile, I found anoth

Behavior of the for-else construct

2022-03-03 Thread computermaster360
I want to make a little survey here. Do you find the for-else construct useful? Have you used it in practice? Do you even know how it works, or that there is such a thing in Python? I have used it maybe once. My issue with this construct is that calling the second block `else` doesn't make sense;

Get the source of a class reliably?!?

2019-04-29 Thread computermaster360 .
Does anyone have an idea why classes don't contain their definition line number as functions or methods do? >>> some_fun.__code__.co_firstlineno 123 >>> SomeClass.??? This leads to some funny stuff when using `inspect`, such as this: -- weird.py - """ class C: HAHAH