diff options
| author | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2013-03-25 12:16:39 +0200 |
|---|---|---|
| committer | Tshepang Lekhonkhobe <tshepang@gmail.com> | 2013-03-25 12:16:39 +0200 |
| commit | d886c933784e499a6243b0ebbfc04fb0bb2be4fa (patch) | |
| tree | 6c59b9cfe12b6bf101b0669344de274ff63b36ad /docs/conventions.rst | |
| parent | b4c0d4f0574b45c88f66530548ecaa7d6ad0baef (diff) | |
| download | pyramid-d886c933784e499a6243b0ebbfc04fb0bb2be4fa.tar.gz pyramid-d886c933784e499a6243b0ebbfc04fb0bb2be4fa.tar.bz2 pyramid-d886c933784e499a6243b0ebbfc04fb0bb2be4fa.zip | |
mention a coding convention
Diffstat (limited to 'docs/conventions.rst')
| -rw-r--r-- | docs/conventions.rst | 21 |
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. |
