Some language proposals.

Antoon Pardon apardon at forel.vub.ac.be
Wed Feb 25 03:47:39 EST 2004


Op 2004-02-24, Anton Vredegoor schreef <anton at vredegoor.doge.nl>:
> Antoon Pardon <apardon at forel.vub.ac.be> wrote:
>
>> [ ... ]
>

>>What do people think about this?
>>As far as I know the proposal doesn't break existing
>>code and seems in the spirit of python.
>
> I don't see much merit in this, since functions are designed to go out
> of scope once they are executed. Having sub-scopes change names higher
> up is considered a no-no in Python,

I don't understand why. It already is possible with global variables.
I don't see much difference between a function changing a higher up
variable that is global or just in between.

>>On a side note, what would people think about the idea of
>>a from ... import ... statement usable on any object? So
>>that we could do:
>>
>>class A:
>>  pass
>>
>>A.a = ...
>>A.b = ...
>>
>>from A import a, b
>>
>># from here a and be refer to A.a and A.b
>
> This raises the question of why not to use a class to begin with even
> for your earlier proposals. Anyway, this can be accomplished easily
> with:
>
>   a,b = A.a,A.b

Well maybe my wording was off, but this doesn't accomplisch what I
want since after your statement followed by: a = new_value; A.a will
not be changed.

-- 
Antoon Pardon



More information about the Python-list mailing list