Skip to content

Commit

Permalink
Documentation cleanaup and improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
mlenzen committed Mar 27, 2016
1 parent 29a9ce7 commit b447125
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 29 deletions.
10 changes: 2 additions & 8 deletions collections_extended/bags.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,7 @@ def __xor__(self, other):


class bag(_basebag, MutableSet):
"""bag is a mutable _basebag.
Thus not hashable and unusable for dict keys or in other sets.
"""
"""bag is a mutable unhashable bag."""

def pop(self):
"""Remove and return an element of self."""
Expand Down Expand Up @@ -497,10 +494,7 @@ def __iadd__(self, other):


class frozenbag(_basebag, Hashable):
"""frozenbag is an immutable _basebag.
Thus it is Hashable and usable for dict keys
"""
"""frozenbag is an immutable, hashable bab."""

def __hash__(self):
"""Compute the hash value of a frozenbag.
Expand Down
3 changes: 1 addition & 2 deletions collections_extended/range_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def __init__(self, iterable=None, default_value=_empty):

@classmethod
def from_mapping(cls, mapping):
"""Create a RangeMap from a mapping of interval starts to values.
"""
"""Create a RangeMap from a mapping of interval starts to values."""
obj = cls()
obj._init_from_mapping(mapping)
return obj
Expand Down
8 changes: 5 additions & 3 deletions collections_extended/setlists.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def copy(self):


class setlist(_basesetlist, MutableSequence, MutableSet):
"""A mutable (unhashable) setlist that inherits from _basesetlist."""
"""A mutable (unhashable) setlist."""

# Implement MutableSequence
def __setitem__(self, index, value):
Expand Down Expand Up @@ -238,7 +238,7 @@ def append(self, value):
def extend(self, values):
"""Append all values to the end.
This should be atomic, if any of the values are present, ValueError will
If any of the values are present, ValueError will
be raised and none of the values will be appended.
Args:
Expand Down Expand Up @@ -283,6 +283,8 @@ def remove(self, value):
def remove_all(self, elems_to_delete):
"""Remove all elements from elems_to_delete, raises ValueErrors.
See Also:
discard_all
Args:
elems_to_delete (Iterable): Elements to remove.
Raises:
Expand Down Expand Up @@ -366,7 +368,7 @@ def shuffle(self, random=None):


class frozensetlist(_basesetlist, Hashable):
"""An immutable (hashable) setlist that inherits from _basesetlist."""
"""An immutable (hashable) setlist."""

def __hash__(self):
return Set._hash(self)
4 changes: 1 addition & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,7 @@
'travis_button': True,
'coveralls_button': True,
'analytics_id': 'UA-4495487-4',
'extra_nav_links': {
'PyPI': 'https://pypi.python.org/pypi/collections-extended',
},
'pypi_name': 'collections-extended',
}

# Add any paths that contain custom themes here, relative to this directory.
Expand Down
18 changes: 7 additions & 11 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,15 @@ Contents:
api
contributing

Other Packages of Interest
==========================

- http://stutzbachenterprises.com/blist/ - b+ trees,
- https://bitbucket.org/mozman/bintrees - Binary search trees
- https://bidict.readthedocs.org/en/master/ - bijections

:Author: Michael Lenzen
:Copyright: 2016 Michael Lenzen
:License: Apache License, Version 2.0
:Documentation: http://collections-extended.lenzm.net/
:GitHub: https://github.com/mlenzen/collections-extended
:PyPI: https://pypi.python.org/pypi/collections-extended


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`

.. _`tested against`: https://travis-ci.org/mlenzen/collections-extended
4 changes: 2 additions & 2 deletions docs/setlists.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
setlist
=======
setlists
========

A ``setlist`` is an ordered, indexed
collection with unique elements. It it more than just an **ordered Set**
Expand Down

0 comments on commit b447125

Please sign in to comment.