summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Vassalotti <alexandre@peadrop.com>2013-04-14 02:10:14 -0700
committerAlexandre Vassalotti <alexandre@peadrop.com>2013-04-14 02:10:14 -0700
commitd93fd401625308655d97ed65a3fa60e58957a493 (patch)
tree7dfab966aed48a63c903e6ca10f9256ec68bcee8
parent446f80fbfc587d002766e78f46af30fa20dfc81c (diff)
parent73f2194998bb628cb4cc6c3fd02c2009f2707182 (diff)
downloadcpython-d93fd401625308655d97ed65a3fa60e58957a493.tar.gz
Merge heads.
-rw-r--r--Doc/faq/design.rst4
-rw-r--r--Doc/howto/sockets.rst8
-rw-r--r--Doc/library/collections.abc.rst4
-rw-r--r--Doc/reference/expressions.rst15
-rw-r--r--Doc/using/mac.rst21
5 files changed, 26 insertions, 26 deletions
diff --git a/Doc/faq/design.rst b/Doc/faq/design.rst
index 04c8c1f749..724eecff52 100644
--- a/Doc/faq/design.rst
+++ b/Doc/faq/design.rst
@@ -862,8 +862,8 @@ There are several reasons to allow this.
When you have a literal value for a list, tuple, or dictionary spread across
multiple lines, it's easier to add more elements because you don't have to
-remember to add a comma to the previous line. The lines can also be sorted in
-your editor without creating a syntax error.
+remember to add a comma to the previous line. The lines can also be reordered
+without creating a syntax error.
Accidentally omitting the comma can lead to errors that are hard to diagnose.
For example::
diff --git a/Doc/howto/sockets.rst b/Doc/howto/sockets.rst
index ca6528b06f..151e2c810d 100644
--- a/Doc/howto/sockets.rst
+++ b/Doc/howto/sockets.rst
@@ -84,9 +84,11 @@ creates a "server socket"::
serversocket.listen(5)
A couple things to notice: we used ``socket.gethostname()`` so that the socket
-would be visible to the outside world. If we had used ``s.bind(('', 80))`` or
-``s.bind(('localhost', 80))`` or ``s.bind(('127.0.0.1', 80))`` we would still
-have a "server" socket, but one that was only visible within the same machine.
+would be visible to the outside world. If we had used ``s.bind(('localhost',
+80))`` or ``s.bind(('127.0.0.1', 80))`` we would still have a "server" socket,
+but one that was only visible within the same machine. ``s.bind(('', 80))``
+specifies that the socket is reachable by any address the machine happens to
+have.
A second thing to note: low number ports are usually reserved for "well known"
services (HTTP, SNMP etc). If you're playing around, use a nice high number (4
diff --git a/Doc/library/collections.abc.rst b/Doc/library/collections.abc.rst
index 115ce101b0..06dfe806ea 100644
--- a/Doc/library/collections.abc.rst
+++ b/Doc/library/collections.abc.rst
@@ -128,7 +128,7 @@ These ABCs allow us to ask classes or instances if they provide
particular functionality, for example::
size = None
- if isinstance(myvar, collections.Sized):
+ if isinstance(myvar, collections.abc.Sized):
size = len(myvar)
Several of the ABCs are also useful as mixins that make it easier to develop
@@ -138,7 +138,7 @@ abstract methods: :meth:`__contains__`, :meth:`__iter__`, and :meth:`__len__`.
The ABC supplies the remaining methods such as :meth:`__and__` and
:meth:`isdisjoint`::
- class ListBasedSet(collections.Set):
+ class ListBasedSet(collections.abc.Set):
''' Alternate set implementation favoring space over speed
and not requiring the set elements to be hashable. '''
def __init__(self, iterable):
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index c866f8493d..c0132bd471 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -84,14 +84,13 @@ exception.
definition begins with two or more underscore characters and does not end in two
or more underscores, it is considered a :dfn:`private name` of that class.
Private names are transformed to a longer form before code is generated for
-them. The transformation inserts the class name in front of the name, with
-leading underscores removed, and a single underscore inserted in front of the
-class name. For example, the identifier ``__spam`` occurring in a class named
-``Ham`` will be transformed to ``_Ham__spam``. This transformation is
-independent of the syntactical context in which the identifier is used. If the
-transformed name is extremely long (longer than 255 characters), implementation
-defined truncation may happen. If the class name consists only of underscores,
-no transformation is done.
+them. The transformation inserts the class name, with leading underscores
+removed and a single underscore inserted, in front of the name. For example,
+the identifier ``__spam`` occurring in a class named ``Ham`` will be transformed
+to ``_Ham__spam``. This transformation is independent of the syntactical
+context in which the identifier is used. If the transformed name is extremely
+long (longer than 255 characters), implementation defined truncation may happen.
+If the class name consists only of underscores, no transformation is done.
.. _atom-literals:
diff --git a/Doc/using/mac.rst b/Doc/using/mac.rst
index 075a359d16..3e1b74df0b 100644
--- a/Doc/using/mac.rst
+++ b/Doc/using/mac.rst
@@ -17,14 +17,15 @@ the IDE and the Package Manager that are worth pointing out.
Getting and Installing MacPython
================================
-Mac OS X 10.5 comes with Python 2.5.1 pre-installed by Apple. If you wish, you
-are invited to install the most recent version of Python from the Python website
-(http://www.python.org). A current "universal binary" build of Python, which
-runs natively on the Mac's new Intel and legacy PPC CPU's, is available there.
+Mac OS X 10.8 comes with Python 2.7 pre-installed by Apple. If you wish, you
+are invited to install the most recent version of Python 3 from the Python
+website (http://www.python.org). A current "universal binary" build of Python,
+which runs natively on the Mac's new Intel and legacy PPC CPU's, is available
+there.
What you get after installing is a number of things:
-* A :file:`MacPython 2.5` folder in your :file:`Applications` folder. In here
+* A :file:`MacPython 3.3` folder in your :file:`Applications` folder. In here
you find IDLE, the development environment that is a standard part of official
Python distributions; PythonLauncher, which handles double-clicking Python
scripts from the Finder; and the "Build Applet" tool, which allows you to
@@ -92,7 +93,7 @@ aware of: programs that talk to the Aqua window manager (in other words,
anything that has a GUI) need to be run in a special way. Use :program:`pythonw`
instead of :program:`python` to start such scripts.
-With Python 2.5, you can use either :program:`python` or :program:`pythonw`.
+With Python 3.3, you can use either :program:`python` or :program:`pythonw`.
Configuration
@@ -125,13 +126,11 @@ Installing Additional Python Packages
There are several methods to install additional Python packages:
-* http://pythonmac.org/packages/ contains selected compiled packages for Python
- 2.5, 2.4, and 2.3.
-
* Packages can be installed via the standard Python distutils mode (``python
setup.py install``).
-* Many packages can also be installed via the :program:`setuptools` extension.
+* Many packages can also be installed via the :program:`setuptools` extension
+ or :program:`pip` wrapper, see http://www.pip-installer.org/.
GUI Programming on the Mac
@@ -159,7 +158,7 @@ http://www.riverbankcomputing.co.uk/software/pyqt/intro.
Distributing Python Applications on the Mac
===========================================
-The "Build Applet" tool that is placed in the MacPython 2.5 folder is fine for
+The "Build Applet" tool that is placed in the MacPython 3.3 folder is fine for
packaging small Python scripts on your own machine to run as a standard Mac
application. This tool, however, is not robust enough to distribute Python
applications to other users.