This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author gsakkis
Recipients brett.cannon, eric.araujo, gsakkis, hauser, mrts, rhettinger
Date 2010-04-15.22:33:48
SpamBayes Score 3.9697423e-10
Marked as misclassified No
Message-id <1271370830.25.0.963174091487.issue2090@psf.upfronthosting.co.za>
In-reply-to
Content
> When you use an empty string in fromlist you are essentially simulating 
> ``from pkg import`` which makes absolutely no sense, so no one has
> cared enough to try to fix this.

``from pkg import __bogus__, 123, @$%`` doesn't make sense either and yet the equivalent __import__ call doesn't cause multiple imports neither binds __name__ to bogus strings, it just imports and returns pkg.

> Since ``from pkg import`` makes no sense, would it be okay if
> __import__ with an empty fromlist or slashes raised an error?

No, this would break lots of working code and would be inconsistent anyway with other invalid fromlist inputs. The backwards compatible solution would be to treat the empty string (and slashes) like every other input, i.e. prevent multiple imports.
History
Date User Action Args
2010-04-15 22:33:50gsakkissetrecipients: + gsakkis, brett.cannon, rhettinger, hauser, eric.araujo, mrts
2010-04-15 22:33:50gsakkissetmessageid: <1271370830.25.0.963174091487.issue2090@psf.upfronthosting.co.za>
2010-04-15 22:33:48gsakkislinkissue2090 messages
2010-04-15 22:33:48gsakkiscreate