9 PEP 328: Multi-line Imports
One language change is a small syntactic tweak aimed at making it
easier to import many names from a module. In a
from SimpleXMLRPCServer import SimpleXMLRPCServer,\
SimpleXMLRPCRequestHandler,\
CGIXMLRPCRequestHandler,\
resolve_dotted_attribute
The syntactic change in Python 2.4 simply allows putting the names within parentheses. Python ignores newlines within a parenthesized expression, so the backslashes are no longer needed:
from SimpleXMLRPCServer import (SimpleXMLRPCServer,
SimpleXMLRPCRequestHandler,
CGIXMLRPCRequestHandler,
resolve_dotted_attribute)
The PEP also proposes that all import statements be absolute imports, with a leading "." character to indicate a relative import. This part of the PEP is not yet implemented, and will have to wait for Python 2.5 or some other future version.
See Also:
See About this document... for information on suggesting changes. Document provided by Web Master Resources and hosted at Speedy Domain Registration Company |