Case Statements

Chris Angelico rosuav at gmail.com
Thu Mar 17 05:55:33 EDT 2016


On Thu, Mar 17, 2016 at 8:23 PM, Antoon Pardon
<antoon.pardon at rece.vub.ac.be> wrote:
> Op 17-03-16 om 03:02 schreef Chris Angelico:
>> On Thu, Mar 17, 2016 at 12:54 PM, Steven D'Aprano <steve at pearwood.info> wrote:
>>
>>> I wouldn't want to rely on it working with decorator syntax either. Even if
>>> it does now, I'm not sure that's a language guarantee.
>> That's the thing, though. It's not a guarantee, yet it does work in
>> every Python interpreter that I tried it in.
>
> That depends on what you mean by work. This failes:
> [doing the same thing in a function]

Very true; I could have messed around with getframe, but most classes
are global, and it keeps things simple.

ChrisA



More information about the Python-list mailing list