From 6f370e16dc5f7c7a511c820570ae8b9c89710413 Mon Sep 17 00:00:00 2001
From: prateekrc3
Date: Sat, 5 Mar 2016 11:28:30 +0530
Subject: [PATCH 001/500] Update learning.rst
Added a tutorial http://thepythonguru.com/.
---
docs/intro/learning.rst | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index d7266b87c..8ab660867 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -13,6 +13,15 @@ quick-start guide to the language.
`The Python Tutorial `_
+Python for Beginners
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+thepythonguru.com is a tutorial focuses on beginner programmers. It covers many python concepts
+in depth. It also teaches you some advance constructs of python like lambda expression, regular expression.
+At last it finishes off with tutorial "How to access MySQL db using python"
+
+
+ `Python for beginners `_
Learn Python Interactive Tutorial
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From 31452655eb2e7234dd159500d971ad7c379557ca Mon Sep 17 00:00:00 2001
From: Crack Duck
Date: Sat, 5 Mar 2016 13:22:56 +0100
Subject: [PATCH 002/500] change W3C link to the XPath Tutorial
the old link 404's, so I did a quick search and found the W3C XPath tutorial and replaced the link.
---
docs/scenarios/scrape.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst
index 0728d2592..889a93082 100644
--- a/docs/scenarios/scrape.rst
+++ b/docs/scenarios/scrape.rst
@@ -49,7 +49,7 @@ will focus on the former.
XPath is a way of locating information in structured documents such as
HTML or XML documents. A good introduction to XPath is on
-`W3Schools `_ .
+`W3Schools `_ .
There are also various tools for obtaining the XPath of elements such as
FireBug for Firefox or the Chrome Inspector. If you're using Chrome, you
From 4e3b235a1c7f018504051848da516afdd158a216 Mon Sep 17 00:00:00 2001
From: Jacob Bryan
Date: Tue, 8 Mar 2016 16:31:44 -0600
Subject: [PATCH 003/500] Update structure.rst
Updated a broken link to the pip website which explains a pip requirements file
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 35e9d030d..489ce7155 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -147,7 +147,7 @@ Requirements File
A `pip requirements
-file `__
+file https://pip.pypa.io/en/stable/user_guide/#requirements-files>`__
should be placed at the root of the repository. It should specify the
dependencies required to contribute to the project: testing, building,
and generating documentation.
From fada1cedd8a012f34e757838527e1749c5eaae60 Mon Sep 17 00:00:00 2001
From: "F. Gabriel Gosselin"
Date: Wed, 9 Mar 2016 13:59:58 -0800
Subject: [PATCH 004/500] Fix pip requirements link
Missing < broke the link
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 489ce7155..7cde9daa1 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -147,7 +147,7 @@ Requirements File
A `pip requirements
-file https://pip.pypa.io/en/stable/user_guide/#requirements-files>`__
+file `__
should be placed at the root of the repository. It should specify the
dependencies required to contribute to the project: testing, building,
and generating documentation.
From 5e5d548a6c2800b945bcd83588c1267332df2141 Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 12 Mar 2016 14:18:19 +0100
Subject: [PATCH 005/500] Include Youtube video using raw:: html directive
---
docs/writing/reading.rst | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/docs/writing/reading.rst b/docs/writing/reading.rst
index 910e2752d..39b0888bf 100644
--- a/docs/writing/reading.rst
+++ b/docs/writing/reading.rst
@@ -8,6 +8,14 @@ one thing that Python programmers do is read code.
One of the secrets of becoming a great Python programmer is to read,
understand, and comprehend excellent code.
+.. raw:: html
+
+
+
+
Excellent code typically follows the guidelines outlined in
:ref:`code_style`, and does its best to express a clear and concise
intent to the reader.
@@ -45,7 +53,6 @@ reading. Each one of these projects is a paragon of Python coding.
- `Tablib `_
Tablib is a format-agnostic tabular dataset library, written in Python.
-.. todo:: Embed and explain YouTube video showing python code reading: http://www.youtube.com/watch?v=Jc8M9-LoEuo This may require installing a Sphinx plugin. https://bitbucket.org/birkenfeld/sphinx-contrib/src/a09f29fc16970f34350ca36ac7f229e00b1b1674/youtube?at=default
.. todo:: Include code examples of exemplary code from each of the projects listed. Explain why it is excellent code. Use complex examples.
From 4d8ae2a694815ba617964605b40148f5a457799f Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sun, 13 Mar 2016 17:30:57 +0100
Subject: [PATCH 006/500] I fail to see how Mule would help in Continuous
Integration scenarios
afaik Mule is an Enterprise Service Bus, which can be useful in enterprise application integration scenarios,
but imo it is really is not useful in the context of continuous integration of Python programs.
---
docs/scenarios/ci.rst | 11 -----------
1 file changed, 11 deletions(-)
diff --git a/docs/scenarios/ci.rst b/docs/scenarios/ci.rst
index 43b422094..aa8d1968f 100644
--- a/docs/scenarios/ci.rst
+++ b/docs/scenarios/ci.rst
@@ -31,17 +31,6 @@ Buildbot
automate the compile/test cycle to validate code changes.
-Mule
------
-
-`Mule `_
-is a lightweight integration platform that enables you to connect anything,
-anywhere. You can use Mule to intelligently manage message routing, data
-mapping, orchestration, reliability, security and scalability between nodes.
-Plug other systems and applications into Mule and let it handle all the
-communication between systems, enabling you to track and monitor everything
-that happens.
-
Tox
---
From 6711e7fde14d02ec3e881a1636eed04bcd0bdc56 Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Mon, 14 Mar 2016 12:33:49 -0400
Subject: [PATCH 007/500] Removed references to Setuptools/easy_install in
favor of pip. A new Python user hardly needs to know that easy_install ever
existed
---
docs/starting/install/osx.rst | 44 ++++++++++++++++-------------------
1 file changed, 20 insertions(+), 24 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index cb0062cc7..db029822b 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -5,11 +5,11 @@ Installing Python on Mac OS X
The latest version of Mac OS X, El Capitan, **comes with Python 2.7 out of the box**.
-You do not need to install or configure anything else to use Python. Having
-said that, I would strongly recommend that you install the tools and libraries
-described in the next section before you start building Python applications
-for real-world use. In particular, you should always install Setuptools, as it
-makes it much easier for you to use other third-party Python libraries.
+You do not need to install or configure anything else to use Python. Having said
+that, I would strongly recommend that you install the tools and libraries
+described in the next section before you start building Python applications for
+real-world use. In particular, you should always install ``pip``, as it makes
+it much easier for you to install and manage other third-party Python libraries.
The version of Python that ships with OS X is great for learning but it's not
good for development. The version shipped with OS X may be out of date from the
@@ -33,11 +33,11 @@ package.
diagnose.
.. note::
- If you perform a fresh install of XCode, you will also need to add the
+ If you perform a fresh install of XCode, you will also need to add the
commandline tools by running ``xcode-select --install`` on the terminal.
While OS X comes with a large number of UNIX utilities, those familiar with
-Linux systems will notice one key component missing: a decent package manager.
+Linux systems will notice one key component missing: a package manager.
`Homebrew `_ fills this void.
To `install Homebrew `_, open :file:`Terminal` or
@@ -63,37 +63,33 @@ Now, we can install Python 2.7:
$ brew install python
-This will take a minute or two.
+This will take a minute or two.
-Setuptools & Pip
+Pip
----------------
-Homebrew installs Setuptools and ``pip`` for you.
+Homebrew installs ``pip`` for you.
-Setuptools enables you to download and install any compliant Python
-software over a network (usually the Internet) with a single command
-(``easy_install``). It also enables you to add this network installation
-capability to your own Python software with very little work.
-
-``pip`` is a tool for easily installing and managing Python packages,
-that is recommended over ``easy_install``. It is superior to ``easy_install`` in `several ways `_,
+``pip`` is a tool for easily installing and managing Python packages, that is
+recommended over the deprecated ``easy_install``. It is superior to
+``easy_install`` in `several ways
+`_,
and is actively maintained.
Virtual Environments
--------------------
-A Virtual Environment is a tool to keep the dependencies required by different projects
-in separate places, by creating virtual Python environments for them. It solves the
-"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
+A Virtual Environment (commonly referred to as a 'virtualenv') is a tool to keep the dependencies required by different projects
+in separate places, by creating virtual Python environments for them. It solves the
+"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
your global site-packages directory clean and manageable.
-For example, you can work on a project which requires Django 1.3 while also
-maintaining a project which requires Django 1.0.
-
-To start using this and see more information: :ref:`Virtual Environments ` docs.
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.7.
+To start using this and see more information: :ref:`Virtual Environments ` docs.
--------------------------------
From 304728846623c831fa549c40c60b1329c99a1264 Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Mon, 14 Mar 2016 13:22:14 -0400
Subject: [PATCH 008/500] Removed references to main install page
---
docs/starting/installation.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 04aaaa0b8..c0118f68c 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -7,14 +7,14 @@ If so, you do not need to install or configure anything else to use Python.
Having said that, I would strongly recommend that you install the tools and
libraries described in the guides below before you start building Python
applications for real-world use. In particular, you should always install
-Setuptools, Pip, and Virtualenv — they make it much easier for you to use
+Pip, and Virtualenv — they make it much easier for you to use
other third-party Python libraries.
Installation Guides
-------------------
These guides go over the proper installation of :ref:`Python 2.7 `
-for development purposes, as well as setuptools, pip, and virtualenv setup.
+for development purposes, as well as pip and virtualenv.
- :ref:`Mac OS X `.
- :ref:`Microsoft Windows `.
From 8da905eae316c897bc61ffbc9d093483f6341519 Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Mon, 14 Mar 2016 14:28:01 -0400
Subject: [PATCH 009/500] First stab at Python3 OS X docs
---
docs/dev/virtualenvs.rst | 35 ++++++----
docs/starting/install/osx.rst | 3 +
docs/starting/install3/osx.rst | 116 +++++++++++++++++++++++++++++++++
docs/starting/installation.rst | 10 +--
4 files changed, 146 insertions(+), 18 deletions(-)
create mode 100644 docs/starting/install3/osx.rst
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index bb3f9487c..90c7f19df 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -8,15 +8,22 @@ projects in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
dilemma, and keeps your global site-packages directory clean and manageable.
-For example, you can work on a project which requires Django 1.3 while also
-maintaining a project which requires Django 1.0.
+For example, you can work on a project which requires Django 1.9 while also
+maintaining a project which requires Django 1.8.
+
+If you are using Python 3, make sure you run something like the following (or
+have it in your env variables in `~/.bashrc`):
+
+.. code-block:: console
+
+ $ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
virtualenv
----------
`virtualenv `_ is a tool to create
-isolated Python environments. virtualenv creates a folder which contains all the
-necessary executables to use the packages that a Python project would need.
+isolated Python environments. virtualenv creates a folder which contains all the
+necessary executables to use the packages that a Python project would need.
Install virtualenv via pip:
@@ -43,13 +50,13 @@ in the current directory instead.
This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named :file:`venv`.
-You can also use a Python interpreter of your choice.
+You can also use the Python interpreter of your choice.
.. code-block:: console
- $ virtualenv -p /usr/bin/python2.7 venv
+ $ virtualenv -p /usr/local/bin/python3 venv
-This will use the Python interpreter in :file:`/usr/bin/python2.7`
+This will use the Python interpreter in :file:`/usr/local/bin/python3`
2. To begin using the virtual environment, it needs to be activated:
@@ -57,9 +64,9 @@ This will use the Python interpreter in :file:`/usr/bin/python2.7`
$ source venv/bin/activate
-The name of the current virtual environment will now appear on the left of
-the prompt (e.g. ``(venv)Your-Computer:your_project UserName$)`` to let you know
-that it's active. From now on, any package that you install using pip will be
+The name of the current virtual environment will now appear on the left of
+the prompt (e.g. ``(venv)Your-Computer:your_project UserName$)`` to let you know
+that it's active. From now on, any package that you install using pip will be
placed in the ``venv`` folder, isolated from the global Python installation.
Install packages as usual, for example:
@@ -78,7 +85,7 @@ Install packages as usual, for example:
This puts you back to the system's default Python interpreter with all its
installed libraries.
-To delete a virtual environment, just delete its folder. (In this case,
+To delete a virtual environment, just delete its folder. (In this case,
it would be ``rm -rf venv``.)
After a while, though, you might end up with a lot of virtual environments
@@ -102,8 +109,8 @@ the current state of the environment packages. To do this, run
This will create a :file:`requirements.txt` file, which contains a simple
list of all the packages in the current environment, and their respective
-versions. You can see the list of installed packages without the requirements
-format using "pip list". Later it will be easier for a different developer
+versions. You can see the list of installed packages without the requirements
+format using "pip list". Later it will be easier for a different developer
(or you, if you need to re-create the environment) to install the same packages
using the same versions:
@@ -143,7 +150,7 @@ To install (make sure **virtualenv** is already installed):
.. code-block:: console
$ pip install virtualenvwrapper-win
-
+
In Windows, the default path for WORKON_HOME is %USERPROFILE%\Envs
Basic Usage
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index db029822b..549b8063f 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -3,6 +3,9 @@
Installing Python on Mac OS X
=============================
+.. note::
+ Check out our :ref:`guide for installing Python 3 on OS X`.
+
The latest version of Mac OS X, El Capitan, **comes with Python 2.7 out of the box**.
You do not need to install or configure anything else to use Python. Having said
diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst
new file mode 100644
index 000000000..d5a33291c
--- /dev/null
+++ b/docs/starting/install3/osx.rst
@@ -0,0 +1,116 @@
+.. _install3-osx:
+
+Installing Python 3 on Mac OS X
+================================
+
+The latest version of Mac OS X, El Capitan, **comes with Python 2.7 out of the box**.
+
+You do not need to install or configure anything else to use Python 2. These
+instructions document the installation of Python 3.
+
+The version of Python that ships with OS X is great for learning but it's not
+good for development. The version shipped with OS X may be out of date from the
+`official current Python release `_,
+which is considered the stable production version.
+
+Doing it Right
+--------------
+
+Let's install a real version of Python.
+
+Before installing Python, you'll need to install GCC. GCC can be obtained
+by downloading `XCode `_, the smaller
+`Command Line Tools `_ (must have an
+Apple account) or the even smaller `OSX-GCC-Installer `_
+package.
+
+.. note::
+ If you already have XCode installed, do not install OSX-GCC-Installer.
+ In combination, the software can cause issues that are difficult to
+ diagnose.
+
+.. note::
+ If you perform a fresh install of XCode, you will also need to add the
+ commandline tools by running ``xcode-select --install`` on the terminal.
+
+While OS X comes with a large number of UNIX utilities, those familiar with
+Linux systems will notice one key component missing: a package manager.
+`Homebrew `_ fills this void.
+
+To `install Homebrew `_, open :file:`Terminal` or
+your favorite OSX terminal emulator and run
+
+.. code-block:: console
+
+ $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+
+The script will explain what changes it will make and prompt you before the
+installation begins.
+Once you've installed Homebrew, insert the Homebrew directory at the top
+of your :envvar:`PATH` environment variable. You can do this by adding the following
+line at the bottom of your :file:`~/.profile` file
+
+.. code-block:: console
+
+ export PATH=/usr/local/bin:/usr/local/sbin:$PATH
+
+Now, we can install Python 3:
+
+.. code-block:: console
+
+ $ brew install python3
+
+This will take a minute or two.
+
+
+Pip
+----------------
+
+Homebrew installs ``pip3`` for you.
+
+``pip3`` is the alias for the Python 3 version of ``pip`` on systems with both
+the Homebrew'd Python 2 and 3 installed.
+
+Working with Python3
+--------------------
+
+At this point, you have the system Python 2.7 available, potentially the
+:ref:`Homebrew version of Python 2 ` installed, and the Homebrew
+version of Python 3 as well.
+
+.. code-block:: console
+
+ $ python
+
+will launch the Python 2 interpreter.
+
+.. code-block:: console
+
+ $ python3
+
+will launch the Python 3 interpreter
+
+``pip3`` and ``pip`` will both be available. If the Homebrew version of Python
+2 is not installed, they will be the same. If the Homebrew version of Python 2
+is installed then ``pip`` will point to Python 2 and ``pip3`` will point to
+Python 3.
+
+
+Virtual Environments
+--------------------
+
+A Virtual Environment (commonly referred to as a 'virtualenv') is a tool to keep
+the dependencies required by different projects in separate places, by creating
+virtual Python environments for them. It solves the "Project X depends on
+version 1.x but, Project Y needs 4.x" dilemma, and keeps your global
+site-packages directory clean and manageable.
+
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
+
+To start using this and see more information: :ref:`Virtual Environments ` docs.
+
+--------------------------------
+
+This page is a remixed version of `another guide `_,
+which is available under the same license.
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index c0118f68c..3c747bf03 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -13,9 +13,11 @@ other third-party Python libraries.
Installation Guides
-------------------
-These guides go over the proper installation of :ref:`Python 2.7 `
+These guides go over the proper installation of :ref:`Python `
for development purposes, as well as pip and virtualenv.
-- :ref:`Mac OS X `.
-- :ref:`Microsoft Windows `.
-- :ref:`Ubuntu Linux `.
+- :ref:`Python 3 on Mac OS X `.
+
+- :ref:`Python 2 on Mac OS X `.
+- :ref:`Python 2 on Microsoft Windows `.
+- :ref:`Python 2 on Ubuntu Linux `.
From 53a249a58ec90c04e92247c1fc22a2b69135062b Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Tue, 15 Mar 2016 09:47:32 -0400
Subject: [PATCH 010/500] Bad tick marks in virtualenv doc
---
docs/dev/virtualenvs.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index 90c7f19df..37841e214 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -12,7 +12,7 @@ For example, you can work on a project which requires Django 1.9 while also
maintaining a project which requires Django 1.8.
If you are using Python 3, make sure you run something like the following (or
-have it in your env variables in `~/.bashrc`):
+have it in your env variables in ``~/.bashrc``):
.. code-block:: console
From 9223381e4e695968931fa5f684cb5dafe2452593 Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Tue, 15 Mar 2016 10:00:26 -0400
Subject: [PATCH 011/500] Python3 stuff in virtualenv less prominent
---
docs/dev/virtualenvs.rst | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index 37841e214..ee05a1343 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -11,13 +11,6 @@ dilemma, and keeps your global site-packages directory clean and manageable.
For example, you can work on a project which requires Django 1.9 while also
maintaining a project which requires Django 1.8.
-If you are using Python 3, make sure you run something like the following (or
-have it in your env variables in ``~/.bashrc``):
-
-.. code-block:: console
-
- $ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
-
virtualenv
----------
@@ -50,13 +43,18 @@ in the current directory instead.
This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named :file:`venv`.
-You can also use the Python interpreter of your choice.
+You can also use the Python interpreter of your choice (like
+:file:`/usr/local/bin/python3`).
.. code-block:: console
$ virtualenv -p /usr/local/bin/python3 venv
-This will use the Python interpreter in :file:`/usr/local/bin/python3`
+or change the interpreter globally with an env variable in ``~/.bashrc``:
+
+.. code-block:: console
+
+ $ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
2. To begin using the virtual environment, it needs to be activated:
From a37543f242625fa199a10ec8a4a64f1d021a530b Mon Sep 17 00:00:00 2001
From: Joachim Jablon
Date: Thu, 17 Mar 2016 00:25:34 +0100
Subject: [PATCH 012/500] Fixes #686
---
docs/writing/structure.rst | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 7cde9daa1..6448dba77 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -658,8 +658,10 @@ And now the generator approach using Python's own
@contextmanager
def custom_open(filename):
f = open(filename)
- yield f
- f.close()
+ try:
+ yield f
+ finally:
+ f.close()
with custom_open('file') as f:
contents = f.read()
@@ -667,7 +669,9 @@ And now the generator approach using Python's own
This works in exactly the same way as the class example above, albeit it's
more terse. The ``custom_open`` function executes until it reaches the ``yield``
statement. It then gives control back to the ``with`` statement, which assigns
-whatever was ``yield``'ed to `f` in the ``as f`` portion.
+whatever was ``yield``'ed to `f` in the ``as f`` portion. The ``finally`` clause
+ensures that ``close()`` is called whether or not there was an exception inside
+the ``with``.
Since the two approaches appear the same, we should follow the Zen of Python
to decide when to use which. The class approach might be better if there's
From 49192a4317bc3d68bf0e43822a4151ae743254f0 Mon Sep 17 00:00:00 2001
From: Adam Liter
Date: Sat, 19 Mar 2016 22:44:22 -0400
Subject: [PATCH 013/500] Updates command for installing Homebrew
As can be seen on the Homebrew website (http://brew.sh/), it seems that
Homebrew is now recommending that you install Homebrew by calling
`/usr/bin/ruby` instead of just `ruby`.
---
docs/starting/install/osx.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index cb0062cc7..b401c5560 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -45,7 +45,7 @@ your favorite OSX terminal emulator and run
.. code-block:: console
- $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
+ $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
The script will explain what changes it will make and prompt you before the
installation begins.
From 6b4d013f52b241df97827cb73bd1a9d148634603 Mon Sep 17 00:00:00 2001
From: remcodraijer
Date: Thu, 24 Mar 2016 12:27:57 +0100
Subject: [PATCH 014/500] Changed summary line of docstring to follow PEP 0257
Quoting https://www.python.org/dev/peps/pep-0257/#one-line-docstrings
The docstring is a phrase ending in a period. It prescribes the function or method's effect as a command ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...".
---
docs/writing/tests.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index f014bfdfd..19e7ec0b6 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -116,7 +116,7 @@ A simple doctest in a function:
.. code-block:: python
def square(x):
- """Squares x.
+ """Square x.
>>> square(2)
4
From 02d68a86ed9a9bfce9bad6aa532646cfcbda67b6 Mon Sep 17 00:00:00 2001
From: remcodraijer
Date: Thu, 24 Mar 2016 12:33:39 +0100
Subject: [PATCH 015/500] Changed summary line of docstring to follow PEP 0257
- update
Quoting https://www.python.org/dev/peps/pep-0257/#one-line-docstrings
"The docstring is a phrase ending in a period. It prescribes the function or method's effect as a command ("Do this", "Return that"), not as a description; e.g. don't write "Returns the pathname ...".
---
docs/writing/tests.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 19e7ec0b6..84e5d27db 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -116,7 +116,7 @@ A simple doctest in a function:
.. code-block:: python
def square(x):
- """Square x.
+ """Return the square of x.
>>> square(2)
4
From cc6a4c03a8ee0d1dbbeaf50d0dfc2eaaa8f04bd7 Mon Sep 17 00:00:00 2001
From: Carlos de la Guardia
Date: Wed, 30 Mar 2016 23:53:51 -0600
Subject: [PATCH 016/500] Remove inaccurate comparison of Pyramid to Django.
Ass proposed in #693.
---
docs/scenarios/web.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index 19cddecb6..9dd3928b5 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -102,9 +102,9 @@ I do not recommend using Tornado unless you think you need it.
Pyramid
--------
-`Pyramid `_ is a lot like Django, except
-with a heavier focus on modularity. It comes with a smaller number of
-libraries ("batteries") built-in, and encourages users to extend its
+`Pyramid `_ is a very flexible
+framework with a heavy focus on modularity. It comes with a small number
+of libraries ("batteries") built-in, and encourages users to extend its
base functionality.
Pyramid does not have a large user base, unlike Django and Flask. It's a
From 205ffc7dd6495ff92c217c7f0dbe80f21d7d3a73 Mon Sep 17 00:00:00 2001
From: Steve Piercy
Date: Thu, 31 Mar 2016 05:31:40 -0700
Subject: [PATCH 017/500] use correct URL for Pyramid
wrap to 79 columns
---
docs/scenarios/web.rst | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index 9dd3928b5..601e880a1 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -102,10 +102,9 @@ I do not recommend using Tornado unless you think you need it.
Pyramid
--------
-`Pyramid `_ is a very flexible
-framework with a heavy focus on modularity. It comes with a small number
-of libraries ("batteries") built-in, and encourages users to extend its
-base functionality.
+`Pyramid `_ is a very flexible framework with a heavy
+focus on modularity. It comes with a small number of libraries ("batteries")
+built-in, and encourages users to extend its base functionality.
Pyramid does not have a large user base, unlike Django and Flask. It's a
capable framework, but not a very popular choice for new Python web
From 328a261c4fd30a9f66690d6c94bd9466a1abb66a Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Thu, 31 Mar 2016 09:37:57 -0400
Subject: [PATCH 018/500] Re-instated references to setuptools
---
docs/dev/virtualenvs.rst | 6 +++---
docs/starting/install/osx.rst | 15 ++++++++++-----
docs/starting/installation.rst | 5 ++---
3 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index ee05a1343..fa0bbfc8c 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -44,17 +44,17 @@ This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named :file:`venv`.
You can also use the Python interpreter of your choice (like
-:file:`/usr/local/bin/python3`).
+:file:`/usr/bin/python2.7`).
.. code-block:: console
- $ virtualenv -p /usr/local/bin/python3 venv
+ $ virtualenv -p /usr/bin/python2.7 venv
or change the interpreter globally with an env variable in ``~/.bashrc``:
.. code-block:: console
- $ export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
+ $ export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7
2. To begin using the virtual environment, it needs to be activated:
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index ae3f10aea..4ffba8648 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -11,7 +11,7 @@ The latest version of Mac OS X, El Capitan, **comes with Python 2.7 out of the b
You do not need to install or configure anything else to use Python. Having said
that, I would strongly recommend that you install the tools and libraries
described in the next section before you start building Python applications for
-real-world use. In particular, you should always install ``pip``, as it makes
+real-world use. In particular, you should always install Setuptools, as it makes
it much easier for you to install and manage other third-party Python libraries.
The version of Python that ships with OS X is great for learning but it's not
@@ -40,7 +40,7 @@ package.
commandline tools by running ``xcode-select --install`` on the terminal.
While OS X comes with a large number of UNIX utilities, those familiar with
-Linux systems will notice one key component missing: a package manager.
+Linux systems will notice one key component missing: a decent package manager.
`Homebrew `_ fills this void.
To `install Homebrew `_, open :file:`Terminal` or
@@ -69,13 +69,18 @@ Now, we can install Python 2.7:
This will take a minute or two.
-Pip
+Setuptools and Pip
----------------
-Homebrew installs ``pip`` for you.
+Homebrew installs Setuptools and ``pip`` for you.
+
+Setuptools enables you to download and install any compliant Python
+ -software over a network (usually the Internet) with a single command
+ -(``easy_install``). It also enables you to add this network installation
+ -capability to your own Python software with very little work.
``pip`` is a tool for easily installing and managing Python packages, that is
-recommended over the deprecated ``easy_install``. It is superior to
+recommended over ``easy_install``. It is superior to
``easy_install`` in `several ways
`_,
and is actively maintained.
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 3c747bf03..46b9fe4eb 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -7,17 +7,16 @@ If so, you do not need to install or configure anything else to use Python.
Having said that, I would strongly recommend that you install the tools and
libraries described in the guides below before you start building Python
applications for real-world use. In particular, you should always install
-Pip, and Virtualenv — they make it much easier for you to use
+Setuptools, Pip, and Virtualenv — they make it much easier for you to use
other third-party Python libraries.
Installation Guides
-------------------
These guides go over the proper installation of :ref:`Python `
-for development purposes, as well as pip and virtualenv.
+for development purposes, as well as setuptools, pip and virtualenv.
- :ref:`Python 3 on Mac OS X `.
-
- :ref:`Python 2 on Mac OS X `.
- :ref:`Python 2 on Microsoft Windows `.
- :ref:`Python 2 on Ubuntu Linux `.
From 9c703e6c702f65b5031fe741d5c184e35a0e5cf3 Mon Sep 17 00:00:00 2001
From: Terry Chia
Date: Fri, 1 Apr 2016 16:56:21 +0800
Subject: [PATCH 019/500] Update crypto.rst
Python 3.2 support has been dropped from pyca/cryptography as of April 2015. https://github.com/pyca/cryptography/pull/1846
---
docs/scenarios/crypto.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/crypto.rst b/docs/scenarios/crypto.rst
index 94bd58d11..e4b103a9d 100644
--- a/docs/scenarios/crypto.rst
+++ b/docs/scenarios/crypto.rst
@@ -6,7 +6,7 @@ Cryptography
`Cryptography `_ is an actively developed
library that provides cryptographic recipes and primitives. It supports
-Python 2.6-2.7, Python 3.2+ and PyPy.
+Python 2.6-2.7, Python 3.3+ and PyPy.
Cryptography is divided into two layers of recipes and hazardous materials
From 1a5d942353783ec1231756450138e35c6ffe91ce Mon Sep 17 00:00:00 2001
From: Nathaniel Irons
Date: Sun, 3 Apr 2016 11:53:21 -0700
Subject: [PATCH 020/500] Fix Xcode typo
---
docs/starting/install/osx.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index b401c5560..03426c554 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -22,18 +22,18 @@ Doing it Right
Let's install a real version of Python.
Before installing Python, you'll need to install GCC. GCC can be obtained
-by downloading `XCode `_, the smaller
+by downloading `Xcode `_, the smaller
`Command Line Tools `_ (must have an
Apple account) or the even smaller `OSX-GCC-Installer `_
package.
.. note::
- If you already have XCode installed, do not install OSX-GCC-Installer.
+ If you already have Xcode installed, do not install OSX-GCC-Installer.
In combination, the software can cause issues that are difficult to
diagnose.
.. note::
- If you perform a fresh install of XCode, you will also need to add the
+ If you perform a fresh install of Xcode, you will also need to add the
commandline tools by running ``xcode-select --install`` on the terminal.
While OS X comes with a large number of UNIX utilities, those familiar with
From f7f472883324db521eff10948d4ff7605510f15c Mon Sep 17 00:00:00 2001
From: gruzovator
Date: Tue, 19 Apr 2016 11:55:48 +0300
Subject: [PATCH 021/500] more simple rm pyc files command
---
docs/writing/gotchas.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst
index 62704c566..3a4c3350a 100644
--- a/docs/writing/gotchas.rst
+++ b/docs/writing/gotchas.rst
@@ -224,7 +224,7 @@ Removing Bytecode (.pyc) Files
Here's nice trick for removing all of these files, if they already exist::
- $ find . -name "*.pyc" -exec rm -rf {} \;
+ $ find . -name "*.pyc" -delete
Run that from the root directory of your project, and all ``.pyc`` files
will suddenly vanish. Much better.
From 44e72cd2e363551af589ef10987061a0a4e2fb04 Mon Sep 17 00:00:00 2001
From: Grant Regimbal
Date: Thu, 21 Apr 2016 19:44:26 -0500
Subject: [PATCH 022/500] link to pep 257
---
docs/writing/documentation.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index c6905e334..bd59437e8 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -108,7 +108,7 @@ In Python, *docstrings* describe modules, classes, and functions:
...
In general, follow the comment section of :pep:`8#comments` (the "Python Style
-Guide").
+Guide"). More information about docstrings can be found at :pep:`0257#specification` (The Docstring Conventions Guide).
Commenting Sections of Code
~~~~~~~~~~~~~~~~~~~~~~~~~~~
From bdf3e1ea92dfac8c2b5266f5926ed632e70bfc86 Mon Sep 17 00:00:00 2001
From: Tom
Date: Tue, 10 May 2016 17:05:23 -0600
Subject: [PATCH 023/500] Fix incorrect dictConfig example
dictConfig expects a special `root` key outside of the `loggers` subdictionary in order to configure the root logger. I've tried the existing example code on python 2.7.5 and 3.5.1, and in neither case does the final log line produce any output (because the root logger remains set to `looging.WARN` by default).
Changing the example to use the `root` key causes the log message to appear properly.
The `root` key is explained in PEP391: https://www.python.org/dev/peps/pep-0391/#dictionary-schema-detail
---
docs/writing/logging.rst | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst
index 8763e8dba..9b41abadf 100644
--- a/docs/writing/logging.rst
+++ b/docs/writing/logging.rst
@@ -163,10 +163,10 @@ the configuration dictionary.
'formatter': 'f',
'level': logging.DEBUG}
},
- loggers = {
- 'root': {'handlers': ['h'],
- 'level': logging.DEBUG}
- }
+ root = {
+ 'handlers': ['h'],
+ 'level': logging.DEBUG,
+ },
)
dictConfig(logging_config)
From 6eee93bb68d7a20f057cd712d87fbf78f3723e62 Mon Sep 17 00:00:00 2001
From: Stan Bright
Date: Fri, 27 May 2016 12:50:42 +0300
Subject: [PATCH 024/500] Add 'Awesome Python Newsletter' from LibHunt
---
docs/intro/news.rst | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/docs/intro/news.rst b/docs/intro/news.rst
index 429749016..54f8ff70f 100644
--- a/docs/intro/news.rst
+++ b/docs/intro/news.rst
@@ -47,3 +47,10 @@ Weekly Python Newsletter containing Python Articles, Projects, Videos, Tweets
delivered in your inbox. Keep Your Python Programming Skills Updated.
`Import Python Weekly Newsletter `_
+
+Awesome Python Newsletter
+~~~~~~~~~~~~~~~~~~~~
+
+A weekly overview of the most popular Python news, articles and packages.
+
+ `Awesome Python Newsletter `_
From 1d25e8bffe5bada0f188b56215ef21e9bb2ca482 Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Fri, 3 Jun 2016 15:24:21 +0800
Subject: [PATCH 025/500] Added a bit about concurrent.futures
---
docs/scenarios/speed.rst | 127 ++++++++++++++++++++++++++++++++++++++-
1 file changed, 125 insertions(+), 2 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 6050c98f5..9cba3e278 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -226,9 +226,130 @@ Numba
-----
.. todo:: Write about Numba and the autojit compiler for NumPy
-Threading
-:::::::::
+Concurrency
+:::::::::::
+
+
+Concurrent.futures
+------------------
+The `concurrent.futures`_ module is a module in the standard library that
+provides a "high-level interface for asynchronously executing callables". It
+abstracts away a lot of the more complicated details about using multiple
+threads or processes for concurrency, and allows the user to focus on
+accomplishing the task at hand.
+
+The `concurrent.futures`_ module exposes two main classes, the
+`ThreadPoolExecutor` and the `ProcessPoolExecutor`. The ThreadPoolExecutor
+will create a pool of worker threads that a user can submit jobs to. These jobs
+will then be executed in another thread when the next worker thread becomes
+available.
+
+The ProcessPoolExecutor works in the same way, except instead of using multiple
+threads for its workers, it will use multiple processes. This makes it possible
+to side-step the GIL, however because of the way things are passed to worker
+processes, only picklable objects can be executed and returned.
+
+Because of the way the GIL works, a good rule of thumb is to use a
+ThreadPoolExecutor when the task being executed involves a lot of blocking
+(i.e. making requests over the network) and to use a ProcessPoolExecutor
+executor when the task is computationally expensive.
+
+There are two main ways of executing things in parallel using the two
+Executors. One way is with the `map(func, iterables)` method. This works
+almost exactly like the builtin `map()` function, except it will execute
+everything in parallel. ::
+
+ from concurrent.futures import ThreadPoolExecutor
+ import requests
+
+ def get_webpage(url):
+ """
+ Some blocking function.
+ """
+ page = requests.get(url)
+ return page
+
+ pool = ThreadPoolExecutor(max_workers=5)
+
+ my_urls = ['http://google.com/']*10 # Create a list of urls
+
+ for page in pool.map(get_webpage, my_urls):
+ # Do something with the result
+ print(page.text)
+
+For even more control, the `submit(func, *args, **kwargs)` method will schedule
+a callable to be executed ( as `func(*args, **kwargs)`) and returns a `Future`_
+object that represents the execution of the callable.
+
+The Future object provides various methods that can be used to check on the
+progress of the scheduled callable. These include:
+
+cancel()
+ Attempt to cancel the call.
+cancelled()
+ Return True if the call was successfully cancelled.
+running()
+ Return True if the call is currently being executed and cannot be
+ cancelled.
+done()
+ Return True if the call was successfully cancelled or finished running.
+result()
+ Return the value returned by the call. Note that this call will block until
+ the scheduled callable returns by default.
+exception()
+ Return the exception raised by the call. If no exception was raised then
+ this returns `None`. Note that this will block just like `result()`.
+add_done_callback(fn)
+ Attach a callback function that will be executed (as `fn(future)`) when the
+ scheduled callable returns.
+
+::
+
+ from concurrent.futures import ProcessPoolExecutor, as_completed
+
+ def is_prime(n):
+ if n % 2 == 0:
+ return n, False
+
+ sqrt_n = int(n**0.5)
+ for i in range(3, sqrt_n + 1, 2):
+ if n % i == 0:
+ return n, False
+ return n, True
+
+ PRIMES = [
+ 112272535095293,
+ 112582705942171,
+ 112272535095293,
+ 115280095190773,
+ 115797848077099,
+ 1099726899285419]
+
+ futures = []
+ with ProcessPoolExecutor(max_workers=4) as pool:
+ # Schedule the ProcessPoolExecutor to check if a number is prime
+ # and add the returned Future to our list of futures
+ for p in PRIMES:
+ fut = pool.submit(is_prime, p)
+ futures.append(fut)
+
+ # As the jobs are completed, print out the results
+ for number, result in as_completed(futures):
+ if result:
+ print("{} is prime".format(number))
+ else:
+ print("{} is not prime".format(number))
+
+The `concurrent.futures`_ module contains two helper functions for working with
+Futures. The `as_completed(futures)` function returns an iterator over the list
+of futures, yielding the futures as they complete.
+
+The `wait(futures)` function will simply block until all futures in the list of
+futures provided have completed.
+
+For more information, on using the `concurrent.futures`_ module, consult the
+official documentation.
Threading
---------
@@ -248,3 +369,5 @@ Multiprocessing
.. _`New GIL`: http://www.dabeaz.com/python/NewGIL.pdf
.. _`Special care`: http://docs.python.org/c-api/init.html#threads
.. _`David Beazley's`: http://www.dabeaz.com/GIL/gilvis/measure2.py
+.. _`concurrent.futures`: https://docs.python.org/3/library/concurrent.futures.html
+.. _`Future`: https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future
From 75e957e89e83da75ff7c50a1d5e79e6e7e50e10d Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Fri, 3 Jun 2016 16:06:11 +0800
Subject: [PATCH 026/500] Wrote a bit about threading
---
docs/scenarios/speed.rst | 74 ++++++++++++++++++++++++++++++++++++++--
1 file changed, 71 insertions(+), 3 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 9cba3e278..16f5d53a6 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -264,9 +264,6 @@ everything in parallel. ::
import requests
def get_webpage(url):
- """
- Some blocking function.
- """
page = requests.get(url)
return page
@@ -354,6 +351,74 @@ official documentation.
Threading
---------
+The standard library comes with a `threading`_ module that allows a user to
+work with multiple threads manually.
+
+Running a function in another thread is as simple as passing a callable and
+it's arguments to `Thread`'s constructor and then calling `start()`::
+
+ from threading import Thread
+ import requests
+
+ def get_webpage(url):
+ page = requests.get(url)
+ return page
+
+ some_thread = Thread(get_webpage, 'http://google.com/')
+ some_thread.start()
+
+To wait until the thread has terminated, call `join()`::
+
+ some_thread.join()
+
+After calling `join()`, it is always a good idea to check whether the thread is
+still alive (because the join call timed out)::
+
+ if some_thread.is_alive():
+ print("join() must have timed out.")
+ else:
+ print("Our thread has terminated.")
+
+Because multiple threads have access to the same section of memory, sometimes
+there might be situations where two or more threads are trying to write to the
+same resource at the same time or where the output is dependent on the sequence
+or timing of certain events. This is called a `data race`_ or race condition.
+When this happens, the output will be garbled or you may encounter problems
+which are difficult to debug. A good example is this `stackoverflow post`_.
+
+The way this can be avoided is by using a `Lock`_ that each thread needs to
+acquire before writing to a shared resource. Locks can be acquired and released
+through either the contextmanager protocol (`with` statement), or by using
+`acquire()` and `release()` directly. Here is a (rather contrived) example::
+
+ from threading import Lock, Thread
+
+ file_lock = Lock()
+
+ def log(msg):
+ with file_lock:
+ open('website_changes.log', 'w') as f:
+ f.write(changes)
+
+ def monitor_website(some_website):
+ """
+ Monitor a website and then if there are any changes, log them to disk.
+ """
+ while True:
+ changes = check_for_changes(some_website)
+ if changes:
+ log(changes)
+
+ websites = ['http://google.com/', ... ]
+ for website in websites:
+ t = Thread(monitor_website, website)
+ t.start()
+
+Here, we have a bunch of threads checking for changes on a list of sites and
+whenever there are any changes, they attempt to write those changes to a file
+by calling `log(changes)`. When `log()` is called, it will wait to acquire
+the lock with `with file_lock:`. This ensures that at any one time, only one
+thread is writing to the file.
Spawning Processes
------------------
@@ -371,3 +436,6 @@ Multiprocessing
.. _`David Beazley's`: http://www.dabeaz.com/GIL/gilvis/measure2.py
.. _`concurrent.futures`: https://docs.python.org/3/library/concurrent.futures.html
.. _`Future`: https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Future
+.. _`threading`: https://docs.python.org/3/library/threading.html
+.. _`stackoverflow post`: http://stackoverflow.com/questions/26688424/python-threads-are-printing-at-the-same-time-messing-up-the-text-output
+.. _`data race`: https://en.wikipedia.org/wiki/Race_condition
From dde23c230e84b92e436b4657a80708ba2decad3f Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Fri, 3 Jun 2016 16:15:00 +0800
Subject: [PATCH 027/500] Converted "::" to proper python code-block directives
---
docs/scenarios/speed.rst | 27 ++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 16f5d53a6..21166b275 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -258,7 +258,9 @@ executor when the task is computationally expensive.
There are two main ways of executing things in parallel using the two
Executors. One way is with the `map(func, iterables)` method. This works
almost exactly like the builtin `map()` function, except it will execute
-everything in parallel. ::
+everything in parallel. :
+
+.. code-block:: python
from concurrent.futures import ThreadPoolExecutor
import requests
@@ -301,7 +303,8 @@ add_done_callback(fn)
Attach a callback function that will be executed (as `fn(future)`) when the
scheduled callable returns.
-::
+
+.. code-block:: python
from concurrent.futures import ProcessPoolExecutor, as_completed
@@ -355,7 +358,9 @@ The standard library comes with a `threading`_ module that allows a user to
work with multiple threads manually.
Running a function in another thread is as simple as passing a callable and
-it's arguments to `Thread`'s constructor and then calling `start()`::
+it's arguments to `Thread`'s constructor and then calling `start()`:
+
+.. code-block:: python
from threading import Thread
import requests
@@ -367,12 +372,16 @@ it's arguments to `Thread`'s constructor and then calling `start()`::
some_thread = Thread(get_webpage, 'http://google.com/')
some_thread.start()
-To wait until the thread has terminated, call `join()`::
+To wait until the thread has terminated, call `join()`:
+
+.. code-block:: python
some_thread.join()
After calling `join()`, it is always a good idea to check whether the thread is
-still alive (because the join call timed out)::
+still alive (because the join call timed out):
+
+.. code-block:: python
if some_thread.is_alive():
print("join() must have timed out.")
@@ -389,7 +398,10 @@ which are difficult to debug. A good example is this `stackoverflow post`_.
The way this can be avoided is by using a `Lock`_ that each thread needs to
acquire before writing to a shared resource. Locks can be acquired and released
through either the contextmanager protocol (`with` statement), or by using
-`acquire()` and `release()` directly. Here is a (rather contrived) example::
+`acquire()` and `release()` directly. Here is a (rather contrived) example:
+
+
+.. code-block:: python
from threading import Lock, Thread
@@ -402,7 +414,8 @@ through either the contextmanager protocol (`with` statement), or by using
def monitor_website(some_website):
"""
- Monitor a website and then if there are any changes, log them to disk.
+ Monitor a website and then if there are any changes,
+ log them to disk.
"""
while True:
changes = check_for_changes(some_website)
From 5888db734d010fa329bbe5cbfbf4d69926fb4e95 Mon Sep 17 00:00:00 2001
From: dfowler
Date: Fri, 3 Jun 2016 17:57:03 -0400
Subject: [PATCH 028/500] Fix a few typos
---
docs/scenarios/db.rst | 2 +-
docs/writing/structure.rst | 2 +-
docs/writing/style.rst | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst
index a2de7fe55..3ed11914f 100644
--- a/docs/scenarios/db.rst
+++ b/docs/scenarios/db.rst
@@ -29,7 +29,7 @@ Records
`Records `_ is minimalist SQL library,
designed for sending raw SQL queries to various databases. Data can be used
-programatically, or exported to a number of useful data formats.
+programmatically, or exported to a number of useful data formats.
.. code-block:: console
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 6448dba77..4f8bb3713 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -600,7 +600,7 @@ clearer and thus preferred.
This mechanism is useful for separating concerns and avoiding
external un-related logic 'polluting' the core logic of the function
or method. A good example of a piece of functionality that is better handled
-with decoration is memoization or caching: you want to store the results of an
+with decoration is memorization or caching: you want to store the results of an
expensive function in a table and use them directly instead of recomputing
them when they have already been computed. This is clearly not part
of the function logic.
diff --git a/docs/writing/style.rst b/docs/writing/style.rst
index b91656989..2b2c7c804 100644
--- a/docs/writing/style.rst
+++ b/docs/writing/style.rst
@@ -455,9 +455,9 @@ PEP 8
easy-to-read version of PEP 8 is also available at `pep8.org `_.
This is highly recommended reading. The entire Python community does their
-best to adhere to the guidelines laidout within this document. Some project
+best to adhere to the guidelines laid out within this document. Some project
may sway from it from time to time, while others may
-`ammend its recommendations `_.
+`amend its recommendations `_.
That being said, conforming your Python code to PEP 8 is generally a good
idea and helps make code more consistent when working on projects with other
From 8b674a5b3089ef9033566bf50434d66e557b8b36 Mon Sep 17 00:00:00 2001
From: Zev Averbach
Date: Fri, 3 Jun 2016 16:06:45 -0700
Subject: [PATCH 029/500] changed "tenants" to "tenets"
Tenants are people who pay rent; tenets are principles or beliefs.
---
docs/writing/reading.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/reading.rst b/docs/writing/reading.rst
index 39b0888bf..97342250a 100644
--- a/docs/writing/reading.rst
+++ b/docs/writing/reading.rst
@@ -1,7 +1,7 @@
Reading Great Code
==================
-One of the core tenants behind the design of Python is creating
+One of the core tenets behind the design of Python is creating
readable code. The motivation behind this design is simple: The number
one thing that Python programmers do is read code.
From 4fb3bf7b4a9638ce7d69cb4bde6bcfaf543710c2 Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Sun, 12 Jun 2016 19:51:46 +0800
Subject: [PATCH 030/500] Wrote a bit about docstrings
---
docs/writing/documentation.rst | 120 +++++++++++++++++++++++++++++++++
1 file changed, 120 insertions(+)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index bd59437e8..cb541e13c 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -65,6 +65,11 @@ There is also **great**, **free** hosting for your Sphinx_ docs:
your source repository so that rebuilding your documentation will
happen automatically.
+When run, Sphinx_ will import your code and using Python's introspection
+features it will extract all function, method and class signatures. It will
+also extract the accompanying docstrings, and compile it all into well
+structured and easily readable documentation for your project.
+
.. note::
Sphinx is famous for its API generation, but it also works well
@@ -127,6 +132,30 @@ Some tools use docstrings to embed more-than-documentation behavior,
such as unit test logic. Those can be nice, but you won't ever go
wrong with vanilla "here's what this does."
+Tools like Sphinx_ will parse your docstrings as reStructuredText and render it
+correctly as HTML. This makes it very easy to embed snippets of example code in
+a project's documentation.
+
+Additionally, Doctest_ will read all embedded docstrings that look like input
+from the Python commandline (prefixed with ">>>") and run them, checking to see
+if the output of the command matches the text on the following line. This
+allows developers to embed real examples and usage of functions alongside
+their source code, and as a side effect, it also ensures that their code is
+tested and works.
+
+::
+
+ def my_function(a, b):
+ """
+ >>> my_function(2, 3)
+ 6
+ >>> my_function('a', 3)
+ 'aaa'
+ """
+ return a * b
+
+.. _Doctest: https://docs.python.org/3/library/doctest.html
+
Docstrings versus Block comments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -141,8 +170,99 @@ comment block is a programmer's note. The docstring describes the
"""Returns the square root of self times self."""
...
+Unlike block comments, docstrings are built into the Python language itself.
+This means you can use all of Python's powerful introspection capabilities to
+access docstrings at runtime, compared with comments which are optimised out.
+Docstrings are accessible from both the `__doc__` dunder attribute for almost
+every Python object, as well as with the built in `help()` function.
+
+While block comments are usually used to explain *what* a section of code is
+doing, or the specifics of an algorithm, docstrings are more intended for
+explaining to other users of your code (or you in 6 months time) *how* a
+particular function can be used and the general purpose of a function, class,
+or module.
+
+Writing Docstrings
+~~~~~~~~~~~~~~~~~~
+
+Depending on the complexity of the function, method, or class being written, a
+one-line docstring may be perfectly appropriate. These are generally used for
+really obvious cases, such as::
+
+ def add(a, b):
+ """Add two numbers and return the result."""
+ return a + b
+
+The docstring should describe the function in a way that is easy to understand.
+Embedding the function's signature in the docstring is unnecessary because it
+can easily be obtained using the `inspect` module, and doesn't provide much
+additional information.
+
+For more complex cases, there are a couple generally accepted styles used
+when writing documentation. The first of these uses reStructuredText syntax
+to format arguments and other elements of the docstring appropriately::
+
+ def function1(self, arg1, arg2, arg3):
+ """A short, one line summary of the function.
+
+ This is a longer explanation, which may include math with
+ latex syntax :math:`\\alpha`.
+
+ :param arg1: the first value
+ :param arg2: the first value
+ :param arg3: the first value
+ :type arg1: int, float,...
+ :type arg2: int, float,...
+ :type arg3: int, float,...
+ :returns: arg1/arg2 +arg3
+ :rtype: int, float
+ """
+ return arg1/arg2 + arg3
+
+`thomas-cokelaer.info`_ has a fairly complete article showing more examples for
+this style.
+
+While the end result is parsed by Sphinx and renders correctly in a browser, it
+isn't the easiest of formats to read. The `NumPy style`_ is a lot nicer to read,
+however it consumes a lot more real estate than the previous style::
+
+ def random_number_generator(arg1, arg2):
+ """
+ Summary line.
+
+ Extended description of function.
+
+ Parameters
+ ----------
+ arg1 : int
+ Description of arg1
+ arg2 : str
+ Description of arg2
+
+ Returns
+ -------
+ int
+ Description of return value
+
+ """
+ return 42
+
+The `sphinx.ext.napoleon`_ plugin allows Sphinx to parse this style of
+docstrings, making it easy to incorporate NumPy style docstrings into your
+project.
+
+At the end of the day, it doesn't really matter what style is used for writing
+docstrings, their purpose is to serve as documentation for anyone who may need
+to read or make changes to your code. As long as it is correct, understandable
+and gets the relevant points across then it has done the job it was designed to
+do.
+
+
.. see also:: Further reading on docstrings: :pep:`257`
+.. _thomas-cokelaer.info: http://thomas-cokelaer.info/tutorials/sphinx/docstring_python.html
+.. _sphinx.ext.napoleon: https://sphinxcontrib-napoleon.readthedocs.io/
+.. _`NumPy style`: http://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_numpy.html
Other Tools
-----------
From fb388b8f7bffabc728b1a90178eed16515f61585 Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Sun, 12 Jun 2016 19:53:40 +0800
Subject: [PATCH 031/500] changed the pep 257 line from a see also to a normal
line
---
docs/writing/documentation.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index cb541e13c..036868167 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -258,7 +258,7 @@ and gets the relevant points across then it has done the job it was designed to
do.
-.. see also:: Further reading on docstrings: :pep:`257`
+For further reading on docstrings, feel free to consult :pep:`257`
.. _thomas-cokelaer.info: http://thomas-cokelaer.info/tutorials/sphinx/docstring_python.html
.. _sphinx.ext.napoleon: https://sphinxcontrib-napoleon.readthedocs.io/
From 3c0b0270baad77a813bf1dedb5674ba159f966d1 Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Mon, 13 Jun 2016 09:49:18 +0800
Subject: [PATCH 032/500] Removed the rst/sphinx-style docstring example
---
docs/writing/documentation.rst | 31 ++++---------------------------
1 file changed, 4 insertions(+), 27 deletions(-)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index 036868167..c5f822197 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -198,33 +198,10 @@ Embedding the function's signature in the docstring is unnecessary because it
can easily be obtained using the `inspect` module, and doesn't provide much
additional information.
-For more complex cases, there are a couple generally accepted styles used
-when writing documentation. The first of these uses reStructuredText syntax
-to format arguments and other elements of the docstring appropriately::
-
- def function1(self, arg1, arg2, arg3):
- """A short, one line summary of the function.
-
- This is a longer explanation, which may include math with
- latex syntax :math:`\\alpha`.
-
- :param arg1: the first value
- :param arg2: the first value
- :param arg3: the first value
- :type arg1: int, float,...
- :type arg2: int, float,...
- :type arg3: int, float,...
- :returns: arg1/arg2 +arg3
- :rtype: int, float
- """
- return arg1/arg2 + arg3
-
-`thomas-cokelaer.info`_ has a fairly complete article showing more examples for
-this style.
-
-While the end result is parsed by Sphinx and renders correctly in a browser, it
-isn't the easiest of formats to read. The `NumPy style`_ is a lot nicer to read,
-however it consumes a lot more real estate than the previous style::
+For more detailed documentation of code a popular style is the one used for the
+Numpy project, often called `Numpy style`_ docstrings. While it can take up a
+few more lines than usual, it allows the developer to include a lot more
+information about a method, function, or class. ::
def random_number_generator(arg1, arg2):
"""
From 10defd73a2f1cb34887f178dc119c32c2dbbba8d Mon Sep 17 00:00:00 2001
From: Michael Bryan
Date: Mon, 13 Jun 2016 10:07:29 +0800
Subject: [PATCH 033/500] Added a bit so the transition from short to long
docstrings flows better
---
docs/writing/documentation.rst | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index c5f822197..b15935179 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -194,14 +194,20 @@ really obvious cases, such as::
return a + b
The docstring should describe the function in a way that is easy to understand.
-Embedding the function's signature in the docstring is unnecessary because it
-can easily be obtained using the `inspect` module, and doesn't provide much
-additional information.
+For simple cases like trivial functions and classes, simply embedding the
+function's signature (i.e. `add(a, b) -> result`) in the docstring is
+unnecessary. This is because with Python's `inspect` module, it is already
+quite easy to find this information if needed, and it is also readily available
+by reading the source code.
+
+In larger or more complex projects however, it is often a good idea to give
+more information about a function, what it does, any exceptions it may raise,
+what it returns, or relevant details about the parameters.
For more detailed documentation of code a popular style is the one used for the
Numpy project, often called `Numpy style`_ docstrings. While it can take up a
-few more lines than usual, it allows the developer to include a lot more
-information about a method, function, or class. ::
+few more lines the previous example, it allows the developer to include a lot
+more information about a method, function, or class. ::
def random_number_generator(arg1, arg2):
"""
From fc8788b2300f6674764d20bf2f0835a0cc38b544 Mon Sep 17 00:00:00 2001
From: Rahiel Kasim
Date: Tue, 14 Jun 2016 14:04:43 +0200
Subject: [PATCH 034/500] speed.rst: PEP8 in examples
PEP8
---
docs/scenarios/speed.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 21166b275..fc038c1c7 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -108,7 +108,7 @@ keywords compared to the next one, which is implemented in pure Python:
def primes(kmax):
"""Calculation of prime numbers in standard Python syntax"""
- p= range(1000)
+ p = range(1000)
result = []
if kmax > 1000:
kmax = 1000
@@ -145,7 +145,7 @@ to be compiled into C types while also creating a Python list:
def primes(kmax):
"""Calculation of prime numbers in standard Python syntax"""
- p= range(1000)
+ p = range(1000)
result = []
What is the difference? In the upper Cython version you can see the
From 7c7fe74dab50e5ee722ad0ca434398cee505dd4a Mon Sep 17 00:00:00 2001
From: Abhishek Kumar Singh
Date: Mon, 20 Jun 2016 18:06:58 +0530
Subject: [PATCH 035/500] Update admin.rst with monitoring tool shinken.
---
docs/scenarios/admin.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index f0b56a695..55926fd14 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -380,3 +380,13 @@ environment can be created, and many are already available.
Buidout is written in Python.
+Shinken
+-------
+
+`Shinken `_ is a modern, Nagios compatible monitoring framework, written in Python.
+Its main goal is to give users a flexible architecture for their monitoring
+system that is designed to scale to large environments.
+
+Shinken is backwards-compatible with the Nagios configuration standard and plugins.
+It works on any operating system and architecture that supports Python, which includes
+Windows, GNU/Linux and FreeBSD.
From 2ed32ebe0d9b683f48dab70c4a5600669ecfbb03 Mon Sep 17 00:00:00 2001
From: kikisdeliveryservice
Date: Mon, 20 Jun 2016 13:38:23 -0700
Subject: [PATCH 036/500] Clean up of intro paragraphs for clarity.
---
docs/writing/style.rst | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/writing/style.rst b/docs/writing/style.rst
index 2b2c7c804..0c6037223 100644
--- a/docs/writing/style.rst
+++ b/docs/writing/style.rst
@@ -3,17 +3,17 @@
Code Style
==========
-If you ask Python programmers what they like most in Python, they will
-often say its high readability. Indeed, a high level of readability
+If you ask Python programmers what they like most about Python, they will
+often cite its high readability. Indeed, a high level of readability
is at the heart of the design of the Python language, following the
recognized fact that code is read much more often than it is written.
-One reason for Python code to be easily read and understood is its relatively
+One reason for the high readability of Python code is its relatively
complete set of Code Style guidelines and "Pythonic" idioms.
-Moreover, when a veteran Python developer (a Pythonista) points to portions of
-code and says they are not "Pythonic", it usually means that these lines
-of code do not follow the common guidelines and fail to express the intent in
+When a veteran Python developer (a Pythonista) calls portions of
+code not "Pythonic", they usually mean that these lines
+of code do not follow the common guidelines and fail to express its intent in
what is considered the best (hear: most readable) way.
On some border cases, no best way has been agreed upon on how to express
@@ -53,7 +53,7 @@ One statement per line
While some compound statements such as list comprehensions are
allowed and appreciated for their brevity and their expressiveness,
-it is bad practice to have two disjoint statements on the same line of code.
+it is bad practice to have two disjointed statements on the same line of code.
**Bad**
From 673ed9a74218fbdb3d14e923e21e9be8bbce4d5c Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Mon, 20 Jun 2016 23:16:50 -0400
Subject: [PATCH 037/500] oreilly book
---
docs/_templates/sidebarintro.html | 7 +++++++
docs/_templates/sidebarlogo.html | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index b52228cd5..400b66ac2 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -20,6 +20,13 @@
This guide is now available for pre-order in tangible book form!
+
+
+
+
All proceeds are being directly donated to the DjangoGirls organization.
Other Projects
From 30f19999fd5823f85bd6f535504188b49c9d4baf Mon Sep 17 00:00:00 2001
From: Abhishek Kumar Singh
Date: Tue, 21 Jun 2016 12:54:55 +0530
Subject: [PATCH 038/500] Corrected Oxford comma. Close #238
Signed-off-by: Abhishek Kumar Singh
---
docs/scenarios/admin.rst | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 55926fd14..69e66d491 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -383,10 +383,11 @@ Buidout is written in Python.
Shinken
-------
-`Shinken `_ is a modern, Nagios compatible monitoring framework, written in Python.
-Its main goal is to give users a flexible architecture for their monitoring
-system that is designed to scale to large environments.
-
-Shinken is backwards-compatible with the Nagios configuration standard and plugins.
-It works on any operating system and architecture that supports Python, which includes
-Windows, GNU/Linux and FreeBSD.
+`Shinken `_ is a modern, Nagios compatible
+monitoring framework written in Python.Its main goal is to give users a flexible
+architecture for their monitoring system that is designed to scale to large
+environments.
+
+Shinken is backwards-compatible with the Nagios configuration standard and
+plugins.It works on any operating system and architecture that supports Python
+which includes Windows, GNU/Linux and FreeBSD.
From a64d47166c198f3161b8c3d25121e97da4d59cfa Mon Sep 17 00:00:00 2001
From: Abhishek Kumar Singh
Date: Tue, 21 Jun 2016 13:00:42 +0530
Subject: [PATCH 039/500] Added Oxford Comma!
Signed-off-by: Abhishek Kumar Singh
---
docs/scenarios/admin.rst | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 69e66d491..7fbc9b51b 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -384,10 +384,10 @@ Shinken
-------
`Shinken `_ is a modern, Nagios compatible
-monitoring framework written in Python.Its main goal is to give users a flexible
+monitoring framework written in Python. Its main goal is to give users a flexible
architecture for their monitoring system that is designed to scale to large
environments.
-Shinken is backwards-compatible with the Nagios configuration standard and
-plugins.It works on any operating system and architecture that supports Python
-which includes Windows, GNU/Linux and FreeBSD.
+Shinken is backwards-compatible with the Nagios configuration standard, and
+plugins.It works on any operating system, and architecture that supports Python
+which includes Windows, GNU/Linux, and FreeBSD.
From 081c47511f6f7357154b9738ac5c3df6ffac0b6b Mon Sep 17 00:00:00 2001
From: nhumrich
Date: Tue, 21 Jun 2016 12:28:06 -0600
Subject: [PATCH 040/500] Update cli.rst
Add cement to cli frameworks
---
docs/scenarios/cli.rst | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst
index c8cdcec73..ccd968146 100644
--- a/docs/scenarios/cli.rst
+++ b/docs/scenarios/cli.rst
@@ -62,3 +62,13 @@ subcommands, output formatters, and other extensions. The framework is meant
to be used to create multi-level commands such as subversion and git, where
the main program handles some basic argument parsing and then invokes a
sub-command to do the work.
+
+Cement
+------
+
+`Cement `_ is an advanced CLI Application Framework.
+Its goal is to introduce a standard, and feature-full platform
+for both simple and complex command line applications as well
+as support rapid development needs without sacrificing quality.
+Cement is flexible, and it's use cases span from the simplicity of a micro-framework
+to the complexity of a meg-framework.
From 122f67bf050d35530aee4fc6d8886b4ba73f6cdd Mon Sep 17 00:00:00 2001
From: kikisdeliveryservice
Date: Tue, 21 Jun 2016 13:06:58 -0700
Subject: [PATCH 041/500] Clean up of tests.rst
---
docs/writing/tests.rst | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 84e5d27db..08495300d 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -3,8 +3,8 @@ Testing Your Code
Testing your code is very important.
-Getting used to writing the testing code and the running code in parallel is
-now considered a good habit. Used wisely, this method helps you define more
+Getting used to writing testing code and running this code in parallel is now
+considered a good habit. Used wisely, this method helps you define more
precisely your code's intent and have a more decoupled architecture.
Some general rules of testing:
@@ -12,8 +12,8 @@ Some general rules of testing:
- A testing unit should focus on one tiny bit of functionality and prove it
correct.
-- Each test unit must be fully independent. Each of them must be able to run
- alone, and also within the test suite, regardless of the order they are
+- Each test unit must be fully independent. Each test must be able to run
+ alone, and also within the test suite, regardless of the order that they are
called. The implication of this rule is that each test must be loaded with
a fresh dataset and may have to do some cleanup afterwards. This is
usually handled by :meth:`setUp()` and :meth:`tearDown()` methods.
@@ -27,8 +27,8 @@ Some general rules of testing:
tests as often as needed.
- Learn your tools and learn how to run a single test or a test case. Then,
- when developing a function inside a module, run this function's tests very
- often, ideally automatically when you save the code.
+ when developing a function inside a module, run this function's tests
+ frequently, ideally automatically when you save the code.
- Always run the full test suite before a coding session, and run it again
after. This will give you more confidence that you did not break anything
@@ -63,11 +63,11 @@ Some general rules of testing:
- Another use of the testing code is as an introduction to new developers. When
someone will have to work on the code base, running and reading the related
- testing code is often the best they can do. They will or should discover the
- hot spots, where most difficulties arise, and the corner cases. If they have
- to add some functionality, the first step should be to add a test and, by this
- means, ensure the new functionality is not already a working path that has not
- been plugged into the interface.
+ testing code is often the best thing that they can do to start. They will
+ or should discover the hot spots, where most difficulties arise, and the
+ corner cases. If they have to add some functionality, the first step should
+ be to add a test to ensure that the new functionality is not already a
+ working path that has not been plugged into the interface.
The Basics
::::::::::
From 82a89026b9300322443a135e962b7784fdd00d1a Mon Sep 17 00:00:00 2001
From: Aaron Peschel
Date: Tue, 28 Jun 2016 15:53:53 -0700
Subject: [PATCH 042/500] Don't treat targets as files
Currently, this sample Makefile has problems if there are any
files/directories named init or test in the same directory as the
makefile. This commit adds a phony to the sample Makefile so that these
targets are not treated as files.
---
docs/writing/structure.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 4f8bb3713..31f387ec9 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -254,6 +254,8 @@ your project.
test:
py.test tests
+ .PHONY init test
+
Other generic management scripts (e.g. ``manage.py``
or ``fabfile.py``) belong at the root of the repository as well.
From a603b95c8746f0a6333ec7fa31e4536a47a0868c Mon Sep 17 00:00:00 2001
From: Don Jayamanne
Date: Wed, 6 Jul 2016 17:17:28 +1000
Subject: [PATCH 043/500] updated to include a reference to VS Code
---
docs/dev/env.rst | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 41ec2d70e..3e0325336 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -150,6 +150,14 @@ features can be brought to IntelliJ with the free
versions of PyCharm: Professional Edition (Free 30-day trial) and Community
Edition(Apache 2.0 License) with fewer features.
+Python (on Visual Studio Code)
+-----------------------------
+
+`Python for Visual Studio `_ is an extension for the `Visual Studio Code IDE `_.
+This is a free, light weight and open source IDE, with support for Mac, Windows and Linux.
+Built using open source technologies such as NodeJs and Python, with compelling features such as Intellisense (autocompletion), local and remote debugging, linting, and the like.
+MIT licensed.
+
Enthought Canopy
----------------
`Enthought Canopy `_ is a Python
From 46ca5e9323b250d9d3addff93b066c49bc1edbe5 Mon Sep 17 00:00:00 2001
From: Don Jayamanne
Date: Thu, 7 Jul 2016 00:23:31 +1000
Subject: [PATCH 044/500] fixed review issues
---
docs/dev/env.rst | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 3e0325336..d5870274a 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -154,8 +154,9 @@ Python (on Visual Studio Code)
-----------------------------
`Python for Visual Studio `_ is an extension for the `Visual Studio Code IDE `_.
-This is a free, light weight and open source IDE, with support for Mac, Windows and Linux.
-Built using open source technologies such as NodeJs and Python, with compelling features such as Intellisense (autocompletion), local and remote debugging, linting, and the like.
+This is a free, light weight, open source IDE, with support for Mac, Windows, and Linux.
+Built using open source technologies such as Node.js and Python, with compelling features such as Intellisense (autocompletion), local and remote debugging, linting, and the like.
+
MIT licensed.
Enthought Canopy
From d0d6f664edbf2ea2b3d34aaaebbaf6959b74fe24 Mon Sep 17 00:00:00 2001
From: Thomas Gratier
Date: Sat, 9 Jul 2016 10:33:07 +0200
Subject: [PATCH 045/500] Duplicated word
---
docs/scenarios/clibs.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/clibs.rst b/docs/scenarios/clibs.rst
index 290638e73..bae907b6b 100644
--- a/docs/scenarios/clibs.rst
+++ b/docs/scenarios/clibs.rst
@@ -39,7 +39,7 @@ types, such as structs and unions, and allows you to modify things such as
padding and alignment, if needed. It can be a bit crufty to use, but in
conjunction with the `struct `_
module, you are essentially provided full control over how your data types get
-translated into something something usable by a pure C(++) method.
+translated into something usable by a pure C(++) method.
Struct Equivalents
~~~~~~~~~~~~~~~~~~
From 82ef7f39ba6fc1570e29707eb0a332bca9e82232 Mon Sep 17 00:00:00 2001
From: Thomas Gratier
Date: Sat, 9 Jul 2016 22:46:17 +0200
Subject: [PATCH 046/500] Remove duplicated "in" word
---
docs/scenarios/admin.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 7fbc9b51b..835622395 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -190,7 +190,7 @@ Ansible
`Ansible `_ is an open source system automation tool.
The biggest advantage over Puppet or Chef is it does not require an agent on
the client machine. Playbooks are Ansible’s configuration, deployment, and
-orchestration language and are written in in YAML with Jinja2 for templating.
+orchestration language and are written in YAML with Jinja2 for templating.
Ansible supports Python versions 2.6 and 2.7 and can be installed via pip:
From 730c97f4afcaf9c5348e23c8358e48fc2a37c32b Mon Sep 17 00:00:00 2001
From: Thomas Gratier
Date: Sun, 10 Jul 2016 00:12:12 +0200
Subject: [PATCH 047/500] Fix typo: infrustructure to infrastructure
---
docs/scenarios/admin.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 835622395..0bd928dd5 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -262,7 +262,7 @@ To create a simple cookbook the `knife `_ comma
`Getting started with Chef `_
is a good starting point for Chef Beginners and many community maintained cookbooks that can
-serve as a good reference or tweaked to serve your infrustructure configuration needs can be
+serve as a good reference or tweaked to serve your infrastructure configuration needs can be
found on the `Chef Supermarket `_.
- `Chef Documentation `_
From ecb39fcf6a8f3b80abfab3aeef7af5c977c2a5be Mon Sep 17 00:00:00 2001
From: Thomas Gratier
Date: Sat, 16 Jul 2016 21:48:36 +0200
Subject: [PATCH 048/500] Indent unindented content in numbered list
---
docs/writing/style.rst | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/docs/writing/style.rst b/docs/writing/style.rst
index 0c6037223..7454e9465 100644
--- a/docs/writing/style.rst
+++ b/docs/writing/style.rst
@@ -124,13 +124,13 @@ inside the function) that was added "just in case" and is seemingly never used,
than to add a new optional argument and its logic when needed.
3. The **arbitrary argument list** is the third way to pass arguments to a
-function. If the function intention is better expressed by a signature with an
-extensible number of positional arguments, it can be defined with the ``*args``
-constructs. In the function body, ``args`` will be a tuple of all the
-remaining positional arguments. For example, ``send(message, *args)`` can be
-called with each recipient as an argument: ``send('Hello', 'God', 'Mom',
-'Cthulhu')``, and in the function body ``args`` will be equal to ``('God',
-'Mom', 'Cthulhu')``.
+ function. If the function intention is better expressed by a signature with
+ an extensible number of positional arguments, it can be defined with the
+ ``*args`` constructs. In the function body, ``args`` will be a tuple of all
+ the remaining positional arguments. For example, ``send(message, *args)``
+ can be called with each recipient as an argument:``send('Hello', 'God',
+ 'Mom', 'Cthulhu')``, and in the function body ``args`` will be equal to
+ ``('God', 'Mom', 'Cthulhu')``.
However, this construct has some drawbacks and should be used with caution. If a
function receives a list of arguments of the same nature, it is often more
From f31ca0a5fbdb7531d752f668816b7aa8108dcac4 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Mon, 18 Jul 2016 14:07:09 -0400
Subject: [PATCH 049/500] french!
---
docs/_templates/sidebarintro.html | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 400b66ac2..e9162697b 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -60,7 +60,8 @@
\ No newline at end of file
+
From c31000c6b8c1c520086af755645a21876bb6bacc Mon Sep 17 00:00:00 2001
From: Manas
Date: Wed, 27 Jul 2016 12:28:41 +0530
Subject: [PATCH 051/500] Update startproject in example
start-project should be startproject
https://docs.djangoproject.com/en/1.9/ref/django-admin/#django-admin-startproject
---
docs/writing/structure.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 31f387ec9..7879d1707 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -271,7 +271,7 @@ following, as they always have:
::
- $ django-admin.py start-project samplesite
+ $ django-admin.py startproject samplesite
The resulting repository structure looks like this:
@@ -293,7 +293,7 @@ Let's do it properly:
::
- $ django-admin.py start-project samplesite .
+ $ django-admin.py startproject samplesite .
Note the "``.``".
From ca64c6f722c00226bdfd30a58a6efc9f0bd45c3b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Hermann?=
Date: Wed, 27 Jul 2016 23:05:53 +0200
Subject: [PATCH 052/500] Mention dh-virtualenv in the Tools list
---
docs/shipping/packaging.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst
index 1c659610f..596ebafc1 100644
--- a/docs/shipping/packaging.rst
+++ b/docs/shipping/packaging.rst
@@ -184,3 +184,4 @@ Useful Tools
- `fpm `_
- `alien `_
+- `dh-virtualenv `_ (for APT/DEB omnibus packaging)
From f86e9cc096174967105c76954055e27dd92e25cb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Konrad=20F=C3=B6rstner?=
Date: Fri, 29 Jul 2016 08:29:18 +0200
Subject: [PATCH 053/500] Update link for rpy2
---
docs/scenarios/scientific.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/scientific.rst b/docs/scenarios/scientific.rst
index 8600bc9b2..92c8c801b 100644
--- a/docs/scenarios/scientific.rst
+++ b/docs/scenarios/scientific.rst
@@ -94,7 +94,7 @@ auto-alignment of data.
Rpy2
----
-`Rpy2 `_ is a Python binding for the R
+`Rpy2 `_ is a Python binding for the R
statistical package allowing the execution of R functions from Python and
passing data back and forth between the two environments. Rpy2 is the object
oriented implementation of the `Rpy `_
From 1bcc6d5cc84b5de6c2c5fccda45b0529556a7924 Mon Sep 17 00:00:00 2001
From: Robson Roberto Souza Peixoto
Date: Mon, 1 Aug 2016 00:43:48 -0300
Subject: [PATCH 054/500] Cleaning up *.py[co] and __pycache__ tip
---
docs/writing/gotchas.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst
index 3a4c3350a..f8e2e2377 100644
--- a/docs/writing/gotchas.rst
+++ b/docs/writing/gotchas.rst
@@ -224,7 +224,7 @@ Removing Bytecode (.pyc) Files
Here's nice trick for removing all of these files, if they already exist::
- $ find . -name "*.pyc" -delete
+ $ find . -type f -name "*.py[co]" -delete -or -type d -name "__pycache__" -delete
Run that from the root directory of your project, and all ``.pyc`` files
will suddenly vanish. Much better.
From 91df42f1708875a095561965a2816774ea41fbb2 Mon Sep 17 00:00:00 2001
From: Kevin Ndung'u
Date: Wed, 10 Aug 2016 16:58:21 +0300
Subject: [PATCH 055/500] Fix .PHONY target rule
.PHONY should be followed by a colon
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 7879d1707..ef0184e7e 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -254,7 +254,7 @@ your project.
test:
py.test tests
- .PHONY init test
+ .PHONY: init test
Other generic management scripts (e.g. ``manage.py``
or ``fabfile.py``) belong at the root of the repository as well.
From 7adc9c0d030622b6896c5aa82ef4cb48828851a0 Mon Sep 17 00:00:00 2001
From: Ahmad Jarara
Date: Sun, 28 Aug 2016 17:35:52 -0400
Subject: [PATCH 056/500] fix memoization typo, link to wikipedia's overview
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index ef0184e7e..87395c473 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -602,7 +602,7 @@ clearer and thus preferred.
This mechanism is useful for separating concerns and avoiding
external un-related logic 'polluting' the core logic of the function
or method. A good example of a piece of functionality that is better handled
-with decoration is memorization or caching: you want to store the results of an
+with decoration is `memoization ` or caching: you want to store the results of an
expensive function in a table and use them directly instead of recomputing
them when they have already been computed. This is clearly not part
of the function logic.
From 71257bed9e3c06c0e962712026791d855c7c14f8 Mon Sep 17 00:00:00 2001
From: Ahmad Jarara
Date: Mon, 29 Aug 2016 20:49:31 -0400
Subject: [PATCH 057/500] fixing markup on memoization link hint
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 87395c473..a156fba7f 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -602,7 +602,7 @@ clearer and thus preferred.
This mechanism is useful for separating concerns and avoiding
external un-related logic 'polluting' the core logic of the function
or method. A good example of a piece of functionality that is better handled
-with decoration is `memoization ` or caching: you want to store the results of an
+with decoration is `memoization `__ or caching: you want to store the results of an
expensive function in a table and use them directly instead of recomputing
them when they have already been computed. This is clearly not part
of the function logic.
From f0867fe4d68b681de130973c692801858f1dcc2d Mon Sep 17 00:00:00 2001
From: Ahmad Jarara
Date: Wed, 31 Aug 2016 14:45:35 -0400
Subject: [PATCH 058/500] include instructions to preview changes in CONTRIB
---
CONTRIBUTING.md | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 481f3f63c..83a9cd76f 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -6,6 +6,28 @@ see:
http://docs.python-guide.org/en/latest/notes/contribute/
+How to test your changes
+------------------------
+
+The html version of this guide is built with [sphinx](http://www.sphinx-doc.org/en/stable/). You may test your revisions locally by having sphinx installed. You can do this easily with pip (as described in the link).
+
+``` bash
+pip install --user sphinx
+```
+
+Then navigate to the directory of the makefile and ```make build``` or ```make html```. Sphinx will then generate the html in a folder called _build/html
+
+After navigating to this folder, you can then use python's built in webserver to view your changes locally:
+
+``` bash
+python3 -m http.server
+```
+
+By default, http.server listens on every ip address bound on your host on port 8000. To bind to a specific one, say, localhost on port 8005:
+
+``` bash
+python3 -m http.server 8005 --bind 127.0.0.1
+```
Style Guide
-----------
From 15396a5403a1563ecab439415ed7631fd6ea6cee Mon Sep 17 00:00:00 2001
From: denfromufa
Date: Thu, 1 Sep 2016 15:31:20 -0500
Subject: [PATCH 059/500] Update which-python.rst
Pythonnet supports from Python 2.6 up to Python 3.5
---
docs/starting/which-python.rst | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index b07b634f0..26732e34e 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -137,12 +137,12 @@ installation with the .NET Common Language Runtime (CLR). This is the
inverse approach to that taken by IronPython (see above), to which it
is more complementary than competing with.
-In conjunction with Mono, PythonNet enables native Python
+In conjunction with Mono, pythonnet enables native Python
installations on non-Windows operating systems, such as OS X and
Linux, to operate within the .NET framework. It can be run in
addition to IronPython without conflict.
-PythonNet supports from Python 2.3 up to Python 2.7. [#pythonnet_ver]_
+Pythonnet supports from Python 2.6 up to Python 3.5. [#pythonnet_ver1]_ [#pythonnet_ver2]_
.. [#pypy_ver] http://pypy.org/compat.html
@@ -150,6 +150,8 @@ PythonNet supports from Python 2.3 up to Python 2.7. [#pythonnet_ver]_
.. [#iron_ver] http://ironpython.codeplex.com/releases/view/81726
-.. [#pythonnet_ver] http://pythonnet.github.io/readme.html
+.. [#pythonnet_ver1] https://travis-ci.org/pythonnet/pythonnet
+
+.. [#pythonnet_ver2] https://ci.appveyor.com/project/TonyRoberts/pythonnet-480xs
.. [#pep373_eol] https://www.python.org/dev/peps/pep-0373/#id2
From cfb46b56ae8735fbd5d269e9df57b1349cc3472c Mon Sep 17 00:00:00 2001
From: Ruben Roy
Date: Wed, 14 Sep 2016 04:49:03 +0530
Subject: [PATCH 060/500] Update contents.rst.inc
Fixes layout issue in subsection 1.2.1 with latex
---
docs/contents.rst.inc | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc
index c2c603dec..f84b3f06e 100644
--- a/docs/contents.rst.inc
+++ b/docs/contents.rst.inc
@@ -7,16 +7,10 @@ New to Python? Let's properly setup up your Python environment.
:maxdepth: 2
starting/which-python
-
-- Properly Install Python
-
- .. toctree::
- :maxdepth: 1
-
- starting/installation
- starting/install/osx
- starting/install/win
- starting/install/linux
+ starting/installation
+ starting/install/osx
+ starting/install/win
+ starting/install/linux
From af7d603e977efc2156d8c9e3c51b5ccb0ce4f91c Mon Sep 17 00:00:00 2001
From: Adam Chainz
Date: Wed, 21 Sep 2016 08:31:09 +0100
Subject: [PATCH 061/500] Convert readthedocs links for their .org -> .io
migration for hosted projects
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
As per [their blog post of the 27th April](https://blog.readthedocs.com/securing-subdomains/) ‘Securing subdomains’:
> Starting today, Read the Docs will start hosting projects from subdomains on the domain readthedocs.io, instead of on readthedocs.org. This change addresses some security concerns around site cookies while hosting user generated data on the same domain as our dashboard.
Test Plan: Manually visited all the links I’ve modified.
---
docs/_templates/sidebarintro.html | 8 ++++----
docs/_templates/sidebarlogo.html | 8 ++++----
docs/dev/virtualenvs.rst | 6 +++---
docs/intro/learning.rst | 2 +-
docs/scenarios/ci.rst | 2 +-
docs/scenarios/clibs.rst | 2 +-
docs/scenarios/db.rst | 6 +++---
docs/scenarios/gui.rst | 2 +-
docs/scenarios/imaging.rst | 6 +++---
docs/scenarios/json.rst | 2 +-
docs/scenarios/web.rst | 14 +++++++-------
docs/shipping/packaging.rst | 4 ++--
docs/starting/install/osx.rst | 2 +-
docs/writing/tests.rst | 2 +-
14 files changed, 33 insertions(+), 33 deletions(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index e9162697b..2c085fc5d 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -60,8 +60,8 @@
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index bb3f9487c..848d7ae34 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -122,7 +122,7 @@ control by adding it to the ignore list.
virtualenvwrapper
-----------------
-`virtualenvwrapper `_
+`virtualenvwrapper `_
provides a set of commands which makes working with virtual environments much
more pleasant. It also places all your virtual environments in one place.
@@ -134,7 +134,7 @@ To install (make sure **virtualenv** is already installed):
$ export WORKON_HOME=~/Envs
$ source /usr/local/bin/virtualenvwrapper.sh
-(`Full virtualenvwrapper install instructions `_.)
+(`Full virtualenvwrapper install instructions `_.)
For Windows, you can use the `virtualenvwrapper-win `_.
@@ -206,7 +206,7 @@ Other useful commands
``lssitepackages``
Shows contents of :file:`site-packages` directory.
-`Full list of virtualenvwrapper commands `_.
+`Full list of virtualenvwrapper commands `_.
virtualenv-burrito
------------------
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index 8ab660867..823da5bab 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -38,7 +38,7 @@ without having to install Python locally.
If you want a more traditional book, *Python For You and Me* is an excellent
resource for learning all aspects of the language.
- `Python for You and Me `_
+ `Python for You and Me `_
Online Python Tutor
~~~~~~~~~~~~~~~~~~~
diff --git a/docs/scenarios/ci.rst b/docs/scenarios/ci.rst
index aa8d1968f..16e0ea0df 100644
--- a/docs/scenarios/ci.rst
+++ b/docs/scenarios/ci.rst
@@ -35,7 +35,7 @@ automate the compile/test cycle to validate code changes.
Tox
---
-`tox `_ is an automation tool providing
+`tox `_ is an automation tool providing
packaging, testing and deployment of Python software right from the console or
CI server. It is a generic virtualenv management and test command line tool
which provides the following features:
diff --git a/docs/scenarios/clibs.rst b/docs/scenarios/clibs.rst
index bae907b6b..82e041fe3 100644
--- a/docs/scenarios/clibs.rst
+++ b/docs/scenarios/clibs.rst
@@ -4,7 +4,7 @@ Interfacing with C/C++ Libraries
C Foreign Function Interface
----------------------------
-`CFFI `_ provides a simple to use
+`CFFI `_ provides a simple to use
mechanism for interfacing with C from both CPython and PyPy. It supports two
modes: an inline ABI compatibility mode (example provided below), which allows
you to dynamically load and run functions from executable modules (essentially
diff --git a/docs/scenarios/db.rst b/docs/scenarios/db.rst
index 3ed11914f..58d9cd20b 100644
--- a/docs/scenarios/db.rst
+++ b/docs/scenarios/db.rst
@@ -60,11 +60,11 @@ peewee
`peewee `_ is another ORM with a focus
on being lightweight with support for Python 2.6+ and 3.2+ which supports
SQLite, MySQL and Postgres by default. The
-`model layer `_
+`model layer `_
is similar to that of the Django ORM and it has
-`SQL-like methods `_
+`SQL-like methods `_
to query data. While SQLite, MySQL and Postgres are supported out-of-the-box,
-there is a `collection of add-ons `_
+there is a `collection of add-ons `_
available.
PonyORM
diff --git a/docs/scenarios/gui.rst b/docs/scenarios/gui.rst
index 854fb826c..f56b212b7 100644
--- a/docs/scenarios/gui.rst
+++ b/docs/scenarios/gui.rst
@@ -28,7 +28,7 @@ applications be ported from PyGTK to PyGObject.
PyGObject aka (PyGi)
--------------------
`PyGObject `_ provides Python bindings, which gives access to the entire GNOME software platform.
-It is fully compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3 Tutorial `_.
+It is fully compatible with GTK+ 3. Here is a tutorial to get started with `Python GTK+ 3 Tutorial `_.
`API Reference `_
diff --git a/docs/scenarios/imaging.rst b/docs/scenarios/imaging.rst
index 23ecece49..49d3af1eb 100644
--- a/docs/scenarios/imaging.rst
+++ b/docs/scenarios/imaging.rst
@@ -24,7 +24,7 @@ Installation
Before installing Pillow, you'll have to install Pillow's prerequisites. Find
the instructions for your platform in the
-`Pillow installation instructions `_.
+`Pillow installation instructions `_.
After that, it's straightforward:
@@ -57,7 +57,7 @@ Example
exif_data
There are more examples of the Pillow library in the
-`Pillow tutorial `_.
+`Pillow tutorial `_.
OpenSource Computer Vision
@@ -104,4 +104,4 @@ Example
There are more Python-implemented examples of OpenCV in this `collection of
tutorials
-`_.
+`_.
diff --git a/docs/scenarios/json.rst b/docs/scenarios/json.rst
index b5145fc4c..860e79435 100644
--- a/docs/scenarios/json.rst
+++ b/docs/scenarios/json.rst
@@ -47,7 +47,7 @@ simplejson
The JSON library was added to Python in version 2.6.
If you're using an earlier version of Python, the
-`simplejson `_ library is
+`simplejson `_ library is
available via PyPI.
simplejson mimics the json standard library. It is available so that developers
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index 601e880a1..9e07a59f5 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -154,7 +154,7 @@ Gunicorn is the recommended choice for new Python web applications today.
Waitress
--------
-`Waitress `_ is a pure-python WSGI server
+`Waitress `_ is a pure-python WSGI server
that claims "very acceptable performance". Its documentation is not very
detailed, but it does offer some nice functionality that Gunicorn doesn't have
(e.g. HTTP request buffering).
@@ -166,18 +166,18 @@ Waitress is gaining popularity within the Python web development community.
uWSGI
-----
-`uWSGI `_ is a full stack for building
+`uWSGI `_ is a full stack for building
hosting services. In addition to process management, process monitoring,
and other functionality, uWSGI acts as an application server for various
programming languages and protocols - including Python and WSGI. uWSGI can
either be run as a stand-alone web router, or be run behind a full web
server (such as Nginx or Apache). In the latter case, a web server can
configure uWSGI and an application's operation over the
-`uwsgi protocol `_.
+`uwsgi protocol `_.
uWSGI's web server support allows for dynamically configuring
Python, passing environment variables and further tuning. For full details,
see `uWSGI magic
-variables `_.
+variables `_.
I do not recommend using uWSGI unless you know why you need it.
@@ -393,10 +393,10 @@ Jinja2 is the recommended templating library for new Python web applications.
Chameleon
---------
-`Chameleon `_ Page Templates are an HTML/XML template
+`Chameleon `_ Page Templates are an HTML/XML template
engine implementation of the `Template Attribute Language (TAL) `_,
-`TAL Expression Syntax (TALES) `_,
-and `Macro Expansion TAL (Metal) `_ syntaxes.
+`TAL Expression Syntax (TALES) `_,
+and `Macro Expansion TAL (Metal) `_ syntaxes.
Chameleon is available for Python 2.5 and up (including 3.x and pypy), and
is commonly used by the `Pyramid Framework `_.
diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst
index 596ebafc1..c67957529 100644
--- a/docs/shipping/packaging.rst
+++ b/docs/shipping/packaging.rst
@@ -25,7 +25,7 @@ and being able and willing to use tools such as pip to install your code's
other dependencies. This is fine when distributing to other developers, but
makes this method unsuitable for distributing applications to end-users.
-The `Python Packaging Guide `_
+The `Python Packaging Guide `_
provides an extensive guide on creating and maintaining Python packages.
Alternatives to Packaging
@@ -184,4 +184,4 @@ Useful Tools
- `fpm `_
- `alien `_
-- `dh-virtualenv `_ (for APT/DEB omnibus packaging)
+- `dh-virtualenv `_ (for APT/DEB omnibus packaging)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 03426c554..422248590 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -77,7 +77,7 @@ software over a network (usually the Internet) with a single command
capability to your own Python software with very little work.
``pip`` is a tool for easily installing and managing Python packages,
-that is recommended over ``easy_install``. It is superior to ``easy_install`` in `several ways `_,
+that is recommended over ``easy_install``. It is superior to ``easy_install`` in `several ways `_,
and is actively maintained.
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index 08495300d..b8b7ca022 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -202,7 +202,7 @@ nose provides automatic test discovery to save you the hassle of manually
creating test suites. It also provides numerous plugins for features such as
xUnit-compatible test output, coverage reporting, and test selection.
- `nose `_
+ `nose `_
tox
From 1caa6c77509c1453fb36dfa498b94358015d6b66 Mon Sep 17 00:00:00 2001
From: "Tim D. Smith"
Date: Thu, 22 Sep 2016 12:39:35 -0700
Subject: [PATCH 062/500] CLT are not needed if full Xcode is installed
---
docs/starting/install/osx.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 422248590..b6eb13572 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -32,10 +32,6 @@ package.
In combination, the software can cause issues that are difficult to
diagnose.
-.. note::
- If you perform a fresh install of Xcode, you will also need to add the
- commandline tools by running ``xcode-select --install`` on the terminal.
-
While OS X comes with a large number of UNIX utilities, those familiar with
Linux systems will notice one key component missing: a decent package manager.
`Homebrew `_ fills this void.
From 359e4b9e3d066d3f3f9c10dbad2af5bf4e78220a Mon Sep 17 00:00:00 2001
From: "Tim D. Smith"
Date: Thu, 22 Sep 2016 12:40:43 -0700
Subject: [PATCH 063/500] Don't specifically need gcc
---
docs/starting/install/osx.rst | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index b6eb13572..3d14254ea 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -21,10 +21,10 @@ Doing it Right
Let's install a real version of Python.
-Before installing Python, you'll need to install GCC. GCC can be obtained
-by downloading `Xcode `_, the smaller
-`Command Line Tools `_ (must have an
-Apple account) or the even smaller `OSX-GCC-Installer `_
+Before installing Python, you'll need to install a C compiler. A compiler can be
+obtained by downloading `Xcode `_, the
+smaller `Command Line Tools `_ (must
+have an Apple account) or the even smaller `OSX-GCC-Installer `_
package.
.. note::
From 1d516898b3f6872b8cda1b823797781f64cfb87d Mon Sep 17 00:00:00 2001
From: "Tim D. Smith"
Date: Thu, 22 Sep 2016 12:45:16 -0700
Subject: [PATCH 064/500] Update guidance on C toolchains
---
docs/starting/install/osx.rst | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 3d14254ea..e8aa1dfd7 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -21,16 +21,18 @@ Doing it Right
Let's install a real version of Python.
-Before installing Python, you'll need to install a C compiler. A compiler can be
-obtained by downloading `Xcode `_, the
-smaller `Command Line Tools `_ (must
-have an Apple account) or the even smaller `OSX-GCC-Installer `_
+Before installing Python, you'll need to install a C compiler. The fastest way
+is to install the Xcode Command Line Tools by running
+``xcode-select --install``. You can also download the full version of
+`Xcode `_ from the Mac App Store, or the
+minimal but unofficial
+`OSX-GCC-Installer `_
package.
.. note::
- If you already have Xcode installed, do not install OSX-GCC-Installer.
- In combination, the software can cause issues that are difficult to
- diagnose.
+ If you already have Xcode installed or plan to use Homebrew, do not install
+ OSX-GCC-Installer. In combination, the software can cause issues that are
+ difficult to diagnose.
While OS X comes with a large number of UNIX utilities, those familiar with
Linux systems will notice one key component missing: a decent package manager.
From 2423a9da64181d8a55be72fc269e7f6ac3d011f1 Mon Sep 17 00:00:00 2001
From: "Tim D. Smith"
Date: Thu, 22 Sep 2016 12:45:24 -0700
Subject: [PATCH 065/500] Offer guidance on Python 3
---
docs/starting/install/osx.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index e8aa1dfd7..5c73d69a2 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -61,6 +61,12 @@ Now, we can install Python 2.7:
$ brew install python
+or Python 3:
+
+.. code-block:: console
+
+ $ brew install python3
+
This will take a minute or two.
From ab3332e42c0ba4694e171090d564aa5a0af5d53f Mon Sep 17 00:00:00 2001
From: Kishor Bhat
Date: Thu, 29 Sep 2016 11:36:11 +0530
Subject: [PATCH 066/500] Remove redundant statement
---
docs/scenarios/admin.rst | 2 --
1 file changed, 2 deletions(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 0bd928dd5..8e738d9c0 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -378,8 +378,6 @@ Buildout is primarily used to download and set up dependencies in Python eggs
format of the software being developed or deployed. Recipes for build tasks in any
environment can be created, and many are already available.
-Buidout is written in Python.
-
Shinken
-------
From 5ad43199debdd2d33eab35190c8c3a9d4f60ca42 Mon Sep 17 00:00:00 2001
From: Sidney Pham
Date: Fri, 7 Oct 2016 15:53:05 +1100
Subject: [PATCH 067/500] Fixed example docstring
---
docs/writing/documentation.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/documentation.rst b/docs/writing/documentation.rst
index bd59437e8..7e10ab49f 100644
--- a/docs/writing/documentation.rst
+++ b/docs/writing/documentation.rst
@@ -104,7 +104,7 @@ In Python, *docstrings* describe modules, classes, and functions:
.. code-block:: python
def square_and_rooter(x):
- """Returns the square root of self times self."""
+ """Return the square root of self times self."""
...
In general, follow the comment section of :pep:`8#comments` (the "Python Style
From 25dc76e5365ba6a9833163dbf3450da227c71d21 Mon Sep 17 00:00:00 2001
From: Kishor Bhat
Date: Fri, 7 Oct 2016 15:36:14 +0530
Subject: [PATCH 068/500] Remove numba todo; already taken care of under
scenarios/scientific.rst
---
docs/scenarios/speed.rst | 4 ----
1 file changed, 4 deletions(-)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index fc038c1c7..2c775b880 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -222,10 +222,6 @@ Pyrex
Shedskin?
---------
-Numba
------
-.. todo:: Write about Numba and the autojit compiler for NumPy
-
Concurrency
:::::::::::
From 473f4c77a7aee526f3658188d036e2db58b67b89 Mon Sep 17 00:00:00 2001
From: Austin
Date: Sun, 16 Oct 2016 09:00:42 -0400
Subject: [PATCH 069/500] Remove Ubuntu specification
The linked page is general to linux, and specifically mentions CentOS, Fedora, RHEL and Ubuntu. It does not contain any information that is specific to Ubuntu only.
---
docs/starting/installation.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 04aaaa0b8..5df0035f3 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -18,4 +18,4 @@ for development purposes, as well as setuptools, pip, and virtualenv setup.
- :ref:`Mac OS X `.
- :ref:`Microsoft Windows `.
-- :ref:`Ubuntu Linux `.
+- :ref:`Linux `.
From 111c5d67698604526de994d222665a0bab536561 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 20 Oct 2016 02:24:28 -0400
Subject: [PATCH 070/500] available now!
---
docs/_templates/sidebarintro.html | 2 +-
docs/_templates/sidebarlogo.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 2c085fc5d..5a49dc072 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -22,7 +22,7 @@
Stay Informed
O'Reilly Book
-
This guide is now available for pre-order in tangible book form!
+
This guide is now available in tangible book form!
This guide is now available for pre-order in tangible book form!
+
This guide is now available in tangible book form!
From d67923cf94d20db423cee2b841415ba4a4b36535 Mon Sep 17 00:00:00 2001
From: Aditya
Date: Wed, 26 Oct 2016 19:12:11 +0530
Subject: [PATCH 071/500] Update the link for latest available Python 2.7
release for Windows
---
docs/starting/install/win.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index a34566ecc..674bb683f 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -3,7 +3,7 @@
Installing Python on Windows
============================
-First, download the `latest version `_
+First, download the `latest version `_
of Python 2.7 from the official Website. If you want to be sure you are installing a fully
up-to-date version, click the Downloads > Windows link from the home page of the
`Python.org web site `_ .
From be8ce2704df28a3279ee1d6f5809ee776dcf327d Mon Sep 17 00:00:00 2001
From: Aditya
Date: Wed, 26 Oct 2016 20:37:54 +0530
Subject: [PATCH 072/500] Update to recent versions of Django for virtualenv
example
---
docs/dev/virtualenvs.rst | 4 ++--
docs/starting/install/linux.rst | 4 ++--
docs/starting/install/osx.rst | 4 ++--
docs/starting/install/win.rst | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index 848d7ae34..e6be87f89 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -8,8 +8,8 @@ projects in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
dilemma, and keeps your global site-packages directory clean and manageable.
-For example, you can work on a project which requires Django 1.3 while also
-maintaining a project which requires Django 1.0.
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
virtualenv
----------
diff --git a/docs/starting/install/linux.rst b/docs/starting/install/linux.rst
index e68c5d0d5..aa56ec07d 100644
--- a/docs/starting/install/linux.rst
+++ b/docs/starting/install/linux.rst
@@ -55,8 +55,8 @@ in separate places, by creating virtual Python environments for them. It solves
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
your global site-packages directory clean and manageable.
-For example, you can work on a project which requires Django 1.3 while also
-maintaining a project which requires Django 1.0.
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
To start using this and see more information: :ref:`Virtual Environments ` docs.
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 422248590..a4fa0cf04 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -89,8 +89,8 @@ in separate places, by creating virtual Python environments for them. It solves
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
your global site-packages directory clean and manageable.
-For example, you can work on a project which requires Django 1.3 while also
-maintaining a project which requires Django 1.0.
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
To start using this and see more information: :ref:`Virtual Environments ` docs.
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index 674bb683f..131ace663 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -74,8 +74,8 @@ in separate places, by creating virtual Python environments for them. It solves
"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
your global site-packages directory clean and manageable.
-For example, you can work on a project which requires Django 1.3 while also
-maintaining a project which requires Django 1.0.
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
To start using this and see more information: :ref:`Virtual Environments ` docs.
From fe7467bcc426bada462c77087085ca1389341e5e Mon Sep 17 00:00:00 2001
From: Adam Zapletal
Date: Sat, 29 Oct 2016 18:24:14 -0500
Subject: [PATCH 073/500] Update link to Mercurial site
---
docs/scenarios/cli.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst
index c8cdcec73..899979215 100644
--- a/docs/scenarios/cli.rst
+++ b/docs/scenarios/cli.rst
@@ -16,7 +16,7 @@ Some popular command-line applications include:
* `httpie `_ - A command line HTTP
client, a user-friendly cURL replacement
* `git `_ - A distributed version control system
-* `mercurial `_ - A distributed version control
+* `mercurial `_ - A distributed version control
system primarily written in Python
Clint
From 27c1567df56125359f96dad9d31e2664a025ddde Mon Sep 17 00:00:00 2001
From: Shiven Mian
Date: Mon, 31 Oct 2016 14:50:30 +0530
Subject: [PATCH 074/500] added machine learning docs
---
docs/scenarios/ml.rst | 117 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 117 insertions(+)
create mode 100644 docs/scenarios/ml.rst
diff --git a/docs/scenarios/ml.rst b/docs/scenarios/ml.rst
new file mode 100644
index 000000000..25cab8045
--- /dev/null
+++ b/docs/scenarios/ml.rst
@@ -0,0 +1,117 @@
+================
+Machine Learning
+================
+
+Python has a vast number of libraries for data analysis, statistics and Machine Learning itself, making it a language of choice for many data scientists.
+
+Some widely used packages for Machine Learning and other Data Science applications are enlisted below.
+
+Scipy Stack
+-----------
+
+The Scipy stack consists of a bunch of core helper packages used in data science, for statistical analysis and visualising data. Because of its huge number of functionalities and ease of use, the Stack is considered a must-have for most data science applications.
+
+The Stack consists of the following packages (link to documentation given):
+
+1. `NumPy `_
+2. `SciPy library `_
+3. `Matplotlib `_
+4. `IPython `_
+5. `pandas `_
+6. `Sympy `_
+7. `nose `_
+
+The stack also comes with Python bundled in, but has been excluded from the above list.
+
+Installation
+~~~~~~~~~~~~
+
+For installing the full stack, or individual packages, you can refer to the instructions given `here `_.
+
+**NB:** `Anaconda `_ is highly preferred and recommended for installing and maintaining data science packages seamlessly.
+
+scikit-learn
+------------
+
+Scikit is a free and open-source machine learning library for Python. It offers off-the-shelf functions to implement many algorithms like linear regression, classifiers, SVMs, k-means, Neural Networks etc. It also has a few sample datasets which can be directly used for training and testing.
+
+Because of its speed, robustness and easiness to use, it's one of the most widely-used libraries for many Machine Learning applications.
+
+Installation
+~~~~~~~~~~~~
+
+Through PyPI:
+
+.. code-block:: python
+
+ pip install -U scikit-learn
+
+Through conda:
+
+.. code-block:: python
+
+ conda install scikit-learn
+
+scikit-learn also comes in shipped with Anaconda (mentioned above). For more installation instructions, refer to `this link `_.
+
+Example
+~~~~~~~
+
+For this example, we train a simple classifier on the `Iris dataset `_, which comes bundled in with scikit-learn.
+
+The dataset takes four features of flowers: sepal length, sepal width, petal length and petal width, and classifies them into three flower species (labels): setosa, versicolor or virginica. The labels have been represented as numbers in the dataset: 0 (setosa), 1 (versicolor) and 2 (virginica).
+
+We shuffle the Iris dataset, and divide it into separate training and testing sets: keeping the last 10 data points for testing and rest for training. We then train the classifier on the training set, and predict on the testing set.
+
+.. code-block:: python
+
+ from sklearn.datasets import load_iris
+ from sklearn import tree
+ from sklearn.metrics import accuracy_score
+ import numpy as np
+
+ #loading the iris dataset
+ iris = load_iris()
+
+ x = iris.data #array of the data
+ y = iris.target #array of labels (i.e answers) of each data entry
+
+ #getting label names i.e the three flower species
+ y_names = iris.target_names
+
+ #taking random indices to split the dataset into train and test
+ test_ids = np.random.permutation(len(x))
+
+ #splitting data and labels into train and test
+ #keeping last 10 entries for testing, rest for training
+
+ x_train = x[test_ids[:-10]]
+ x_test = x[test_ids[-10:]]
+
+ y_train = y[test_ids[:-10]]
+ y_test = y[test_ids[-10:]]
+
+ #classifying using decision tree
+ clf = tree.DecisionTreeClassifier()
+
+ #training (fitting) the classifier with the training set
+ clf.fit(x_train, y_train)
+
+ #predictions on the test dataset
+ pred = clf.predict(x_test)
+
+ print pred #predicted labels i.e flower species
+ print y_test #actual labels
+ print (accuracy_score(pred, y_test))*100 #prediction accuracy
+
+Since we're splitting randomly and the classifier trains on every iteration, the accuracy may vary. Running the above code gives:
+
+.. code-block:: python
+
+ [0 1 1 1 0 2 0 2 2 2]
+ [0 1 1 1 0 2 0 2 2 2]
+ 100.0
+
+The first line contains the labels (i.e flower species) of the testing data as predicted by our classifier, and the second line contains the actual flower species as given in the dataset. We thus get an accuracy of 100% this time.
+
+More on scikit-learn can be read in the `documentation `_.
\ No newline at end of file
From 3a353c64f41bc530c65be199eb4e8c85e9ddc9d1 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Wed, 2 Nov 2016 11:23:21 -0400
Subject: [PATCH 075/500] ml
---
docs/contents.rst.inc | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc
index f84b3f06e..f2cad22b0 100644
--- a/docs/contents.rst.inc
+++ b/docs/contents.rst.inc
@@ -58,6 +58,7 @@ different scenarios.
scenarios/xml
scenarios/json
scenarios/crypto
+ scenarios/ml
scenarios/clibs
From 4a7336f8ffbb9002adf6703609406147e7e6c266 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Wed, 2 Nov 2016 11:35:47 -0400
Subject: [PATCH 076/500] Revert "Update contents.rst.inc"
---
docs/contents.rst.inc | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc
index f2cad22b0..22cbdc940 100644
--- a/docs/contents.rst.inc
+++ b/docs/contents.rst.inc
@@ -7,10 +7,16 @@ New to Python? Let's properly setup up your Python environment.
:maxdepth: 2
starting/which-python
- starting/installation
- starting/install/osx
- starting/install/win
- starting/install/linux
+
+- Properly Install Python
+
+ .. toctree::
+ :maxdepth: 1
+
+ starting/installation
+ starting/install/osx
+ starting/install/win
+ starting/install/linux
From 7c8dfd0d3e8f4cafe874d293c2ed647cf8d91844 Mon Sep 17 00:00:00 2001
From: Chocobo1
Date: Sun, 6 Nov 2016 19:57:59 +0800
Subject: [PATCH 077/500] Correct name for the game "Civilization IV"
---
docs/shipping/freezing.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst
index d42f2d61b..4e2de50e8 100644
--- a/docs/shipping/freezing.rst
+++ b/docs/shipping/freezing.rst
@@ -8,7 +8,7 @@ Freezing Your Code
to end-users, that contains all of your application code as well as the
Python interpreter.
-Applications such as 'Dropbox', 'Eve Online', 'Civilisation IV', and
+Applications such as 'Dropbox', 'Eve Online', 'Civilization IV', and
BitTorrent clients do this.
The advantage of distributing this way is that your application will "just work",
From b832f669e682d5b4f97e2bb4e71e62f8834871c9 Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Mon, 14 Nov 2016 14:31:53 -0500
Subject: [PATCH 078/500] Previous merge didnt handle 2 conflicts properly
---
docs/dev/virtualenvs.rst | 4 ----
docs/starting/install/osx.rst | 24 ++----------------------
2 files changed, 2 insertions(+), 26 deletions(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index d8d746c7e..927d213fa 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -8,11 +8,7 @@ projects in separate places, by creating virtual Python environments for them.
It solves the "Project X depends on version 1.x but, Project Y needs 4.x"
dilemma, and keeps your global site-packages directory clean and manageable.
-<<<<<<< HEAD
-For example, you can work on a project which requires Django 1.9 while also
-=======
For example, you can work on a project which requires Django 1.10 while also
->>>>>>> upstream/master
maintaining a project which requires Django 1.8.
virtualenv
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index bc5e53928..fe081b3d8 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -74,9 +74,6 @@ Now, we can install Python 2.7:
$ brew install python
-<<<<<<< HEAD
-This will take a minute or two.
-=======
or Python 3:
.. code-block:: console
@@ -84,7 +81,6 @@ or Python 3:
$ brew install python3
This will take a minute or two.
->>>>>>> upstream/master
Setuptools and Pip
@@ -93,23 +89,13 @@ Setuptools and Pip
Homebrew installs Setuptools and ``pip`` for you.
Setuptools enables you to download and install any compliant Python
-<<<<<<< HEAD
- -software over a network (usually the Internet) with a single command
- -(``easy_install``). It also enables you to add this network installation
- -capability to your own Python software with very little work.
-
-``pip`` is a tool for easily installing and managing Python packages, that is
-recommended over ``easy_install``. It is superior to
-``easy_install`` in `several ways
-`_,
-=======
software over a network (usually the Internet) with a single command
(``easy_install``). It also enables you to add this network installation
capability to your own Python software with very little work.
``pip`` is a tool for easily installing and managing Python packages,
-that is recommended over ``easy_install``. It is superior to ``easy_install`` in `several ways `_,
->>>>>>> upstream/master
+that is recommended over ``easy_install``. It is superior to ``easy_install``
+in `several ways `_,
and is actively maintained.
@@ -122,14 +108,8 @@ in separate places, by creating virtual Python environments for them. It solves
your global site-packages directory clean and manageable.
For example, you can work on a project which requires Django 1.10 while also
-<<<<<<< HEAD
-maintaining a project which requires Django 1.7.
-=======
maintaining a project which requires Django 1.8.
-To start using this and see more information: :ref:`Virtual Environments ` docs.
->>>>>>> upstream/master
-
To start using this and see more information: :ref:`Virtual Environments ` docs.
--------------------------------
From 0d3c9a131f566f56a6256e3e507fbef3733c93c1 Mon Sep 17 00:00:00 2001
From: Adam Nelson
Date: Mon, 14 Nov 2016 14:47:23 -0500
Subject: [PATCH 079/500] Previous merge did not handle 1 more conflict
properly :-(
---
docs/starting/install/osx.rst | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index fe081b3d8..97baf03d8 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -33,7 +33,6 @@ minimal but unofficial
package.
.. note::
-<<<<<<< HEAD
If you already have XCode installed, do not install OSX-GCC-Installer.
In combination, the software can cause issues that are difficult to
diagnose.
@@ -41,11 +40,7 @@ package.
.. note::
If you perform a fresh install of XCode, you will also need to add the
commandline tools by running ``xcode-select --install`` on the terminal.
-=======
- If you already have Xcode installed or plan to use Homebrew, do not install
- OSX-GCC-Installer. In combination, the software can cause issues that are
- difficult to diagnose.
->>>>>>> upstream/master
+
While OS X comes with a large number of UNIX utilities, those familiar with
Linux systems will notice one key component missing: a decent package manager.
From 35372867d9b7f2c7e0907e13697198776159d467 Mon Sep 17 00:00:00 2001
From: Gabriel Pitali
Date: Thu, 17 Nov 2016 09:05:10 -0200
Subject: [PATCH 080/500] Update link for ez_setup.py
Update link for ez_setup.py, in python-guide/docs/starting/install/win.rst file, because the old link was broken.
---
docs/starting/install/win.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index 131ace663..6496a3a78 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -54,7 +54,7 @@ command. It also enables you to add this network installation capability to
your own Python software with very little work.
To obtain the latest version of Setuptools for Windows, run the Python script
-available here: `ez_setup.py `_
+available here: `ez_setup.py `_
You'll now have a new command available to you: **easy_install**. It is
From 1d6d88bbb9105756725e67eb42e421c3b724813f Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sun, 20 Nov 2016 22:50:12 -0500
Subject: [PATCH 081/500] Update sidebarlogo.html
---
docs/_templates/sidebarlogo.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html
index bea79f74c..64db4c4ae 100644
--- a/docs/_templates/sidebarlogo.html
+++ b/docs/_templates/sidebarlogo.html
@@ -16,7 +16,7 @@
From 1b2a943ad808bd2c6a4f495986172b1f8a682076 Mon Sep 17 00:00:00 2001
From: caimaoy
Date: Tue, 22 Nov 2016 18:36:08 +0800
Subject: [PATCH 083/500] update tox docs url
---
docs/writing/tests.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/writing/tests.rst b/docs/writing/tests.rst
index b8b7ca022..a9f2bb617 100644
--- a/docs/writing/tests.rst
+++ b/docs/writing/tests.rst
@@ -218,7 +218,8 @@ multiple interpreter configurations
tox allows you to configure complicated multi-parameter test matrices via a
simple ini-style configuration file.
- `tox `_
+ `tox `_
+
Unittest2
---------
From c769b54e76ed92cbc34ba0cd5d6558e4cdb1b607 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:05:19 -0500
Subject: [PATCH 084/500] rewrite of 3 vs 2
---
docs/starting/which-python.rst | 29 +++++++++++------------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index 26732e34e..ae7254a5b 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -13,10 +13,11 @@ one might think.
The basic gist of the state of things is as follows:
-1. Python 2.7 has been the standard for a *long* time.
-2. Python 3 introduced major changes to the language, which many developers are unhappy with.
-3. Python 2.7 will receive necessary security updates until 2020 [#pep373_eol]_.
+1. Python 2.7 has been the standard for a *long* time, and is being officially deprecated `in 2020 `_.
+2. Python 3 introduced major changes to the language, which have taken some time for the community to adjust to.
+3. As menitoned, Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_.
4. Python 3 is continually evolving, like Python 2 did in years past.
+5. The brand name "Python" encapsulates both Python 3 and Python 2.
So, you can now see why this is not such an easy decision.
@@ -26,21 +27,13 @@ Recommendations
I'll be blunt:
-
-**Use Python 3 if...**
-
-- You don't care.
-- You love Python 3.
-- You are indifferent towards 2 vs 3.
-- You don't know which one to use.
-- You embrace change.
-
-**Use Python 2 if...**
-
-- You love Python 2 and are saddened by the future being Python 3.
-- The stability requirements of your software would be improved by a language and runtime that never changes.
-- Software that you depend on requires it.
-
+- Use Python 3 for new Python applications.
+- If you're learning Python for the first time, familiarizing yourself with Python 2.7 will be very
+ useful, but not more useful than learning Python 3. Learn both. They are both "Python".
+- Software that is already built (e.g. commercial software) often depends on Python 2.7.
+- If you are writing a new open source Python library, it's best to write it for both Python 2 and 3
+ simultaneously. Supporting 3 only is a political statment and will alienate many of your users.
+ This is not a problem — slowly, over the next three years, this will become less the case.
So.... 3?
~~~~~~~~~
From a3f777d0b4bf3683f41cc9a4679fa566b0e4903a Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:08:53 -0500
Subject: [PATCH 085/500] which python
---
docs/starting/which-python.rst | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index ae7254a5b..85978f0dd 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -38,13 +38,13 @@ I'll be blunt:
So.... 3?
~~~~~~~~~
-If you're choosing a Python interpreter to use, and aren't opinionated, then I
+If you're choosing a Python interpreter to use, I
recommend you use the newest Python 3.x, since every version brings new and
-improved standard library modules, security and bug fixes. Progress is progress.
+improved standard library modules, security and bug fixes.
-Given such, only use Python 2 if you have a strong reason to, such as a Python 2
-exclusive library which has no adequate Python 3 ready alternative, or you
-(like me) absolutely love and are inspired by Python 2.
+Given such, only use Python 2 if you have a strong reason to, such as a
+pre-existing code-base, a Python 2 exclusive library, simplicity/familiarity,
+or, of course, you absolutely love and are inspired by Python 2. No harm in that.
Check out `Can I Use Python 3? `_ to see if any
software you're depending on will block your adoption of Python 3.
From f8451532834fbf18ddb8a145ba669ec231542a63 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:14:13 -0500
Subject: [PATCH 086/500] python 3
---
docs/starting/which-python.rst | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index 85978f0dd..fc8701df0 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -13,14 +13,10 @@ one might think.
The basic gist of the state of things is as follows:
-1. Python 2.7 has been the standard for a *long* time, and is being officially deprecated `in 2020 `_.
-2. Python 3 introduced major changes to the language, which have taken some time for the community to adjust to.
-3. As menitoned, Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_.
-4. Python 3 is continually evolving, like Python 2 did in years past.
-5. The brand name "Python" encapsulates both Python 3 and Python 2.
-
-So, you can now see why this is not such an easy decision.
-
+1. Python 2.7 has been the standard for a *long* time, and most running applications today use it.
+2. The Python community is prepared and adjusted for production deployment of Python 3 applications.
+3. Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_, then deprecate.
+4. The brand name "Python" encapsulates both Python 3 and Python 2.
Recommendations
~~~~~~~~~~~~~~~
From 0dc24a34e7d0e17ba49298b5fe0312a3834d39ec Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:16:50 -0500
Subject: [PATCH 087/500] less aggressive
---
docs/starting/which-python.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index fc8701df0..b8b503069 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -3,8 +3,8 @@ Picking an Interpreter
.. _which-python:
-The State of Python (2 vs 3)
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The State of Python (3 & 2)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
When choosing a Python interpreter, one looming question is always present:
"Should I choose Python 2 or Python 3"? The answer is not as obvious as
From cfce3eac7a7ec91f29a3127636de7c75a7825a6e Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:19:14 -0500
Subject: [PATCH 088/500] further clarification
---
docs/starting/which-python.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index b8b503069..b8bf97cc0 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -25,11 +25,12 @@ I'll be blunt:
- Use Python 3 for new Python applications.
- If you're learning Python for the first time, familiarizing yourself with Python 2.7 will be very
- useful, but not more useful than learning Python 3. Learn both. They are both "Python".
-- Software that is already built (e.g. commercial software) often depends on Python 2.7.
+ useful, but not more useful than learning Python 3.
+- Learn both. They are both "Python".
+- Software that is already built often depends on Python 2.7.
- If you are writing a new open source Python library, it's best to write it for both Python 2 and 3
- simultaneously. Supporting 3 only is a political statment and will alienate many of your users.
- This is not a problem — slowly, over the next three years, this will become less the case.
+ simultaneously. Only supporting Python 3 for a new library you want to be widely adopted is a
+ political statment and will alienate many of your users. This is not a problem — slowly, over the next three years, this will become less the case.
So.... 3?
~~~~~~~~~
From ed82f8d4401f510f64e80321a8b2b9a6a1671b94 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:24:11 -0500
Subject: [PATCH 089/500] further clarification
---
docs/starting/which-python.rst | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index b8bf97cc0..709a55d13 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -13,9 +13,9 @@ one might think.
The basic gist of the state of things is as follows:
-1. Python 2.7 has been the standard for a *long* time, and most running applications today use it.
-2. The Python community is prepared and adjusted for production deployment of Python 3 applications.
-3. Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_, then deprecate.
+1. Most production applications today use Python 2.7 .
+2. Python 3 is ready for the production deployment of applications today.
+3. Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_.
4. The brand name "Python" encapsulates both Python 3 and Python 2.
Recommendations
From 3058b21a88f8f47e7abe74bda064634ab0904f40 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:24:58 -0500
Subject: [PATCH 090/500] subtle
---
docs/starting/which-python.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index 709a55d13..1936d0c38 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -7,7 +7,7 @@ The State of Python (3 & 2)
~~~~~~~~~~~~~~~~~~~~~~~~~~~
When choosing a Python interpreter, one looming question is always present:
-"Should I choose Python 2 or Python 3"? The answer is not as obvious as
+"Should I choose Python 2 or Python 3"? The answer is a bit more subtle than
one might think.
From 249e7a9d2aa0eacd196f05a7902df19cc160a762 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Sat, 26 Nov 2016 19:28:40 -0500
Subject: [PATCH 091/500] 2.7
---
docs/starting/which-python.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index 1936d0c38..b3befa2ed 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -13,7 +13,7 @@ one might think.
The basic gist of the state of things is as follows:
-1. Most production applications today use Python 2.7 .
+1. Most production applications today use Python 2.7.
2. Python 3 is ready for the production deployment of applications today.
3. Python 2.7 will only receive necessary security updates until 2020 [#pep373_eol]_.
4. The brand name "Python" encapsulates both Python 3 and Python 2.
From 220001839df03eb89b8f66c8b0527a5ab81d22bd Mon Sep 17 00:00:00 2001
From: Will Humphreys
Date: Tue, 29 Nov 2016 18:24:54 +0000
Subject: [PATCH 092/500] Fix missing space
---
docs/dev/env.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index d5870274a..53d798531 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -148,7 +148,7 @@ known for IntelliJ IDEA. Both share the same code base and most of PyCharm's
features can be brought to IntelliJ with the free
`Python Plug-In `_. There are two
versions of PyCharm: Professional Edition (Free 30-day trial) and Community
-Edition(Apache 2.0 License) with fewer features.
+Edition (Apache 2.0 License) with fewer features.
Python (on Visual Studio Code)
-----------------------------
From 0b43cd8fce49d1c42317324d88e69332be8ace3b Mon Sep 17 00:00:00 2001
From: He Huang
Date: Tue, 29 Nov 2016 21:22:29 -0500
Subject: [PATCH 093/500] Fixed broken link on Magic Methods with new link and
a brief note. The original website is down.
---
docs/intro/learning.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index 823da5bab..97623a8c5 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -209,6 +209,8 @@ in Python. Magic methods are surrounded by double underscores (i.e. __init__)
and can make classes and objects behave in different and magical ways.
`A Guide to Python's Magic Methods `_
+Note: The Rafekettler.com is currently down, you can go to their Github version directly. Here you can find a PDF version:
+ `A Guide to Python's Magic Methods (repo on GitHub) `_
For Engineers and Scientists
From 9c33ab68ab94a98012b0666a9ce8a69a10bf8e4f Mon Sep 17 00:00:00 2001
From: He Huang
Date: Tue, 29 Nov 2016 21:27:15 -0500
Subject: [PATCH 094/500] Change the link to Magic Methods from its GitHub repo
to its pdf file directly.
---
docs/intro/learning.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index 97623a8c5..f99dd56a0 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -210,7 +210,7 @@ and can make classes and objects behave in different and magical ways.
`A Guide to Python's Magic Methods `_
Note: The Rafekettler.com is currently down, you can go to their Github version directly. Here you can find a PDF version:
- `A Guide to Python's Magic Methods (repo on GitHub) `_
+ `A Guide to Python's Magic Methods (repo on GitHub) `_
For Engineers and Scientists
From 48ee67897b44e40143c9c4bca653a01a89dd0bff Mon Sep 17 00:00:00 2001
From: He Huang
Date: Tue, 29 Nov 2016 23:04:15 -0500
Subject: [PATCH 095/500] Format note according to the Style Guide
---
docs/intro/learning.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index f99dd56a0..a5e264661 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -209,7 +209,7 @@ in Python. Magic methods are surrounded by double underscores (i.e. __init__)
and can make classes and objects behave in different and magical ways.
`A Guide to Python's Magic Methods `_
-Note: The Rafekettler.com is currently down, you can go to their Github version directly. Here you can find a PDF version:
+.. note:: The Rafekettler.com is currently down, you can go to their Github version directly. Here you can find a PDF version:
`A Guide to Python's Magic Methods (repo on GitHub) `_
From e41404737716e74018355a7290750985ea8b5caf Mon Sep 17 00:00:00 2001
From: Nathan Goldbaum
Date: Sun, 4 Dec 2016 13:38:35 -0600
Subject: [PATCH 096/500] typo fix in virtualenv development instructions
---
docs/dev/pip-virtualenv.rst | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/dev/pip-virtualenv.rst b/docs/dev/pip-virtualenv.rst
index 51927e689..07f93c679 100644
--- a/docs/dev/pip-virtualenv.rst
+++ b/docs/dev/pip-virtualenv.rst
@@ -18,8 +18,8 @@ environment of the project. Over time this can result in a messy global package
list.
In order to make sure that you install packages to your active virtual
-environment when you use ``pip install``, consider adding the following two
-lines to your :file:`~/.bashrc` file:
+environment when you use ``pip install``, consider adding the following
+line to your :file:`~/.bashrc` file:
.. code-block:: console
From 61ad4a642fcf79ff1ce74dd57707fad5f462d38a Mon Sep 17 00:00:00 2001
From: Gabbarnama
Date: Tue, 6 Dec 2016 19:43:59 +0530
Subject: [PATCH 097/500] Update structure.rst
Removed hyperlink from setup.py
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index a156fba7f..0775311c4 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -200,7 +200,7 @@ it. You can do this a few ways:
package properly.
I highly recommend the latter. Requiring a developer to run
-`setup.py `__ develop to test an actively changing
+``setup.py develop`` to test an actively changing
codebase also requires them to have an isolated environment setup for
each instance of the codebase.
From 63841bdc50763663b80db585a168ea9bd5f287d1 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Wed, 7 Dec 2016 11:32:47 -0800
Subject: [PATCH 098/500] sierra
---
docs/starting/install/osx.rst | 4 ++--
docs/starting/install3/osx.rst | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 97baf03d8..67c7aafea 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -6,7 +6,7 @@ Installing Python on Mac OS X
.. note::
Check out our :ref:`guide for installing Python 3 on OS X`.
-The latest version of Mac OS X, El Capitan, **comes with Python 2.7 out of the box**.
+The latest version of Mac OS X, Sierra, **comes with Python 2.7 out of the box**.
You do not need to install or configure anything else to use Python. Having said
that, I would strongly recommend that you install the tools and libraries
@@ -75,7 +75,7 @@ or Python 3:
$ brew install python3
-This will take a minute or two.
+This will take a minute or two.
Setuptools and Pip
diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst
index d5a33291c..456c6d1ec 100644
--- a/docs/starting/install3/osx.rst
+++ b/docs/starting/install3/osx.rst
@@ -3,7 +3,7 @@
Installing Python 3 on Mac OS X
================================
-The latest version of Mac OS X, El Capitan, **comes with Python 2.7 out of the box**.
+The latest version of Mac OS X, Sierra, **comes with Python 2.7 out of the box**.
You do not need to install or configure anything else to use Python 2. These
instructions document the installation of Python 3.
From 96ddd776e0b626968ef7577d76f4231af2a920c3 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Wed, 7 Dec 2016 11:34:28 -0800
Subject: [PATCH 099/500] improvements
---
docs/dev/virtualenvs.rst | 2 +-
docs/starting/install/osx.rst | 2 +-
docs/starting/install3/osx.rst | 6 +++---
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index 927d213fa..c85b8e844 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -44,7 +44,7 @@ This creates a copy of Python in whichever directory you ran the command in,
placing it in a folder named :file:`venv`.
You can also use the Python interpreter of your choice (like
-:file:`/usr/bin/python2.7`).
+``python2.7``).
.. code-block:: console
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 67c7aafea..6312215a5 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -78,7 +78,7 @@ or Python 3:
This will take a minute or two.
-Setuptools and Pip
+Setuptools & Pip
----------------
Homebrew installs Setuptools and ``pip`` for you.
diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst
index 456c6d1ec..33af41f37 100644
--- a/docs/starting/install3/osx.rst
+++ b/docs/starting/install3/osx.rst
@@ -64,15 +64,15 @@ This will take a minute or two.
Pip
-----------------
+---
Homebrew installs ``pip3`` for you.
``pip3`` is the alias for the Python 3 version of ``pip`` on systems with both
the Homebrew'd Python 2 and 3 installed.
-Working with Python3
---------------------
+Working with Python 3
+---------------------
At this point, you have the system Python 2.7 available, potentially the
:ref:`Homebrew version of Python 2 ` installed, and the Homebrew
From 54ff4fcd59af05ed93e12ccaa2814fc6aec37244 Mon Sep 17 00:00:00 2001
From: David Fischer
Date: Sun, 11 Dec 2016 20:35:43 -0800
Subject: [PATCH 100/500] Click is stable - not upcoming
---
docs/scenarios/cli.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/cli.rst b/docs/scenarios/cli.rst
index ab357c2fd..617de28c0 100644
--- a/docs/scenarios/cli.rst
+++ b/docs/scenarios/cli.rst
@@ -30,7 +30,7 @@ column printer, iterator based progress bars and implicit argument handling.
Click
-----
-`click `_ is an upcoming Python package for creating
+`click `_ is a Python package for creating
command-line interfaces in a composable way with as little code as
possible. This “Command-line Interface Creation Kit” is highly
configurable but comes with good defaults out of the box.
From 5350bc4d949ecdb050ec8b2681da716b10b59892 Mon Sep 17 00:00:00 2001
From: Bruno Alla
Date: Mon, 12 Dec 2016 13:24:13 +0000
Subject: [PATCH 101/500] Update section about Gondor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Gondor has changed name, it’s now called
[Eldarion](http://eldarion.cloud). I haven’t used it myself, but I
thought I would update the page.
---
docs/scenarios/web.rst | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index 9e07a59f5..ecbbbc4b5 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -221,19 +221,12 @@ how to set up your first application.
Heroku is the recommended PaaS for deploying Python web applications today.
-Gondor
-------
-
-`Gondor `_ is a PaaS specialized for deploying Django
-and Pinax applications. Gondor recommends Django version 1.6 and supports any
-WSGI application on Python version 2.7. Gondor can automatically configure your
-Django site if you use :file:`local_settings.py` for site-specific configuration
-information.
-
-Gondor has a guide on deploying `Django projects `_.
+Eldarion
+--------
-Gondor is run by a small company and focuses on helping businesses find success with
-Python and Django.
+`Eldarion `_ (formely known as Gondor) is a PaaS powered
+by Kubernetes, CoreOS, and Docker. They support any WSGI application and have a
+guide on deploying `Django projects `_.
Templating
::::::::::
From 9c4af31253c9ead770cf179d36d887a34f158c7b Mon Sep 17 00:00:00 2001
From: Nick Klauer
Date: Fri, 16 Dec 2016 13:27:48 -0600
Subject: [PATCH 102/500] Update psutil project page to not use Google Code
Since Google Code is defunct, the new homepage for `psutil` is on GitHub. I've updated the link, nothing more.
---
docs/scenarios/admin.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/admin.rst b/docs/scenarios/admin.rst
index 8e738d9c0..a438ab40c 100644
--- a/docs/scenarios/admin.rst
+++ b/docs/scenarios/admin.rst
@@ -131,7 +131,7 @@ State files can be written using YAML, the Jinja2 template system or pure Python
Psutil
------
-`Psutil `_ is an interface to different
+`Psutil `_ is an interface to different
system information (e.g. CPU, memory, disks, network, users and processes).
Here is an example to be aware of some server overload. If any of the
From 2d4d8b4dfc7e6d420d29436a2df8801876e6b34c Mon Sep 17 00:00:00 2001
From: Derek Argueta
Date: Sat, 17 Dec 2016 15:59:21 -0700
Subject: [PATCH 103/500] Typo fix
---
docs/starting/which-python.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/which-python.rst b/docs/starting/which-python.rst
index b3befa2ed..2d2868e29 100644
--- a/docs/starting/which-python.rst
+++ b/docs/starting/which-python.rst
@@ -30,7 +30,7 @@ I'll be blunt:
- Software that is already built often depends on Python 2.7.
- If you are writing a new open source Python library, it's best to write it for both Python 2 and 3
simultaneously. Only supporting Python 3 for a new library you want to be widely adopted is a
- political statment and will alienate many of your users. This is not a problem — slowly, over the next three years, this will become less the case.
+ political statement and will alienate many of your users. This is not a problem — slowly, over the next three years, this will become less the case.
So.... 3?
~~~~~~~~~
From 8ef764dc3e21e111696f9dab0afa27c4d3fe3a49 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Wed, 4 Jan 2017 20:49:44 -0500
Subject: [PATCH 104/500] new japanese translation!
---
docs/_templates/sidebarintro.html | 2 +-
docs/_templates/sidebarlogo.html | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 28f824998..52c9757a4 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -63,6 +63,6 @@
From cde1e4feed9e59184b3a6458ff806523d995cca2 Mon Sep 17 00:00:00 2001
From: Abhik Pal
Date: Mon, 23 Jan 2017 14:13:07 +0530
Subject: [PATCH 105/500] broken link fix
---
docs/scenarios/scrape.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst
index 889a93082..90e5252e4 100644
--- a/docs/scenarios/scrape.rst
+++ b/docs/scenarios/scrape.rst
@@ -49,7 +49,7 @@ will focus on the former.
XPath is a way of locating information in structured documents such as
HTML or XML documents. A good introduction to XPath is on
-`W3Schools `_ .
+`W3Schools `_ .
There are also various tools for obtaining the XPath of elements such as
FireBug for Firefox or the Chrome Inspector. If you're using Chrome, you
From 9826b1b82d30336bb8e42208e7e344ae5b169e49 Mon Sep 17 00:00:00 2001
From: Harsh Vardhan
Date: Mon, 23 Jan 2017 17:16:09 +0530
Subject: [PATCH 106/500] Update W3Schools link to the XPath Tutorial.
---
docs/scenarios/scrape.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/scrape.rst b/docs/scenarios/scrape.rst
index 889a93082..90e5252e4 100644
--- a/docs/scenarios/scrape.rst
+++ b/docs/scenarios/scrape.rst
@@ -49,7 +49,7 @@ will focus on the former.
XPath is a way of locating information in structured documents such as
HTML or XML documents. A good introduction to XPath is on
-`W3Schools `_ .
+`W3Schools `_ .
There are also various tools for obtaining the XPath of elements such as
FireBug for Firefox or the Chrome Inspector. If you're using Chrome, you
From 5af55049645e61d50de20105fd2f9b2c74fe217a Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 2 Feb 2017 22:22:23 -0500
Subject: [PATCH 107/500] upgraded sidebar
---
docs/_templates/sidebarintro.html | 3 ++-
docs/_templates/sidebarlogo.html | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 52c9757a4..ab0edb3eb 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -33,12 +33,13 @@
From 46b5e63b0a3fb42b2f6d444604be768a7e45c84c Mon Sep 17 00:00:00 2001
From: Dan Shorstein
Date: Sat, 18 Feb 2017 11:03:26 -0500
Subject: [PATCH 110/500] add example to mutable/immutable types
added the map example, with explanation
---
docs/writing/structure.rst | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index a156fba7f..ebe13d4ab 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -785,7 +785,12 @@ its parts, it is much more efficient to accumulate the parts in a list,
which is mutable, and then glue ('join') the parts together when the
full string is needed. One thing to notice, however, is that list
comprehensions are better and faster than constructing a list in a loop
-with calls to ``append()``.
+with calls to ``append()``.
+
+One other option is using the map function, which can 'map' a function
+('str') to an iterable ('range(20)'). This results in a map object,
+which you can then ('join') together just like the other examples.
+The map function can be even faster than a list comprehension in some cases.
**Bad**
@@ -807,13 +812,21 @@ with calls to ``append()``.
nums.append(str(n))
print "".join(nums) # much more efficient
-**Best**
+**Better**
.. code-block:: python
# create a concatenated string from 0 to 19 (e.g. "012..1819")
nums = [str(n) for n in range(20)]
print "".join(nums)
+
+**Best**
+
+.. code-block:: python
+
+ # create a concatenated string from 0 to 19 (e.g. "012..1819")
+ nums = map(str, range(20))
+ print "".join(nums)
One final thing to mention about strings is that using ``join()`` is not always
best. In the instances where you are creating a new string from a pre-determined
From f20a2f63c46a6d57c1fe00c51eae6dc12704270e Mon Sep 17 00:00:00 2001
From: Luis Rueda
Date: Thu, 23 Feb 2017 13:48:52 -0500
Subject: [PATCH 111/500] Update logging.rst
Update to include changes proposed in issue #794
---
docs/writing/logging.rst | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/docs/writing/logging.rst b/docs/writing/logging.rst
index 9b41abadf..ad2bda1bc 100644
--- a/docs/writing/logging.rst
+++ b/docs/writing/logging.rst
@@ -55,17 +55,8 @@ this in your ``__init__.py``
.. code-block:: python
- # Set default logging handler to avoid "No handler found" warnings.
import logging
- try: # Python 2.7+
- from logging import NullHandler
- except ImportError:
- class NullHandler(logging.Handler):
- def emit(self, record):
- pass
-
- logging.getLogger(__name__).addHandler(NullHandler())
-
+ logging.getLogger(__name__).addHandler(logging.NullHandler())
Logging in an Application
From ff3879cf6f914869f845655cd242b4ed638e3bc2 Mon Sep 17 00:00:00 2001
From: Luis Rueda
Date: Thu, 23 Feb 2017 14:03:50 -0500
Subject: [PATCH 112/500] Update virtualenvs.rst
Renames the virtual environment name from venv to my_project so that the reader is clear that they should not name their environment venv which could lead to confusion later (venv appearing on the left of the prompt)
---
docs/dev/virtualenvs.rst | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index c85b8e844..77773f6ae 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -32,23 +32,23 @@ Basic Usage
.. code-block:: console
$ cd my_project_folder
- $ virtualenv venv
+ $ virtualenv my_project
-``virtualenv venv`` will create a folder in the current directory which will
+``virtualenv my_project`` will create a folder in the current directory which will
contain the Python executable files, and a copy of the ``pip`` library which you
can use to install other packages. The name of the virtual environment (in this
-case, it was ``venv``) can be anything; omitting the name will place the files
+case, it was ``my_project``) can be anything; omitting the name will place the files
in the current directory instead.
This creates a copy of Python in whichever directory you ran the command in,
-placing it in a folder named :file:`venv`.
+placing it in a folder named :file:`my_project`.
You can also use the Python interpreter of your choice (like
``python2.7``).
.. code-block:: console
- $ virtualenv -p /usr/bin/python2.7 venv
+ $ virtualenv -p /usr/bin/python2.7 my_project
or change the interpreter globally with an env variable in ``~/.bashrc``:
@@ -60,12 +60,12 @@ or change the interpreter globally with an env variable in ``~/.bashrc``:
.. code-block:: console
- $ source venv/bin/activate
+ $ source my_project/bin/activate
The name of the current virtual environment will now appear on the left of
-the prompt (e.g. ``(venv)Your-Computer:your_project UserName$)`` to let you know
+the prompt (e.g. ``(my_project)Your-Computer:your_project UserName$)`` to let you know
that it's active. From now on, any package that you install using pip will be
-placed in the ``venv`` folder, isolated from the global Python installation.
+placed in the ``my_project`` folder, isolated from the global Python installation.
Install packages as usual, for example:
@@ -84,7 +84,7 @@ This puts you back to the system's default Python interpreter with all its
installed libraries.
To delete a virtual environment, just delete its folder. (In this case,
-it would be ``rm -rf venv``.)
+it would be ``rm -rf my_project``.)
After a while, though, you might end up with a lot of virtual environments
littered across your system, and its possible you'll forget their names or
@@ -158,15 +158,15 @@ Basic Usage
.. code-block:: console
- $ mkvirtualenv venv
+ $ mkvirtualenv my_project
-This creates the :file:`venv` folder inside :file:`~/Envs`.
+This creates the :file:`my_project` folder inside :file:`~/Envs`.
2. Work on a virtual environment:
.. code-block:: console
- $ workon venv
+ $ workon my_project
Alternatively, you can make a project, which creates the virtual environment,
and also a project directory inside ``$PROJECT_HOME``, which is ``cd`` -ed into
From d1f24121eff4ea20dd31619261cba91bef7356f0 Mon Sep 17 00:00:00 2001
From: Simon Chiang
Date: Fri, 24 Feb 2017 08:21:52 -0700
Subject: [PATCH 113/500] Indentation typo
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 3d7413eaa..5d09fe39b 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -633,7 +633,7 @@ with the class approach:
class CustomOpen(object):
def __init__(self, filename):
- self.file = open(filename)
+ self.file = open(filename)
def __enter__(self):
return self.file
From f3bf91aceceb0392bc0b0ad57df65bffd89c1bd6 Mon Sep 17 00:00:00 2001
From: tv3141
Date: Tue, 28 Feb 2017 11:33:48 +0000
Subject: [PATCH 114/500] tests: use __file__ for package import
---
docs/writing/structure.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/writing/structure.rst b/docs/writing/structure.rst
index 3d7413eaa..b06e15a73 100644
--- a/docs/writing/structure.rst
+++ b/docs/writing/structure.rst
@@ -211,7 +211,7 @@ file:
import os
import sys
- sys.path.insert(0, os.path.abspath('..'))
+ sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
import sample
From 04587705fa365252539cb33edb64bd67d014171e Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 11:28:36 +0100
Subject: [PATCH 115/500] Fix undeline warnings
https://travis-ci.org/kennethreitz/python-guide/builds/204641280
---
docs/dev/env.rst | 2 +-
docs/intro/news.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 53d798531..59500ff8f 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -151,7 +151,7 @@ versions of PyCharm: Professional Edition (Free 30-day trial) and Community
Edition (Apache 2.0 License) with fewer features.
Python (on Visual Studio Code)
------------------------------
+------------------------------
`Python for Visual Studio `_ is an extension for the `Visual Studio Code IDE `_.
This is a free, light weight, open source IDE, with support for Mac, Windows, and Linux.
diff --git a/docs/intro/news.rst b/docs/intro/news.rst
index 54f8ff70f..074821fa4 100644
--- a/docs/intro/news.rst
+++ b/docs/intro/news.rst
@@ -49,7 +49,7 @@ delivered in your inbox. Keep Your Python Programming Skills Updated.
`Import Python Weekly Newsletter `_
Awesome Python Newsletter
-~~~~~~~~~~~~~~~~~~~~
+~~~~~~~~~~~~~~~~~~~~~~~~~
A weekly overview of the most popular Python news, articles and packages.
From 157a3ff8114701babe2be7f233f91dfe6577b48f Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 14:12:19 +0100
Subject: [PATCH 116/500] Fix block quote
---
docs/intro/learning.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/intro/learning.rst b/docs/intro/learning.rst
index a5e264661..a9eb4e0b5 100644
--- a/docs/intro/learning.rst
+++ b/docs/intro/learning.rst
@@ -209,8 +209,10 @@ in Python. Magic methods are surrounded by double underscores (i.e. __init__)
and can make classes and objects behave in different and magical ways.
`A Guide to Python's Magic Methods `_
+
.. note:: The Rafekettler.com is currently down, you can go to their Github version directly. Here you can find a PDF version:
`A Guide to Python's Magic Methods (repo on GitHub) `_
+
For Engineers and Scientists
From d55db9791dc1a176a0276f7c2113399678a05bf9 Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 14:21:48 +0100
Subject: [PATCH 117/500] Add reference to Lock
---
docs/scenarios/speed.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/scenarios/speed.rst b/docs/scenarios/speed.rst
index 2c775b880..01223809c 100644
--- a/docs/scenarios/speed.rst
+++ b/docs/scenarios/speed.rst
@@ -448,3 +448,4 @@ Multiprocessing
.. _`threading`: https://docs.python.org/3/library/threading.html
.. _`stackoverflow post`: http://stackoverflow.com/questions/26688424/python-threads-are-printing-at-the-same-time-messing-up-the-text-output
.. _`data race`: https://en.wikipedia.org/wiki/Race_condition
+.. _`Lock`: https://docs.python.org/3/library/threading.html#lock-objects
From 85762b82822436a787c8f5dbf9a04f0b48883987 Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 14:29:39 +0100
Subject: [PATCH 118/500] We do not want to have it show up in any toc
We dot his by marking this page as orphan
---
docs/starting/install3/osx.rst | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst
index 33af41f37..de0d4b396 100644
--- a/docs/starting/install3/osx.rst
+++ b/docs/starting/install3/osx.rst
@@ -1,3 +1,5 @@
+:orphan: This article should not be added to a toctree for now
+
.. _install3-osx:
Installing Python 3 on Mac OS X
From 0cb55a887b6cfd0ea502d326cdc4f2d8d63549c8 Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 14:48:20 +0100
Subject: [PATCH 119/500] This is not a highlightable cpp code block
---
docs/scenarios/clibs.rst | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/docs/scenarios/clibs.rst b/docs/scenarios/clibs.rst
index 82e041fe3..fc859eb04 100644
--- a/docs/scenarios/clibs.rst
+++ b/docs/scenarios/clibs.rst
@@ -96,26 +96,27 @@ Example: Overloading __repr__
std::string getName();
};
+
:file:`myclass.i`
-.. code-block:: c++
+.. code-block::
:linenos:
%include "string.i"
-
+
%module myclass
%{
#include
#include "MyClass.h"
%}
-
+
%extend MyClass {
std::string __repr__()
{
return $self->getName();
}
}
-
+
%include "MyClass.h"
From 3b63e28f4c9872ee0cfd416bbb114c4aecf059b7 Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 14:53:16 +0100
Subject: [PATCH 120/500] Use Mako highlighting instead of html
---
docs/scenarios/web.rst | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/docs/scenarios/web.rst b/docs/scenarios/web.rst
index 2bbe36509..6008ddd09 100644
--- a/docs/scenarios/web.rst
+++ b/docs/scenarios/web.rst
@@ -10,6 +10,7 @@ Context
:::::::
+
WSGI
----
@@ -457,7 +458,7 @@ frameworks.
An example template in Mako looks like:
-.. code-block:: html
+.. code-block:: mako
<%inherit file="base.html"/>
<%
From 873b21fe0b648015c8d5fe080f19ca4e0f7e4f3a Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 15:02:08 +0100
Subject: [PATCH 121/500] Properly set code-block
---
docs/scenarios/clibs.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/clibs.rst b/docs/scenarios/clibs.rst
index fc859eb04..2066489cd 100644
--- a/docs/scenarios/clibs.rst
+++ b/docs/scenarios/clibs.rst
@@ -99,7 +99,7 @@ Example: Overloading __repr__
:file:`myclass.i`
-.. code-block::
+.. code-block:: idl
:linenos:
%include "string.i"
From 2f9028969c5232a8e2738ee5080246e2cc901f6d Mon Sep 17 00:00:00 2001
From: Marijn van der Zee
Date: Sat, 11 Mar 2017 15:18:48 +0100
Subject: [PATCH 122/500] Remove wrong usage of :option:
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
From http://www.sphinx-doc.org/en/stable/domains.html#directive-option:
> The directive will create cross-reference targets for the given options,
> referencable by option (in the example case, you’d use something like
> :option:`dest_dir`, :option:`-m`, or :option:`--module`).
I don't think we're intending here to create cross references,
we simply want to render it nicely.
So just use code formatting instead.
This gets rid of the last build warnings.
---
docs/dev/env.rst | 2 +-
docs/dev/virtualenvs.rst | 2 +-
docs/shipping/freezing.rst | 2 +-
docs/shipping/packaging.rst | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/dev/env.rst b/docs/dev/env.rst
index 59500ff8f..3330fb667 100644
--- a/docs/dev/env.rst
+++ b/docs/dev/env.rst
@@ -38,7 +38,7 @@ over the syntax file included in Vim 6.1.
These plugins supply you with a basic environment for developing in Python.
To get the most out of Vim, you should continually check your code for syntax
errors and PEP8 compliance. Luckily PEP8_ and Pyflakes_ will do this for you.
-If your Vim is compiled with :option:`+python` you can also utilize some very
+If your Vim is compiled with ``+python`` you can also utilize some very
handy plugins to do these checks from within the editor.
For PEP8 checking and pyflakes, you can install vim-flake8_. Now you can map the
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index 77773f6ae..99b21db2d 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -93,7 +93,7 @@ where they were placed.
Other Notes
~~~~~~~~~~~
-Running ``virtualenv`` with the option :option:`--no-site-packages` will not
+Running ``virtualenv`` with the option ``--no-site-packages`` will not
include the packages that are installed globally. This can be useful
for keeping the package list clean in case it needs to be accessed later.
[This is the default behavior for ``virtualenv`` 1.7 and later.]
diff --git a/docs/shipping/freezing.rst b/docs/shipping/freezing.rst
index 4e2de50e8..b75d0c169 100644
--- a/docs/shipping/freezing.rst
+++ b/docs/shipping/freezing.rst
@@ -60,7 +60,7 @@ py2app no no yes yes MIT no yes yes
.. note::
All solutions need MS Visual C++ dll to be installed on target machine, except py2app.
Only Pyinstaller makes self-executable exe that bundles the dll when
- passing :option:`--onefile` to :file:`Configure.py`.
+ passing ``--onefile`` to :file:`Configure.py`.
Windows
-------
diff --git a/docs/shipping/packaging.rst b/docs/shipping/packaging.rst
index c67957529..8100ee343 100644
--- a/docs/shipping/packaging.rst
+++ b/docs/shipping/packaging.rst
@@ -101,7 +101,7 @@ pypiserver
`Pypiserver `_ is a minimal PyPI
compatible server. It can be used to serve a set of packages to easy_install
or pip. It includes helpful features like an administrative command
-(:option:`-U`) which will update all its packages to their latest versions
+(``-U``) which will update all its packages to their latest versions
found on PyPI.
From aa152492e281efe9cf0c35c95f55f540068d8215 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Thomas=20G=C3=BCttler?=
Date: Tue, 14 Mar 2017 14:44:21 +0100
Subject: [PATCH 123/500] Link to **Python** docs of travis.
I think this make more sense, since all of these options are explained there.
---
docs/scenarios/ci.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/scenarios/ci.rst b/docs/scenarios/ci.rst
index 16e0ea0df..b3327b141 100644
--- a/docs/scenarios/ci.rst
+++ b/docs/scenarios/ci.rst
@@ -77,7 +77,7 @@ this example content::
This will get your project tested on all the listed Python versions by
running the given script, and will only build the master branch. There are a
lot more options you can enable, like notifications, before and after steps
-and much more. The `travis-ci docs `_
+and much more. The `travis-ci docs `_
explain all of these options, and are very thorough.
In order to activate testing for your project, go to `the travis-ci site `_
From 1fd684ad518b1229f2df035007026d006baed4b2 Mon Sep 17 00:00:00 2001
From: Victor Caldas
Date: Sun, 19 Mar 2017 12:47:03 +0100
Subject: [PATCH 124/500] Add Pt_BR - Fixes #788
pt_BR translation ongoing,
---
docs/_templates/sidebarlogo.html | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/_templates/sidebarlogo.html b/docs/_templates/sidebarlogo.html
index bea79f74c..ef931a432 100644
--- a/docs/_templates/sidebarlogo.html
+++ b/docs/_templates/sidebarlogo.html
@@ -46,4 +46,5 @@
From d6789d22f1942bfba823d865b50928a1c8a63e45 Mon Sep 17 00:00:00 2001
From: Abhishek Kumar Singh
Date: Mon, 10 Apr 2017 20:53:19 +0530
Subject: [PATCH 126/500] Check virtualenv installation, close #657
---
docs/dev/virtualenvs.rst | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/docs/dev/virtualenvs.rst b/docs/dev/virtualenvs.rst
index 99b21db2d..71307da50 100644
--- a/docs/dev/virtualenvs.rst
+++ b/docs/dev/virtualenvs.rst
@@ -23,6 +23,12 @@ Install virtualenv via pip:
.. code-block:: console
$ pip install virtualenv
+
+Test your installation
+
+.. code-block:: console
+
+ $ virtualenv --version
Basic Usage
~~~~~~~~~~~
From d3d2fcc496984ce16363b6b9fc181628a16197a9 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:43:52 -0400
Subject: [PATCH 127/500] python 3 guides
---
docs/starting/install3/linux.rst | 66 +++++++++++++++++++++++++
docs/starting/install3/win.rst | 84 ++++++++++++++++++++++++++++++++
2 files changed, 150 insertions(+)
create mode 100644 docs/starting/install3/linux.rst
create mode 100644 docs/starting/install3/win.rst
diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst
new file mode 100644
index 000000000..9e33ff3c4
--- /dev/null
+++ b/docs/starting/install3/linux.rst
@@ -0,0 +1,66 @@
+.. _install3-linux:
+
+Installing Python 3 on Linux
+============================
+
+This document describes how to install Python 3.6 on Ubuntu Linux machines.
+
+To see which version of Python 3 you have installed, open a command prompt and run
+
+.. code-block:: console
+
+ $ python3 --version
+
+If you are using Ubuntu 16.10 or newer, then you can easily install Python 3.6 with the following commands::
+
+ $ sudo apt-get update
+ $ sudo apt-get install python3.6
+
+If you're using another version of Ubuntu (e.g. the latest LTS release), we recommend using the `deadsnakes PPA `_ to install Python 3.6::
+
+ $ sudo add-apt-repository ppa:fkrull/deadsnakes
+ $ sudo apt-get update
+ $ sudo apt-get install python3.6
+
+
+Setuptools & Pip
+----------------
+
+The two most crucial third-party Python packages are `setuptools `_ and `pip `_.
+
+Once installed, you can download, install and uninstall any compliant Python software
+product with a single command. It also enables you to add this network installation
+capability to your own Python software with very little work.
+
+Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include
+pip by default.
+
+To see if pip is installed, open a command prompt and run
+
+.. code-block:: console
+
+ $ command -v pip
+
+To install pip, `follow the official pip installation guide `_ - this will automatically install the latest version of setuptools.
+
+Virtual Environments
+--------------------
+
+A Virtual Environment is a tool to keep the dependencies required by different projects
+in separate places, by creating virtual Python environments for them. It solves the
+"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
+your global site-packages directory clean and manageable.
+
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
+
+To start using this and see more information: :ref:`Virtual Environments ` docs.
+
+You can also use :ref:`virtualenvwrapper ` to make it easier to
+manage your virtual environments.
+
+--------------------------------
+
+This page is a remixed version of `another guide `_,
+which is available under the same license.
+
diff --git a/docs/starting/install3/win.rst b/docs/starting/install3/win.rst
new file mode 100644
index 000000000..d1d00a985
--- /dev/null
+++ b/docs/starting/install3/win.rst
@@ -0,0 +1,84 @@
+.. _install3-windows:
+
+Installing Python 3 on Windows
+============================
+
+First, download the `latest version `_
+of Python 3.6 from the official website. If you want to be sure you are installing a fully
+up-to-date version, click the Downloads > Windows link from the home page of the
+`Python.org web site `_ .
+
+By design, Python installs to a directory with the version number embedded,
+e.g. Python version 3.6 will install at :file:`C:\\Python36\\`, so that you can
+have multiple versions of Python on the
+same system without conflicts. Of course, only one interpreter can be the
+default application for Python file types. It also does not automatically
+modify the :envvar:`PATH` environment variable, so that you always have control over
+which copy of Python is run.
+
+Typing the full path name for a Python interpreter each time quickly gets
+tedious, so add the directories for your default Python version to the :envvar:`PATH`.
+Assuming that your Python installation is in :file:`C:\\Python36\\`, add this to your
+:envvar:`PATH`:
+
+.. code-block:: console
+
+ C:\Python36\;C:\Python36\Scripts\
+
+You can do this easily by running the following in ``powershell``:
+
+.. code-block:: console
+
+ [Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
+
+This is also an option during the installation process.
+
+The second (:file:`Scripts`) directory receives command files when certain
+packages are installed, so it is a very useful addition.
+You do not need to install or configure anything else to use Python. Having
+said that, I would strongly recommend that you install the tools and libraries
+described in the next section before you start building Python applications for
+real-world use. In particular, you should always install Setuptools, as it
+makes it much easier for you to use other third-party Python libraries.
+
+Setuptools + Pip
+----------------
+
+The most crucial third-party Python software of all is Setuptools, which
+extends the packaging and installation facilities provided by the distutils in
+the standard library. Once you add Setuptools to your Python system you can
+download and install any compliant Python software product with a single
+command. It also enables you to add this network installation capability to
+your own Python software with very little work.
+
+To obtain the latest version of Setuptools for Windows, run the Python script
+available here: `ez_setup.py `_
+
+
+You'll now have a new command available to you: **easy_install**. It is
+considered by many to be deprecated, so we will install its replacement:
+**pip**. Pip allows for uninstallation of packages, and is actively maintained,
+unlike easy_install.
+
+To install pip, run the Python script available here:
+`get-pip.py `_
+
+
+Virtual Environments
+--------------------
+
+A Virtual Environment is a tool to keep the dependencies required by different projects
+in separate places, by creating virtual Python environments for them. It solves the
+"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
+your global site-packages directory clean and manageable.
+
+For example, you can work on a project which requires Django 1.10 while also
+maintaining a project which requires Django 1.8.
+
+To start using this and see more information: :ref:`Virtual Environments ` docs.
+
+
+--------------------------------
+
+This page is a remixed version of `another guide `_,
+which is available under the same license.
From 0c97ce5a31f8110910232a68997ee33b5bf92924 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:43:58 -0400
Subject: [PATCH 128/500] update python 2 guides
---
docs/starting/install/linux.rst | 20 ++++++++++----------
docs/starting/install/osx.rst | 4 ++--
docs/starting/install/win.rst | 18 ++++++++++--------
3 files changed, 22 insertions(+), 20 deletions(-)
diff --git a/docs/starting/install/linux.rst b/docs/starting/install/linux.rst
index aa56ec07d..c9b779b3d 100644
--- a/docs/starting/install/linux.rst
+++ b/docs/starting/install/linux.rst
@@ -1,9 +1,9 @@
.. _install-linux:
-Installing Python on Linux
-==========================
+Installing Python 2 on Linux
+============================
-The latest versions of CentOS, Fedora, Redhat Enterprise (RHEL) and Ubuntu
+The latest versions of CentOS, Fedora, Redhat Enterprise (RHEL) and Ubuntu
**come with Python 2.7 out of the box**.
To see which version of Python you have installed, open a command prompt and run
@@ -32,11 +32,11 @@ Setuptools & Pip
The two most crucial third-party Python packages are `setuptools `_ and `pip `_.
-Once installed, you can download, install and uninstall any compliant Python software
-product with a single command. It also enables you to add this network installation
+Once installed, you can download, install and uninstall any compliant Python software
+product with a single command. It also enables you to add this network installation
capability to your own Python software with very little work.
-Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include
+Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include
pip by default.
To see if pip is installed, open a command prompt and run
@@ -50,15 +50,15 @@ To install pip, `follow the official pip installation guide ` docs.
+To start using this and see more information: :ref:`Virtual Environments ` docs.
You can also use :ref:`virtualenvwrapper ` to make it easier to
manage your virtual environments.
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index 6312215a5..f0851d380 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -1,7 +1,7 @@
.. _install-osx:
-Installing Python on Mac OS X
-=============================
+Installing Python 2 on Mac OS X
+===============================
.. note::
Check out our :ref:`guide for installing Python 3 on OS X`.
diff --git a/docs/starting/install/win.rst b/docs/starting/install/win.rst
index 6496a3a78..bbcae9ccb 100644
--- a/docs/starting/install/win.rst
+++ b/docs/starting/install/win.rst
@@ -1,10 +1,10 @@
.. _install-windows:
-Installing Python on Windows
-============================
+Installing Python 2 on Windows
+==============================
-First, download the `latest version `_
-of Python 2.7 from the official Website. If you want to be sure you are installing a fully
+First, download the `latest version `_
+of Python 2.7 from the official website. If you want to be sure you are installing a fully
up-to-date version, click the Downloads > Windows link from the home page of the
`Python.org web site `_ .
@@ -35,6 +35,8 @@ You can do this easily by running the following in ``powershell``:
[Environment]::SetEnvironmentVariable("Path", "$env:Path;C:\Python27\;C:\Python27\Scripts\", "User")
+This is also an option during the installation process.
+
The second (:file:`Scripts`) directory receives command files when certain
packages are installed, so it is a very useful addition.
You do not need to install or configure anything else to use Python. Having
@@ -69,15 +71,15 @@ To install pip, run the Python script available here:
Virtual Environments
--------------------
-A Virtual Environment is a tool to keep the dependencies required by different projects
-in separate places, by creating virtual Python environments for them. It solves the
-"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
+A Virtual Environment is a tool to keep the dependencies required by different projects
+in separate places, by creating virtual Python environments for them. It solves the
+"Project X depends on version 1.x but, Project Y needs 4.x" dilemma, and keeps
your global site-packages directory clean and manageable.
For example, you can work on a project which requires Django 1.10 while also
maintaining a project which requires Django 1.8.
-To start using this and see more information: :ref:`Virtual Environments ` docs.
+To start using this and see more information: :ref:`Virtual Environments ` docs.
--------------------------------
From ef35770716f6a32afb0ddaa3bd8c074c1bfe769e Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:46:45 -0400
Subject: [PATCH 129/500] update installation
---
docs/starting/installation.rst | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 55114b21d..83d4ad1bd 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -16,7 +16,12 @@ Installation Guides
These guides go over the proper installation of :ref:`Python `
for development purposes, as well as setuptools, pip and virtualenv.
-- :ref:`Python 3 on MacOS `.
+- :ref:`Python 3 on MacOS `
+- :ref:`Python 3 on Windows `.
+- :ref:`Python 3 on Linux `.
+
+--------------------------------
+
- :ref:`Python 2 on MacOS `.
- :ref:`Python 2 on Microsoft Windows `.
- :ref:`Python 2 on Ubuntu Linux `.
From fd8cce0708f933c4c0dbfdfebd8d1211b11aa517 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:49:47 -0400
Subject: [PATCH 130/500] fix contents
---
docs/contents.rst.inc | 3 +++
docs/starting/installation.rst | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/contents.rst.inc b/docs/contents.rst.inc
index 22cbdc940..b5673cc92 100644
--- a/docs/contents.rst.inc
+++ b/docs/contents.rst.inc
@@ -14,6 +14,9 @@ New to Python? Let's properly setup up your Python environment.
:maxdepth: 1
starting/installation
+ starting/install3/osx
+ starting/install3/win
+ starting/install3/linux
starting/install/osx
starting/install/win
starting/install/linux
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 83d4ad1bd..1fe651956 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -18,7 +18,7 @@ for development purposes, as well as setuptools, pip and virtualenv.
- :ref:`Python 3 on MacOS `
- :ref:`Python 3 on Windows `.
-- :ref:`Python 3 on Linux `.
+- :ref:`Python 3 on Linux `.
--------------------------------
From 7096c951326ae691fe3f7bd88596570dcff40ca5 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:51:59 -0400
Subject: [PATCH 131/500] syntax
---
docs/starting/installation.rst | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/starting/installation.rst b/docs/starting/installation.rst
index 1fe651956..36bf6898d 100644
--- a/docs/starting/installation.rst
+++ b/docs/starting/installation.rst
@@ -16,7 +16,7 @@ Installation Guides
These guides go over the proper installation of :ref:`Python `
for development purposes, as well as setuptools, pip and virtualenv.
-- :ref:`Python 3 on MacOS `
+- :ref:`Python 3 on MacOS `.
- :ref:`Python 3 on Windows `.
- :ref:`Python 3 on Linux `.
From 9164a1b1e91084cf8873fd07da12fbd39e4ca29d Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:53:18 -0400
Subject: [PATCH 132/500] working with python 3
---
docs/starting/install3/linux.rst | 18 ++++++++++++++++++
docs/starting/install3/osx.rst | 2 +-
docs/starting/install3/win.rst | 18 ++++++++++++++++++
3 files changed, 37 insertions(+), 1 deletion(-)
diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst
index 9e33ff3c4..eee5620ad 100644
--- a/docs/starting/install3/linux.rst
+++ b/docs/starting/install3/linux.rst
@@ -22,6 +22,23 @@ If you're using another version of Ubuntu (e.g. the latest LTS release), we reco
$ sudo apt-get update
$ sudo apt-get install python3.6
+Working with Python 3
+---------------------
+
+At this point, you have the system Python 2.7 available, potentially the
+:ref:`Homebrew version of Python 2 ` installed, and the Homebrew
+version of Python 3 as well.
+
+.. code-block:: console
+
+ $ python
+
+will launch the Python 2 interpreter.
+
+.. code-block:: console
+
+ $ python3
+
Setuptools & Pip
----------------
@@ -59,6 +76,7 @@ To start using this and see more information: :ref:`Virtual Environments ` to make it easier to
manage your virtual environments.
+
--------------------------------
This page is a remixed version of `another guide `_,
diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst
index de0d4b396..8a8282277 100644
--- a/docs/starting/install3/osx.rst
+++ b/docs/starting/install3/osx.rst
@@ -90,7 +90,7 @@ will launch the Python 2 interpreter.
$ python3
-will launch the Python 3 interpreter
+will launch the Python 3 interpreter.
``pip3`` and ``pip`` will both be available. If the Homebrew version of Python
2 is not installed, they will be the same. If the Homebrew version of Python 2
diff --git a/docs/starting/install3/win.rst b/docs/starting/install3/win.rst
index d1d00a985..c940b9beb 100644
--- a/docs/starting/install3/win.rst
+++ b/docs/starting/install3/win.rst
@@ -41,6 +41,24 @@ described in the next section before you start building Python applications for
real-world use. In particular, you should always install Setuptools, as it
makes it much easier for you to use other third-party Python libraries.
+Working with Python 3
+---------------------
+
+At this point, you have the system Python 2.7 available, potentially the
+:ref:`Homebrew version of Python 2 ` installed, and the Homebrew
+version of Python 3 as well.
+
+.. code-block:: console
+
+ $ python
+
+will launch the Python 2 interpreter.
+
+.. code-block:: console
+
+ $ python3
+
+
Setuptools + Pip
----------------
From a8ed45d5c402bdef16e8f6cb309b0a7b001d97a8 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 10:58:14 -0400
Subject: [PATCH 133/500] fixes
---
docs/starting/install3/linux.rst | 7 +++----
docs/starting/install3/win.rst | 8 ++++----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/docs/starting/install3/linux.rst b/docs/starting/install3/linux.rst
index eee5620ad..f9171bcfc 100644
--- a/docs/starting/install3/linux.rst
+++ b/docs/starting/install3/linux.rst
@@ -25,20 +25,19 @@ If you're using another version of Ubuntu (e.g. the latest LTS release), we reco
Working with Python 3
---------------------
-At this point, you have the system Python 2.7 available, potentially the
-:ref:`Homebrew version of Python 2 ` installed, and the Homebrew
-version of Python 3 as well.
+At this point, you may have system Python 2.7 available as well.
.. code-block:: console
$ python
-will launch the Python 2 interpreter.
+This will launch the Python 2 interpreter.
.. code-block:: console
$ python3
+This will launch the Python 3 interpreter.
Setuptools & Pip
----------------
diff --git a/docs/starting/install3/win.rst b/docs/starting/install3/win.rst
index c940b9beb..4a7aadd6f 100644
--- a/docs/starting/install3/win.rst
+++ b/docs/starting/install3/win.rst
@@ -44,20 +44,20 @@ makes it much easier for you to use other third-party Python libraries.
Working with Python 3
---------------------
-At this point, you have the system Python 2.7 available, potentially the
-:ref:`Homebrew version of Python 2 ` installed, and the Homebrew
-version of Python 3 as well.
+At this point, you may also have Python 2.7 installed.
.. code-block:: console
$ python
-will launch the Python 2 interpreter.
+This will launch the Python 2 interpreter.
.. code-block:: console
$ python3
+This will launch the Python 3 interpreter.
+
Setuptools + Pip
----------------
From 83d1fd49d521f2b2c7b1f79050c9f98eee52e96c Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 13 Apr 2017 11:00:51 -0400
Subject: [PATCH 134/500] fixes
---
docs/starting/install/osx.rst | 2 +-
docs/starting/install3/osx.rst | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/docs/starting/install/osx.rst b/docs/starting/install/osx.rst
index f0851d380..24eb27437 100644
--- a/docs/starting/install/osx.rst
+++ b/docs/starting/install/osx.rst
@@ -14,7 +14,7 @@ described in the next section before you start building Python applications for
real-world use. In particular, you should always install Setuptools, as it makes
it much easier for you to install and manage other third-party Python libraries.
-The version of Python that ships with OS X is great for learning but it's not
+The version of Python that ships with OS X is great for learning, but it's not
good for development. The version shipped with OS X may be out of date from the
`official current Python release `_,
which is considered the stable production version.
diff --git a/docs/starting/install3/osx.rst b/docs/starting/install3/osx.rst
index 8a8282277..8844f2e1f 100644
--- a/docs/starting/install3/osx.rst
+++ b/docs/starting/install3/osx.rst
@@ -10,7 +10,7 @@ The latest version of Mac OS X, Sierra, **comes with Python 2.7 out of the box**
You do not need to install or configure anything else to use Python 2. These
instructions document the installation of Python 3.
-The version of Python that ships with OS X is great for learning but it's not
+The version of Python that ships with OS X is great for learning, but it's not
good for development. The version shipped with OS X may be out of date from the
`official current Python release `_,
which is considered the stable production version.
From d3e97f2ec1ae42bd4bae48b11ad32e21a071cb9d Mon Sep 17 00:00:00 2001
From: Dmytro Brykovets
Date: Sat, 15 Apr 2017 12:34:19 +0300
Subject: [PATCH 135/500] Remove junk in Jinja code block
The "
From 6e0c78df7b2693c8937bafe58c8b856c1e2bdc39 Mon Sep 17 00:00:00 2001
From: monchitos
Date: Tue, 18 Apr 2017 10:02:15 -0500
Subject: [PATCH 136/500] Adding a reminder for preventing a misuse of the
example in "common gotchas/mutable default arguments"
---
docs/writing/gotchas.rst | 1 +
1 file changed, 1 insertion(+)
diff --git a/docs/writing/gotchas.rst b/docs/writing/gotchas.rst
index f8e2e2377..fcf143943 100644
--- a/docs/writing/gotchas.rst
+++ b/docs/writing/gotchas.rst
@@ -76,6 +76,7 @@ signal that no argument was provided (:py:data:`None` is often a good choice).
to.append(element)
return to
+Do not forget, you are passing a *list* object as the second argument.
When the Gotcha Isn't a Gotcha
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From a3055ae6b6ad6cfcdf92573513a54195922a4579 Mon Sep 17 00:00:00 2001
From: Kenneth Reitz
Date: Thu, 27 Apr 2017 17:42:17 -0400
Subject: [PATCH 137/500] sponsor
---
docs/_templates/sidebarintro.html | 5 +++++
docs/_templates/sidebarlogo.html | 7 +++++++
2 files changed, 12 insertions(+)
diff --git a/docs/_templates/sidebarintro.html b/docs/_templates/sidebarintro.html
index 81272b5ec..08ebba00c 100644
--- a/docs/_templates/sidebarintro.html
+++ b/docs/_templates/sidebarintro.html
@@ -21,6 +21,11 @@