would be nice: import from archive
Terry Reedy
tjreedy at udel.edu
Sun Aug 29 03:11:20 EDT 2004
"Paul Rubin" <"http://phr.cx"@NOSPAM.invalid> wrote in message
news:7x1xhqg3kb.fsf at ruckus.brouhaha.com...
> "Terry Reedy" <tjreedy at udel.edu> writes:
>> 'import x' is syntactic sugar for 'x = __import__('x')'. I do not see
>> it
>> as necessary that sugar for the common case need cover every possible
>> case.
>> So, how about giving __import__ had an optional param 'signed' defaulted
>> to
>> False, to allow signed =True or signed = CA?
>
> Man, that __import__ thing is ugly.
Yes... but importing from signed zips is sufficiently rare and esoteric
that I would not see surface ugliness that accompanies using current syntax
as the most important consideration.
> I think it's better to extend the syntax, e.g.
> import x(a,b) => __import__('x', {'a':None, 'b':None})
> import x(a=v1,b=v2)=> __import__('x', {'a':v1, 'b':v2})
Identifier(args) is currently a call of identifier with args and
overloading that syntax to mean somthing similar but different is, to me,
even uglier in a different sort of way.
Terry J. Reedy
More information about the Python-list
mailing list