
Anthony Baxter <anthonyatinterlink.com.au> wrote:
Guido van Rossum wrote:
Did the relative import syntax that was approved ever get checked in? I thought it was on the list of things to land in 2.4?
Nope. The 2.4 release schedule PEP now lists this as lacking someone to drive it. I won't/can't spend time on it. So, if one of the people who wants it could step forward, that'd be excellent. Even if it's just to do the multi-line import syntax of
from foo import ( bar, baz, bar2, baz2, bar3, baz3 )
I took a stab at implementing this (the easy part of PEP 328--parens around import lists). Are the exact semantics of what's allowed documented somewhere? PEP 328 mostly talks about relative and absolute imports, and it doesn't specify the exact semantics of where parentheses should be allowed. My patch (attached) accepts import (os, sys) from sys import (stdin, stdout, stderr) import (os) from sys import (*) but rejects from (sys) import stdin import (os), (sys) import (os,) Should any of those be allowed? Anything that I missed? The patch is incomplete in other ways; the docs haven't been updated and neither have the parser module and compile package. If it's decided that it would be okay to include this separately from relative/absolute import support (they're different features, really), I'll complete the patch. Dima.