Python Feature Request: Add the "using" keyword which works like "with" in Visual Basic
James Stroud
jstroud at mbi.ucla.edu
Sat Apr 14 07:49:00 EDT 2007
jamadagni wrote:
>> I like this one for some reason. Just the "using self" would save hella
>> typing in a lot of classes. I would favor a convention with leading dots
>> to disambiguate from other variables. This wouldn't conflict with, say,
>> floats, because variable names can't begin with a number.
>
> Excellent. Now we don't have to worry about the "first applicable
> instance" etc. Any member that begins with a dot will have the context
> governer auto-prefixed by the parser. This means that nested using
> statements should be like follows:
>
> using self:
> __using .quit:
>
> with the dot preceding quit also. Excellent!
>
> But you have said "variable names can't begin with a number". The
> point this, they shouldn't be able to begin with a *dot*. We are not
> worried about numbers here, right?
>
On third or fourth read, I think you are not being sarcastic and
rhetorical--sorry for my misunderstanding you--I think fatigue is
affecting the little voices in my head. I'm just saying that a preceding
dot is not otherwise used in the language except for perhaps floats.
James
More information about the Python-list
mailing list