Skip to content

Commit 874b47d

Browse files
committed
Merge pull request realpython#522 from vpzee/master
Corrected lines to be no longer than 78 characters.
2 parents 014c191 + 7e38515 commit 874b47d

24 files changed

+504
-439
lines changed

docs/dev/env.rst

Lines changed: 49 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,33 @@ following lines::
2929

3030
With these settings, newlines are inserted after 79 characters and indentation
3131
is set to 4 spaces per tab. If you also use Vim for other languages, there is a
32-
handy plugin called indent_, which handles indentation settings for Python source
33-
files.
32+
handy plugin called indent_, which handles indentation settings for Python
33+
source files.
3434

35-
There is also a handy syntax plugin called syntax_ featuring some improvements over
36-
the syntax file included in Vim 6.1.
35+
There is also a handy syntax plugin called syntax_ featuring some improvements
36+
over the syntax file included in Vim 6.1.
3737

3838
These plugins supply you with a basic environment for developing in Python.
3939
To get the most out of Vim, you should continually check your code for syntax
4040
errors and PEP8 compliance. Luckily PEP8_ and Pyflakes_ will do this for you.
41-
If your Vim is compiled with :option:`+python` you can also utilize some very handy
42-
plugins to do these checks from within the editor.
41+
If your Vim is compiled with :option:`+python` you can also utilize some very
42+
handy plugins to do these checks from within the editor.
4343

4444
For PEP8 checking, install the vim-pep8_ plugin, and for pyflakes you can
45-
install vim-pyflakes_. Now you can map the functions ``Pep8()`` or ``Pyflakes()``
46-
to any hotkey or action you want in Vim. Both plugins will display errors at
47-
the bottom of the screen, and provide an easy way to jump to the corresponding
48-
line. It's very handy to call these functions whenever you save a file. In
49-
order to do this, add the following lines to your :file:`.vimrc`::
45+
install vim-pyflakes_. Now you can map the functions ``Pep8()`` or
46+
``Pyflakes()`` to any hotkey or action you want in Vim. Both plugins will
47+
display errors at the bottom of the screen, and provide an easy way to jump to
48+
the corresponding line. It's very handy to call these functions whenever you
49+
save a file. In order to do this, add the following lines to your
50+
:file:`.vimrc`::
5051

5152
autocmd BufWritePost *.py call Pyflakes()
5253
autocmd BufWritePost *.py call Pep8()
5354

5455
If you are already using syntastic_, you can set it to run Pyflakes on write
5556
and show errors and warnings in the quickfix window. An example configuration
56-
to do that which also shows status and warning messages in the statusbar would be::
57+
to do that which also shows status and warning messages in the statusbar would
58+
be::
5759

5860
set statusline+=%#warningmsg#
5961
set statusline+=%{SyntasticStatuslineFlag()}
@@ -112,8 +114,8 @@ TextMate
112114
--------
113115

114116
`TextMate <http://macromates.com/>`_ brings Apple's approach to operating
115-
systems into the world of text editors. By bridging UNIX underpinnings and GUI,
116-
TextMate cherry-picks the best of both worlds to the benefit of expert
117+
systems into the world of text editors. By bridging UNIX underpinnings and
118+
GUI, TextMate cherry-picks the best of both worlds to the benefit of expert
117119
scripters and novice users alike.
118120

119121
Sublime Text
@@ -124,18 +126,21 @@ Sublime Text
124126
extraordinary features and amazing performance.
125127

126128
Sublime Text has excellent support for editing Python code and uses Python for
127-
its plugin API. It also has a diverse variety of plugins, `some of which <https://github.com/SublimeLinter/SublimeLinter>`_
128-
allow for in-editor PEP8 checking and code "linting".
129+
its plugin API. It also has a diverse variety of plugins,
130+
`some of which <https://github.com/SublimeLinter/SublimeLinter>`_ allow for
131+
in-editor PEP8 checking and code "linting".
129132

130133
Atom
131134
----
132135

133136
`Atom <https://atom.io/>`_ is a hackable text editor for the 21st century,
134-
built on atom-shell, and based on everything we love about our favorite editors.
137+
built on atom-shell, and based on everything we love about our favorite
138+
editors.
135139

136-
Atom is web native (HTML, CSS, JS), focusing on modular design and easy plugin development.
137-
It comes with native package control and plethora of packages. Recommended for Python
138-
development is `Linter <https://github.com/AtomLinter/Linter>`_ combined with
140+
Atom is web native (HTML, CSS, JS), focusing on modular design and easy plugin
141+
development. It comes with native package control and plethora of packages.
142+
Recommended for Python development is
143+
`Linter <https://github.com/AtomLinter/Linter>`_ combined with
139144
`linter-flake8 <https://github.com/AtomLinter/linter-flake8>`_.
140145

141146

@@ -147,9 +152,10 @@ PyCharm / IntelliJ IDEA
147152

148153
`PyCharm <http://www.jetbrains.com/pycharm/>`_ is developed by JetBrains, also
149154
known for IntelliJ IDEA. Both share the same code base and most of PyCharm's
150-
features can be brought to IntelliJ with the free `Python Plug-In <http://plugins.intellij.net/plugin/?id=631>`_.
151-
There are two versions of PyCharm: Professional Edition (Free 30-day trial)
152-
and Community Edition(Apache 2.0 License) with fewer features.
155+
features can be brought to IntelliJ with the free
156+
`Python Plug-In <http://plugins.intellij.net/plugin/?id=631>`_. There are two
157+
versions of PyCharm: Professional Edition (Free 30-day trial) and Community
158+
Edition(Apache 2.0 License) with fewer features.
153159

154160

155161
Eclipse
@@ -172,9 +178,10 @@ Spyder
172178
------
173179

174180
`Spyder <http://code.google.com/p/spyderlib/>`_ is an IDE specifically geared
175-
toward working with scientific Python libraries (namely `Scipy <http://www.scipy.org/>`_).
176-
It includes integration with pyflakes_, `pylint <http://www.logilab.org/857>`_
177-
and `rope <http://rope.sourceforge.net/>`_.
181+
toward working with scientific Python libraries (namely
182+
`Scipy <http://www.scipy.org/>`_). It includes integration with pyflakes_,
183+
`pylint <http://www.logilab.org/857>`_ and
184+
`rope <http://rope.sourceforge.net/>`_.
178185

179186
Spyder is open-source (free), offers code completion, syntax highlighting,
180187
a class and function browser, and object inspection.
@@ -195,11 +202,13 @@ NINJA-IDE
195202

196203
`NINJA-IDE <http://www.ninja-ide.org/>`_ (from the recursive acronym: "Ninja-IDE
197204
Is Not Just Another IDE") is a cross-platform IDE, specially designed to build
198-
Python applications, and runs on Linux/X11, Mac OS X and Windows desktop operating
199-
systems. Installers for these platforms can be downloaded from the website.
205+
Python applications, and runs on Linux/X11, Mac OS X and Windows desktop
206+
operating systems. Installers for these platforms can be downloaded from the
207+
website.
200208

201-
NINJA-IDE is open-source software (GPLv3 licence) and is developed in Python and
202-
Qt. The source files can be downloaded from `GitHub <https://github.com/ninja-ide>`_.
209+
NINJA-IDE is open-source software (GPLv3 licence) and is developed
210+
in Python and Qt. The source files can be downloaded from
211+
`GitHub <https://github.com/ninja-ide>`_.
203212

204213

205214
Eric (The Eric Python IDE)
@@ -210,8 +219,8 @@ offering sourcecode autocompletion, syntax highlighting, support for version
210219
control systems, python 3 support, integrated web browser, python shell,
211220
integrated debugger and a flexible plug-in system. Written in python, it is
212221
based on the Qt gui toolkit, integrating the Scintilla editor control. Eric
213-
is an open-source software project (GPLv3 licence) with more than ten years of active
214-
development.
222+
is an open-source software project (GPLv3 licence) with more than ten years of
223+
active development.
215224

216225

217226
Interpreter Tools
@@ -221,15 +230,16 @@ Interpreter Tools
221230
Virtual Environments
222231
--------------------
223232

224-
A Virtual Environment is a tool to keep the dependencies required by different projects
225-
in separate places, by creating virtual Python environments for them. It solves the
226-
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
227-
your global site-packages directory clean and manageable.
233+
A Virtual Environment is a tool to keep the dependencies required by different
234+
projects in separate places, by creating virtual Python environments for them.
235+
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
236+
dilemma, and keeps your global site-packages directory clean and manageable.
228237

229238
For example, you can work on a project which requires Django 1.3 while also
230239
maintaining a project which requires Django 1.0.
231240

232-
To start using and see more information: `Virtual Environments <http://github.com/kennethreitz/python-guide/blob/master/docs/dev/virtualenvs.rst>`_ docs.
241+
To start using and see more information:
242+
`Virtual Environments <http://github.com/kennethreitz/python-guide/blob/master/docs/dev/virtualenvs.rst>`_ docs.
233243

234244
Other Tools
235245
:::::::::::
@@ -273,7 +283,8 @@ BPython
273283
-------
274284

275285
`bpython <http://bpython-interpreter.org/>`_ is an alternative interface to the
276-
Python interpreter for Unix-like operating systems. It has the following features:
286+
Python interpreter for Unix-like operating systems. It has the following
287+
features:
277288

278289
* In-line syntax highlighting.
279290
* Readline-like autocomplete with suggestions displayed as you type.

docs/dev/virtualenvs.rst

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Virtual Environments
22
====================
33

4-
A Virtual Environment is a tool to keep the dependencies required by different projects
5-
in separate places, by creating virtual Python environments for them. It solves the
6-
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
7-
your global site-packages directory clean and manageable.
4+
A Virtual Environment is a tool to keep the dependencies required by different
5+
projects in separate places, by creating virtual Python environments for them.
6+
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
7+
dilemma, and keeps your global site-packages directory clean and manageable.
88

99
For example, you can work on a project which requires Django 1.3 while also
1010
maintaining a project which requires Django 1.0.
@@ -32,10 +32,11 @@ Basic Usage
3232
$ cd my_project_folder
3333
$ virtualenv venv
3434
35-
``virtualenv venv`` will create a folder in the current directory which will contain
36-
the Python executable files, and a copy of the ``pip`` library which you can use to
37-
install other packages. The name of the virtual environment (in this case, it was ``venv``)
38-
can be anything; omitting the name will place the files in the current directory instead.
35+
``virtualenv venv`` will create a folder in the current directory which will
36+
contain the Python executable files, and a copy of the ``pip`` library which you
37+
can use to install other packages. The name of the virtual environment (in this
38+
case, it was ``venv``) can be anything; omitting the name will place the files
39+
in the current directory instead.
3940

4041
This creates a copy of Python in whichever directory you ran the command in,
4142
placing it in a folder named :file:`venv`.

docs/intro/duction.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,5 @@ first-time Pythonista, and the authors to the Guide will gladly help if you
8484
have any questions about the appropriateness, completeness, or accuracy of
8585
a contribution.
8686

87-
To get started working on The Hitchhiker's Guide, see the :doc:`/notes/contribute` page.
87+
To get started working on The Hitchhiker's Guide,
88+
see the :doc:`/notes/contribute` page.

docs/intro/learning.rst

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Beginner
77
The Python Tutorial
88
~~~~~~~~~~~~~~~~~~~~
99

10-
This is the official tutorial. It covers all the basics, and offers a tour of the
11-
language and the standard library. Recommended for those who need a quickstart
12-
guide to the language.
10+
This is the official tutorial. It covers all the basics, and offers a tour of
11+
the language and the standard library. Recommended for those who need a
12+
quickstart guide to the language.
1313

1414
`The Python Tutorial <http://docs.python.org/tutorial/index.html>`_
1515

@@ -18,15 +18,16 @@ Learn Python Interactive Tutorial
1818
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1919

2020
Learnpython.org is an easy non-intimidating way to get introduced to Python.
21-
The website takes the same approach used on the popular `Try Ruby <http://tryruby.org/>`_
22-
website, it has an interactive Python interpreter built into the site that
23-
allows you to go through the lessons without having to install Python locally.
21+
The website takes the same approach used on the popular
22+
`Try Ruby <http://tryruby.org/>`_ website, it has an interactive Python
23+
interpreter built into the site that allows you to go through the lessons
24+
without having to install Python locally.
2425

2526
`Learn Python <http://www.learnpython.org/>`_
2627

2728

28-
If you want a more traditional book, *Python For You and Me* is an
29-
excellent resource for learning all aspects of the language.
29+
If you want a more traditional book, *Python For You and Me* is an excellent
30+
resource for learning all aspects of the language.
3031

3132
`Python for You and Me <http://pymbook.readthedocs.org/>`_
3233

@@ -121,8 +122,8 @@ More information about test driven development can be found at these resources:
121122
A Byte of Python
122123
~~~~~~~~~~~~~~~~
123124

124-
A free introductory book that teaches Python at the beginner level, it assumes no
125-
previous programming experience.
125+
A free introductory book that teaches Python at the beginner level, it assumes
126+
no previous programming experience.
126127

127128
`A Byte of Python for Python 2.x <http://www.ibiblio.org/swaroopch/byteofpython/read/>`_
128129
`A Byte of Python for Python 3.x <http://swaroopch.com/notes/Python_en-Preface/>`_
@@ -142,8 +143,9 @@ Advanced
142143
Pro Python
143144
~~~~~~~~~~
144145

145-
This book is for intermediate to advanced Python programmers who are looking to understand how
146-
and why Python works the way it does and how they can take their code to the next level.
146+
This book is for intermediate to advanced Python programmers who are looking to
147+
understand how and why Python works the way it does and how they can take their
148+
code to the next level.
147149

148150
`Pro Python <http://propython.com>`_
149151

@@ -169,8 +171,8 @@ A Guide to Python's Magic Methods
169171
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
170172

171173
This is a collection of blog posts by Rafe Kettler which explain 'magic methods'
172-
in Python. Magic methods are surrounded by double underscores (i.e. __init__) and
173-
can make classes and objects behave in different and magical ways.
174+
in Python. Magic methods are surrounded by double underscores (i.e. __init__)
175+
and can make classes and objects behave in different and magical ways.
174176

175177
`A Guide to Python's Magic Methods <http://www.rafekettler.com/magicmethods.html>`_
176178

@@ -181,17 +183,17 @@ For Engineers and Scientists
181183
A Primer on Scientific Programming with Python
182184
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
183185

184-
A Primer on Scientific Programming with Python, written by Hans Petter Langtangen,
185-
mainly covers Python's usage in the scientific field. In the book, examples are
186-
chosen from mathematics and the natural sciences.
186+
A Primer on Scientific Programming with Python, written by Hans Petter
187+
Langtangen, mainly covers Python's usage in the scientific field. In the book,
188+
examples are chosen from mathematics and the natural sciences.
187189

188190
`A Primer on Scientific Programming with Python <http://www.springer.com/mathematics/computational+science+%26+engineering/book/978-3-642-30292-3>`_
189191

190192
Numerical Methods in Engineering with Python
191193
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192194

193-
Numerical Methods in Engineering with Python, written by Jaan Kiusalaas, puts the
194-
emphasis on numerical methods and how to implement them in Python.
195+
Numerical Methods in Engineering with Python, written by Jaan Kiusalaas,
196+
puts the emphasis on numerical methods and how to implement them in Python.
195197

196198
`Numerical Methods in Engineering with Python <http://www.cambridge.org/us/academic/subjects/engineering/engineering-mathematics-and-programming/numerical-methods-engineering-python-2nd-edition>`_
197199

@@ -201,19 +203,20 @@ Miscellaneous topics
201203
Problem Solving with Algorithms and Data Structures
202204
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
203205

204-
Problem Solving with Algorithms and Data Structures covers a range of data structures and
205-
algorithms. All concepts are illustrated with Python code along with interactive samples
206-
that can be run directly in the browser.
206+
Problem Solving with Algorithms and Data Structures covers a range of data
207+
structures and algorithms. All concepts are illustrated with Python code along
208+
with interactive samples that can be run directly in the browser.
207209

208210
`Problem Solving with Algorithms and Data Structures
209211
<http://www.interactivepython.org/courselib/static/pythonds/index.html>`_
210212

211213
Programming Collective Intelligence
212214
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213215

214-
Programming Collective Intelligence introduces a wide array of basic machine learning and
215-
data mining methods. The exposition is not very mathematically formal, but rather focuses
216-
on explaining the underlying intuition and shows how to implement the algorithms in Python.
216+
Programming Collective Intelligence introduces a wide array of basic machine
217+
learning and data mining methods. The exposition is not very mathematically
218+
formal, but rather focuses on explaining the underlying intuition and shows
219+
how to implement the algorithms in Python.
217220

218221
`Programming Collective Intelligence <http://shop.oreilly.com/product/9780596529321.do>`_
219222

@@ -232,17 +235,17 @@ as writing C extensions.
232235
The Python Language Reference
233236
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
234237

235-
This is Python's reference manual, it covers the syntax and the core semantics of the
236-
language.
238+
This is Python's reference manual, it covers the syntax and the core semantics
239+
of the language.
237240

238241
`The Python Language Reference <http://docs.python.org/reference/index.html>`_
239242

240243
Python Pocket Reference
241244
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
242245

243-
Python Pocket Reference, written by Mark Lutz, is an easy to use reference to the
244-
core language, with descriptions of commonly used modules and toolkits. It covers
245-
Python 3 and 2.6 versions.
246+
Python Pocket Reference, written by Mark Lutz, is an easy to use reference to
247+
the core language, with descriptions of commonly used modules and toolkits. It
248+
covers Python 3 and 2.6 versions.
246249

247250
`Python Pocket Reference <http://shop.oreilly.com/product/9780596158095.do>`_
248251

@@ -259,11 +262,11 @@ Writing Idiomatic Python
259262
~~~~~~~~~~~~~~~~~~~~~~~~
260263

261264
"Writing Idiomatic Python", written by Jeff Knupp, contains the most common and
262-
important Python idioms in a format that maximizes identification and understanding.
263-
Each idiom is presented as a recommendation of a way to write some commonly
264-
used piece of code, followed by an explanation of why the idiom is important.
265-
It also contains two code samples for each idiom: the "Harmful" way to write it
266-
and the "Idiomatic" way.
265+
important Python idioms in a format that maximizes identification and
266+
understanding. Each idiom is presented as a recommendation of a way to write
267+
some commonly used piece of code, followed by an explanation of why the idiom
268+
is important. It also contains two code samples for each idiom: the "Harmful"
269+
way to write it and the "Idiomatic" way.
267270

268271
`For Python 2.7.3+ <http://www.amazon.com/Writing-Idiomatic-Python-2-7-3-Knupp/dp/1482372177/>`_
269272

docs/intro/news.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ new releases, jobs, etc. related to Python.
3535
Python News
3636
~~~~~~~~~~~~~
3737

38-
Python News is the news section in the official Python web site (www.python.org). It briefly
39-
highlights the news from the Python community.
38+
Python News is the news section in the official Python web site
39+
(www.python.org). It briefly highlights the news from the Python community.
4040

4141
`Python News <http://www.python.org/news/>`_
4242

4343
Import Python Weekly
4444
~~~~~~~~~~~~~~~~
4545

46-
Weekly Python Newsletter containing Python Articles, Projects, Videos, Tweets delivered in your inbox.
47-
Keep Your Python Programming Skills Updated.
46+
Weekly Python Newsletter containing Python Articles, Projects, Videos, Tweets
47+
delivered in your inbox. Keep Your Python Programming Skills Updated.
4848

4949
`Import Python Weekly Newsletter <http://www.importpython.com/newsletter/>`_

0 commit comments

Comments
 (0)