some strutils docstring tweaks

This commit is contained in:
Mahmoud Hashemi 2015-04-01 20:08:52 -07:00
parent 6f47e5e594
commit 7c29c96422
1 changed files with 10 additions and 10 deletions

View File

@ -1,9 +1,9 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
""" """\
So much practical programming is string manipulation, and Python So much practical programming involves string manipulation, which
definitely accomodates. Still, there are dozens of basic and common Python readily accomodates. Still, there are dozens of basic and
capabilities missing from the standard library, several of them common capabilities missing from the standard library, several of them
provided and tested below. provided by ``strutils``.
""" """
import re import re
@ -72,9 +72,9 @@ def slugify(text, delim='_', lower=True, ascii=False):
def split_punct_ws(text): def split_punct_ws(text):
"""\ """\
:meth:`str.split` will split on whitespace, :func:`split_punct_ws` While :meth:`str.split` will split on whitespace,
will split on punctuation and whitespace. This is mostly here for :func:`split_punct_ws` will split on punctuation and
use by :func:`slugify`, above. whitespace. This used internally by :func:`slugify`, above.
>>> split_punct_ws('First post! Hi!!!!~1 ') >>> split_punct_ws('First post! Hi!!!!~1 ')
['First', 'post', 'Hi', '1'] ['First', 'post', 'Hi', '1']
@ -85,8 +85,8 @@ def split_punct_ws(text):
def unit_len(sized_iterable, unit_noun='item'): # TODO: len_units()/unitize()? def unit_len(sized_iterable, unit_noun='item'): # TODO: len_units()/unitize()?
""" """
Returns a plain-English description of an iterable's ``len()``, Returns a plain-English description of an iterable's :func:`len()`x,
conditionally pluralized with :func:`cardinalize` (below). conditionally pluralized with :func:`cardinalize`, detailed below.
>>> print unit_len(range(10), 'number') >>> print unit_len(range(10), 'number')
10 numbers 10 numbers