summaryrefslogtreecommitdiff
path: root/docs/conventions.rst
diff options
context:
space:
mode:
authorChris McDonough <chrism@plope.com>2013-04-03 03:58:34 -0400
committerChris McDonough <chrism@plope.com>2013-04-03 03:58:34 -0400
commit2ae6f2cba5fc228e20c1ba26ad4f1411a63bbabb (patch)
treef3a290b6e0a21549703050a33433dffef2acc87d /docs/conventions.rst
parentdacbe656d8851580234214fb655b60d24f5800fb (diff)
parentf8afd1638456fc89bc3d17858f309686b40a40a4 (diff)
downloadpyramid-2ae6f2cba5fc228e20c1ba26ad4f1411a63bbabb.tar.gz
pyramid-2ae6f2cba5fc228e20c1ba26ad4f1411a63bbabb.tar.bz2
pyramid-2ae6f2cba5fc228e20c1ba26ad4f1411a63bbabb.zip
Merge branch 'master' of github.com:Pylons/pyramid
Diffstat (limited to 'docs/conventions.rst')
-rw-r--r--docs/conventions.rst21
1 files changed, 21 insertions, 0 deletions
diff --git a/docs/conventions.rst b/docs/conventions.rst
index 4cffd1084..21b506623 100644
--- a/docs/conventions.rst
+++ b/docs/conventions.rst
@@ -91,3 +91,24 @@ discussed on a page, is rendered like so:
Sidebar information.
+When multiple objects are imported from the same package,
+the following convention is used:
+
+ .. code-block:: python
+
+ from foo import (
+ bar,
+ baz,
+ )
+
+It may look unusual, but it has advantages:
+
+* It allows one to swap out the higher-level package ``foo`` for something
+ else that provides the similar API. An example would be swapping out
+ one Database for another (e.g. graduating from SQLite to PostgreSQL).
+
+* Looks more neat in cases where a large number of objects get imported from
+ that package.
+
+* Adding/removing imported objects from the package is quicker and results
+ in simpler diffs.