On Thu, May 22, 2014 at 12:32 AM, Dave Angel <da...@davea.name> wrote: > I don't think there's any question of dumbhood, but the answer > should be found in the formal grammar document.
Yeah, I figured it'd be an issue of the grammar. It expects 1 to mean an integer, not a name - which in most contexts is correct (you can't go "1 = 2" because 1 isn't a name). In some contexts you can force a different interpretation, so for instance you can look at attributes of an integer literal as (1).real even though 1.real is an error; but I couldn't find a way to fiddle this one. And the only way I could find to pass a string was to use __import__(). So is that the only way? Same thing would happen, I guess, if you have dots in the file name. A file called "foo.bar.py" probably can't be imported. ChrisA -- https://mail.python.org/mailman/listinfo/python-list