~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/code-style.txt

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
77
77
Python versions
78
78
===============
79
79
 
80
 
Bazaar supports Python from 2.4 through 2.6, and in the future we want to
81
 
support Python 2.7 and 3.0.  Avoid using language features added in 2.5,
82
 
2.6 or 2.7, or features deprecated in Python 3.0.  (You can check v3
 
80
Bazaar supports Python from 2.6 through 2.7, and in the future we want to
 
81
support Python 3.  Avoid using language features added in
 
82
2.7, or features deprecated in Python 3.0.  (You can check v3
83
83
compatibility using the ``-3`` option of Python2.6.)
84
84
 
85
 
Specifically:
86
 
 
87
 
* Don't use the ``with`` statement.
88
 
 
89
 
* Don't ``from . import``.
90
 
 
91
 
* Don't use ``try/except/finally``, which is not supported in Python2.4,
92
 
  use separate nested ``try/except`` and ``try/finally`` blocks.
93
 
 
94
85
 
95
86
hasattr and getattr
96
87
===================