mirror of
https://github.com/kennethreitz/python-guide.git
synced 2026-06-05 14:50:19 +00:00
Fixed the urls pointing to contribute and fixed some lines that were
longer than 78 characters.
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ How to contribute
|
||||
This guide is under heavy development. If you would like to contribute, please
|
||||
see:
|
||||
|
||||
http://python-guide.readthedocs.org/en/latest/notes/contribute.html
|
||||
http://docs.python-guide.org/en/latest/notes/contribute.html
|
||||
|
||||
|
||||
Style Guide
|
||||
|
||||
Vendored
+1
-1
@@ -23,7 +23,7 @@
|
||||
This guide is the result of the collaboration of
|
||||
<a href="https://github.com/kennethreitz/python-guide/graphs/contributors">135+ people</a>
|
||||
around the world, and your contributions
|
||||
<a href="http://python-guide.readthedocs.org/en/latest/notes/contribute.html">are welcome</a>!
|
||||
<a href="http://docs.python-guide.org/en/latest/notes/contribute.html">are welcome</a>!
|
||||
</p>
|
||||
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ of the following components:
|
||||
done with the product, using one or two extremely simplified use
|
||||
cases. This is the thirty-second pitch for your project.
|
||||
|
||||
- A *tutorial* should show some primary use cases in more detail. The reader will
|
||||
follow a step-by-step procedure to set-up a working prototype.
|
||||
- A *tutorial* should show some primary use cases in more detail. The reader
|
||||
will follow a step-by-step procedure to set-up a working prototype.
|
||||
|
||||
- An *API reference* is typically generated from the code (see
|
||||
:ref:`docstrings <docstring-ref>`). It will list all publicly available interfaces,
|
||||
parameters, and return values.
|
||||
:ref:`docstrings <docstring-ref>`). It will list all publicly available
|
||||
interfaces, parameters, and return values.
|
||||
|
||||
- *Developer documentation* is intended for potential contributors. This can
|
||||
include code convention and general design strategy of the project.
|
||||
@@ -107,7 +107,8 @@ In Python, *docstrings* describe modules, classes, and functions:
|
||||
"""Returns the square root of self times self."""
|
||||
...
|
||||
|
||||
In general, follow the comment section of :pep:`8#comments` (the "Python Style Guide").
|
||||
In general, follow the comment section of :pep:`8#comments` (the "Python Style
|
||||
Guide").
|
||||
|
||||
Commenting Sections of Code
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -6,9 +6,10 @@ avoids surprises. However, there are a few cases that can be confusing to
|
||||
newcomers.
|
||||
|
||||
Some of these cases are intentional but can be potentially surprising. Some
|
||||
could arguably be considered language warts. In general though, what follows is a collection
|
||||
of potentially tricky behavior that might seem strange at first glance, but is
|
||||
generally sensible once you're aware of the underlying cause for the surprise.
|
||||
could arguably be considered language warts. In general though, what follows
|
||||
is a collection of potentially tricky behavior that might seem strange at first
|
||||
glance, but is generally sensible once you're aware of the underlying cause for
|
||||
the surprise.
|
||||
|
||||
|
||||
.. _default_args:
|
||||
@@ -139,7 +140,8 @@ completed and ``i`` is left with its final value of 4.
|
||||
What's particularly nasty about this gotcha is the seemingly prevalent
|
||||
misinformation that this has something to do with :ref:`lambdas <python:lambda>`
|
||||
in Python. Functions created with a ``lambda`` expression are in no way special,
|
||||
and in fact the same exact behavior is exhibited by just using an ordinary ``def``:
|
||||
and in fact the same exact behavior is exhibited by just using an ordinary
|
||||
``def``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
@@ -179,6 +181,6 @@ Alternatively, you can use the functools.partial function:
|
||||
When the Gotcha Isn't a Gotcha
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Sometimes you want your closures to behave this way. Late binding is good in lots of
|
||||
situations. Looping to create unique functions is unfortunately a case where
|
||||
they can cause hiccups.
|
||||
Sometimes you want your closures to behave this way. Late binding is good in
|
||||
lots of situations. Looping to create unique functions is unfortunately a case
|
||||
where they can cause hiccups.
|
||||
|
||||
@@ -48,5 +48,6 @@ To help you choose one for your project, there's a `license chooser <http://choo
|
||||
+ GPLv2
|
||||
+ GPLv3
|
||||
|
||||
A good overview of licenses with explanations of what one can, cannot, and must do using a particular software can be found at `tl;drLegal <https://tldrlegal.com/>`_.
|
||||
|
||||
A good overview of licenses with explanations of what one can, cannot,
|
||||
and must do using a particular software can be found at
|
||||
`tl;drLegal <https://tldrlegal.com/>`_.
|
||||
|
||||
Reference in New Issue
Block a user