[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: Popularity contest**
**From**: Dirk Laurie <dpl@...>
**Date**: Mon, 26 Sep 2011 14:04:06 +0200

On Mon, Sep 26, 2011 at 12:07:25PM +0200, steve donovan wrote:
> On Mon, Sep 26, 2011 at 10:52 AM, Dirk Laurie <dpl@sun.ac.za> wrote:
> > but is the proposed 'import sin,cos from math' really so much more
> > convenient than 'import(math,{"sin","cos"})' as to justify two new
> > keywords? (As I have confessed before, I'm a Python _apostate_).
>
> Ah, but note the difference
>
> import sin, cos from math => local sin, cos = math.sin, math.cos
>
> the idea is to get away from globals. Now this kind of thing can be
> done with macros or whatnot, but can't be done with table magic.
OK, I'll rephrase my objection.
Is the proposed 'import sin,cos from math' really so much more
convenient than 'local sin,cos = math.sin,math.cos' as to justify
two new keywords?
Personally I don't think it is clean and clever to make war veterans
like `sin` and `cos` local, but let's not cloud the syntax issue.
Dirk