Proposal: Inline Import

"Martin v. Löwis" martin at
Sun Dec 11 11:48:46 CET 2005

Shane Hathaway wrote:
> Thoughts?

I have two reasons to dislike it:
1. It's a language change. Others have pointed out that you can achieve
   the same without a language change; it would be easy to write

   name_expr ='[a-zA-Z]+')

2. In the form in which you have written it, I believe it is
   unimplementable (or, else, an implementation would have
   counter-intuitive border cases). For example, what would


   mean? From the description, it appears that it would be

   from xml.sax.expatreader.ExpatParser import __init__ as \

   which, of course, wouldn't work, because ExpatParser is
   not a module.
3. As in any good list of two items, I have a third complaint:
   for packages, this would be tedious to type (as the sax
   example illustrates)


More information about the Python-list mailing list