Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0ffb4626
Commit
0ffb4626
authored
Oct 29, 2014
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixing broken links in doc, part 2: howto/
parent
fa55a317
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
45 deletions
+30
-45
Doc/howto/descriptor.rst
Doc/howto/descriptor.rst
+1
-1
Doc/howto/pyporting.rst
Doc/howto/pyporting.rst
+16
-22
Doc/howto/unicode.rst
Doc/howto/unicode.rst
+2
-2
Doc/howto/urllib2.rst
Doc/howto/urllib2.rst
+2
-4
Doc/howto/webservers.rst
Doc/howto/webservers.rst
+9
-16
No files found.
Doc/howto/descriptor.rst
View file @
0ffb4626
...
...
@@ -133,7 +133,7 @@ Note, in Python 2.2, ``super(B, obj).m()`` would only invoke :meth:`__get__` if
invoked unless an old-style class is involved. The implementation details are
in :c:func:`super_getattro()` in :source:`Objects/typeobject.c`.
.. _`Guido's Tutorial`: https://www.python.org/
2.2.3/descrintro.html
#cooperation
.. _`Guido's Tutorial`: https://www.python.org/
download/releases/2.2.3/descrintro/
#cooperation
The details above show that the mechanism for descriptors is embedded in the
:meth:`__getattribute__()` methods for :class:`object`, :class:`type`, and
...
...
Doc/howto/pyporting.rst
View file @
0ffb4626
...
...
@@ -86,11 +86,11 @@ that you can make sure that you detect breakage during the transition. Tests als
tend to be simpler than the code they are testing so it gives you an idea of how
easy it can be to port code.
Drop support for older Python versions if possible.
`Python 2.5`_
Drop support for older Python versions if possible.
Python 2.5
introduced a lot of useful syntax and libraries which have become idiomatic
in Python 3.
`Python 2.6`_
introduced future statements which makes
in Python 3.
Python 2.6
introduced future statements which makes
compatibility much easier if you are going from Python 2 to 3.
`Python 2.7`_
continues the trend in the stdlib. Choose the newest version
Python 2.7
continues the trend in the stdlib. Choose the newest version
of Python which you believe can be your minimum support version
and work from there.
...
...
@@ -144,19 +144,19 @@ for you.
Support Python 2.7
//////////////////
As a first step, make sure that your project is compatible with
`Python 2.7`_
.
As a first step, make sure that your project is compatible with
Python 2.7
.
This is just good to do as Python 2.7 is the last release of Python 2 and thus
will be used for a rather long time. It also allows for use of the ``-3`` flag
to Python to help discover places in your code where compatibility might be an
issue (the ``-3`` flag is in Python 2.6 but Python 2.7 adds more warnings).
Try to Support
`Python 2.6`_
and Newer Only
////////////////////////////////////////
///
Try to Support
Python 2.6
and Newer Only
////////////////////////////////////////
While not possible for all projects, if you can support
`Python 2.6`_
and newer
While not possible for all projects, if you can support
Python 2.6
and newer
**only**, your life will be much easier. Various future statements, stdlib
additions, etc. exist only in Python 2.6 and later which greatly assist in
supporting Python 3. But if you project must keep support for
`Python 2.5`_
then
supporting Python 3. But if you project must keep support for
Python 2.5
then
it is still possible to simultaneously support Python 3.
Below are the benefits you gain if you only have to support Python 2.6 and
...
...
@@ -215,10 +215,10 @@ Discussed in more detail below, but you should use this future statement to
prevent yourself from accidentally using implicit relative imports.
Supporting
`Python 2.5`_
and Newer Only
////////////////////////////////////
///
Supporting
Python 2.5
and Newer Only
////////////////////////////////////
If you are supporting
`Python 2.5`_
and newer there are still some features of
If you are supporting
Python 2.5
and newer there are still some features of
Python that you can utilize.
...
...
@@ -230,11 +230,11 @@ Implicit relative imports (e.g., importing ``spam.bacon`` from within
This future statement moves away from that and allows the use of explicit
relative imports (e.g., ``from . import bacon``).
In
`Python 2.5`_
you must use
In
Python 2.5
you must use
the __future__ statement to get to use explicit relative imports and prevent
implicit ones. In
`Python 2.6`_
explicit relative imports are available without
implicit ones. In
Python 2.6
explicit relative imports are available without
the statement, but you still want the __future__ statement to prevent implicit
relative imports. In
`Python 2.7`_
the __future__ statement is not needed. In
relative imports. In
Python 2.7
the __future__ statement is not needed. In
other words, unless you are only supporting Python 2.7 or a version earlier
than Python 2.5, use this __future__ statement.
...
...
@@ -261,7 +261,7 @@ In Python 2.5 and earlier the syntax to access the current exception is::
# Current exception is 'exc'.
pass
This syntax changed in Python 3 (and backported to
`Python 2.6`_
and later)
This syntax changed in Python 3 (and backported to
Python 2.6
and later)
to::
try:
...
...
@@ -347,7 +347,7 @@ possibilities:
Subclass ``object``
'''''''''''''''''''
New-style classes have been around since
`Python 2.2`_
. You need to make sure
New-style classes have been around since
Python 2.2
. You need to make sure
you are subclassing from ``object`` to avoid odd edge cases involving method
resolution order, etc. This continues to be totally valid in Python 3 (although
unneeded as all classes implicitly inherit from ``object``).
...
...
@@ -610,12 +610,6 @@ please email the python-porting_ mailing list.
.. _modernize: https://github.com/mitsuhiko/python-modernize
.. _Porting to Python 3: http://python3porting.com/
.. _PyPI: https://pypi.python.org/
.. _Python 2.2: https://www.python.org/2.2.x
.. _Python 2.5: https://www.python.org/2.5.x
.. _Python 2.6: https://www.python.org/2.6.x
.. _Python 2.7: https://www.python.org/2.7.x
.. _Python 2.5: https://www.python.org/2.5.x
.. _Python 3.3: https://www.python.org/3.3.x
.. _Python 3 Packages: https://pypi.python.org/pypi?:action=browse&c=533&show=all
.. _Python 3 Q & A: http://ncoghlan-devs-python-notes.readthedocs.org/en/latest/python3/questions_and_answers.html
.. _python-porting: https://mail.python.org/mailman/listinfo/python-porting
...
...
Doc/howto/unicode.rst
View file @
0ffb4626
...
...
@@ -500,7 +500,7 @@ The documentation for the :mod:`codecs` module.
Marc-André Lemburg gave a presentation at EuroPython 2002 titled "Python and
Unicode". A PDF version of his slides is available at
<http://downloads.egenix.com/python/Unicode-EPC2002-Talk.pdf>, and is an
<http
s
://downloads.egenix.com/python/Unicode-EPC2002-Talk.pdf>, and is an
excellent overview of the design of Python's Unicode features.
...
...
@@ -687,7 +687,7 @@ References
The PDF slides for Marc-André Lemburg's presentation "Writing Unicode-aware
Applications in Python" are available at
<http://downloads.egenix.com/python/LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>
<http
s
://downloads.egenix.com/python/LSM2005-Developing-Unicode-aware-applications-in-Python.pdf>
and discuss questions of character encodings as well as how to internationalize
and localize an application.
...
...
Doc/howto/urllib2.rst
View file @
0ffb4626
...
...
@@ -560,9 +560,7 @@ This document was reviewed and revised by John Lee.
.. [#] For an introduction to the CGI protocol see
`Writing Web Applications in Python <http://www.pyzine.com/Issue008/Section_Articles/article_CGIOne.html>`_.
.. [#] Like Google for example. The *proper* way to use google from a program
is to use `PyGoogle <http://pygoogle.sourceforge.net>`_ of course. See
`Voidspace Google <http://www.voidspace.org.uk/python/recipebook.shtml#google>`_
for some examples of using the Google API.
is to use `PyGoogle <http://pygoogle.sourceforge.net>`_ of course.
.. [#] Browser sniffing is a very bad practise for website design - building
sites using web standards is much more sensible. Unfortunately a lot of
sites still send different versions to different browsers.
...
...
@@ -576,5 +574,5 @@ This document was reviewed and revised by John Lee.
scripts with a localhost server, I have to prevent urllib2 from using
the proxy.
.. [#] urllib2 opener for SSL proxy (CONNECT method): `ASPN Cookbook Recipe
<http://
aspn.activestate.com/ASPN/Cookbook/Python/Recipe/456195
>`_.
<http://
code.activestate.com/recipes/456195/
>`_.
Doc/howto/webservers.rst
View file @
0ffb4626
...
...
@@ -146,7 +146,7 @@ server may not be needed.
tutorial also describes the most common gotchas that might arise.
* On lighttpd you need to use the `CGI module
<http:
//
redmine
.
lighttpd
.
net
/
wiki
/
lighttpd
/
Docs:
ModCGI
>
`_\ , which can be configured
<http:
//
redmine
.
lighttpd
.
net
/
projects
/
lighttpd
/
wiki
/
Docs_
ModCGI
>
`_\ , which can be configured
in a straightforward way. It boils down to setting ``cgi.assign`` properly.
...
...
@@ -210,7 +210,7 @@ mod_python
----------
People coming from PHP often find it hard to grasp how to use Python in the web.
Their first thought is mostly `mod_python
<http:
//
www
.
modpython
.
org
/>
`_\ ,
Their first thought is mostly `mod_python
<http:
//
modpython
.
org
/>
`_\ ,
because they think that this is the equivalent to ``mod_php``. Actually, there
are many differences. What ``mod_python`` does is embed the interpreter into
the Apache process, thus speeding up requests by not having to start a Python
...
...
@@ -260,13 +260,6 @@ the latter.
These days, FastCGI is never used directly. Just like ``mod_python``, it is only
used for the deployment of WSGI applications.
.. seealso::
* `FastCGI, SCGI, and Apache: Background and Future
<http:
//
www
.
vmunix
.
com
/
mark
/
blog
/
archives
/
2006
/
01
/
02
/
fastcgi-scgi-and-apache-background-and-future
/>
`_
is a discussion on why the concept of FastCGI and SCGI is better than that
of mod_python.
Setting up FastCGI
^^^^^^^^^^^^^^^^^^
...
...
@@ -280,8 +273,8 @@ Each web server requires a specific module.
to be loaded by Apache.
* lighttpd ships its own `FastCGI module
<http:
//
redmine
.
lighttpd
.
net
/
wiki
/
lighttpd
/
Docs:
ModFastCGI
>
`_ as well as an
`SCGI module
<http:
//
redmine
.
lighttpd
.
net
/
wiki
/
lighttpd
/
Docs:
ModSCGI
>
`_.
<http:
//
redmine
.
lighttpd
.
net
/
projects
/
lighttpd
/
wiki
/
Docs_
ModFastCGI
>
`_ as well as an
`SCGI module
<http:
//
redmine
.
lighttpd
.
net
/
projects
/
lighttpd
/
wiki
/
Docs_
ModSCGI
>
`_.
* `nginx
<http:
//
nginx
.
org
/>
`_ also supports `FastCGI
<http:
//
wiki
.
nginx
.
org
/
NginxSimplePythonFCGI
>
`_.
...
...
@@ -314,7 +307,7 @@ FastCGI access.
.. seealso::
There is some documentation on `setting up Django with FastCGI
<http:
//
docs
.
djangoproject
.
com
/
en
/
dev
/
howto
/
deployment
/
fastcgi
/>
`_, most of
<http
s
:
//
docs
.
djangoproject
.
com
/
en
/
dev
/
howto
/
deployment
/
fastcgi
/>
`_, most of
which can be reused for other WSGI-compliant frameworks and libraries.
Only the ``manage.py`` part has to be changed, the example used here can be
used instead. Django does more or less the exact same thing.
...
...
@@ -648,7 +641,7 @@ here. Instead we will briefly touch on some of the most popular.
Django
^^^^^^
`Django
<http:
//
www
.
djangoproject
.
com
/>
`_ is a framework consisting of several
`Django
<http
s
:
//
www
.
djangoproject
.
com
/>
`_ is a framework consisting of several
tightly coupled elements which were written from scratch and work together very
well. It includes an ORM which is quite powerful while being simple to use,
and has a great online administration interface which makes it possible to edit
...
...
@@ -661,7 +654,7 @@ which make it possible to create web sites almost without writing any Python cod
It has a big, international community, the members of which have created many
web sites. There are also a lot of add-on projects which extend Django's normal
functionality. This is partly due to Django's well written `online
documentation
<http:
//
docs
.
djangoproject
.
com
/>
`_ and the `Django book
documentation
<http
s
:
//
docs
.
djangoproject
.
com
/>
`_ and the `Django book
<http:
//
www
.
djangobook
.
com
/>
`_.
...
...
@@ -669,7 +662,7 @@ documentation <http://docs.djangoproject.com/>`_ and the `Django book
Although Django is an MVC-style framework, it names the elements
differently, which is described in the `Django FAQ
<http:
//
docs
.
djangoproject
.
com
/
en
/
dev
/
faq
/
general
/
#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names
>
`_.
<http
s
:
//
docs
.
djangoproject
.
com
/
en
/
dev
/
faq
/
general
/
#django-appears-to-be-a-mvc-framework-but-you-call-the-controller-the-view-and-the-view-the-template-how-come-you-don-t-use-the-standard-names
>
`_.
TurboGears
...
...
@@ -712,7 +705,7 @@ access to these components to the wider Python community. There is even a
separate framework based on the Zope components: `Grok
<http:
//
grok
.
zope
.
org
/>
`_.
Zope is also the infrastructure used by the `Plone
<http:
//
plone
.
org
/>
`_ content
Zope is also the infrastructure used by the `Plone
<http
s
:
//
plone
.
org
/>
`_ content
management system, one of the most powerful and popular content management
systems available.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment