~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Samuel Bronson
  • Date: 2012-08-30 21:54:35 UTC
  • mto: (6015.57.3 2.4)
  • mto: This revision was merged to the branch mainline in revision 6558.
  • Revision ID: naesten@gmail.com-20120830215435-akw1leqrtioh4q1d
Update "Python versions" section of doc/developers/code-style.txt.

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
===================