On Feb 18, 2011, at 12:36 PM, Brett Cannon wrote: > It says they are "highly discouraged" because "absolute imports are > more portable and usually more readable", but now that people have had > a chance to use explicit relative imports, do people still believe > this? I mean if we truly believed this then why did we add the syntax? > I know I have used it and love it, let alone that I don't buy the > portability argument.
I still find relative imports to be a bit jarring and don't like the implied tight coupling of modules. The nest of relative imports in unittest is a good example of something that causes a mental hiccup when I read it and it seems like an anti-pattern. Raymond Lib/unittest/__init__.py ---------------------------- from .result import TestResult from .case import (TestCase, FunctionTestCase, SkipTest, skip, skipIf, skipUnless, expectedFailure) from .suite import BaseTestSuite, TestSuite from .loader import (TestLoader, defaultTestLoader, makeSuite, getTestCaseNames, findTestCases) from .main import TestProgram, main from .runner import TextTestRunner, TextTestResult from .signals import installHandler, registerResult, removeResult, removeHandler _______________________________________________ python-committers mailing list python-committers@python.org http://mail.python.org/mailman/listinfo/python-committers